Module:languages/error/documentation

Hello, you have come here looking for the meaning of the word Module:languages/error/documentation. In DICTIOUS you will not only get to know all the dictionary meanings for the word Module:languages/error/documentation, but we will also tell you about its etymology, its characteristics and you will know how to say Module:languages/error/documentation in singular and plural. Everything you need to know about the word Module:languages/error/documentation you have here. The definition of the word Module:languages/error/documentation will help you to be more precise and correct when speaking or writing your texts. Knowing the definition ofModule:languages/error/documentation, as well as those of other words, enriches your vocabulary and provides you with more and better linguistic resources.
Use the second parameter of getByCode() instead of directly invoking this module.
The preferred way to generate an error message for an invalid language code is to pass the parameter name holding the language code as the parameter getByCode() rather than directly invoking this module. Code in some modules directly invokes this module, but this is generally old code that should be cleaned up.

Preferred calling convention

local m_languages = require("Module:languages")
local lang = m_languages.getByCode(frame.args, 1)

Here, we call getByCode with the parameter name in the second parameter.

Old (obsolete) calling convention

require("Module:languages/error")(lang, param, text)

Looks at a supposed language code passed through a template parameter and returns a helpful error message depending on whether the language code has a valid form (two or three lowercase basic Latin letters, two or three groups of three lowercase basic Latin letters separated by hyphens).

Add the parameter value in argument #1 and the parameter name in argument #2. For instance, if parameter 1 of the template is supposed to be a language code, this function can be called the following way:

local m_languages = require("Module:languages")
local lang = m_languages.getByCode(frame.args) or require("Module:languages/error")(frame.args, 1)

If you would like the error message to say something other than "language code", place the phrase in argument #3.