MediaWiki:Gadget-I18n-js.js: Difference between revisions
From Tardis Wiki, the free Doctor Who reference
Adding documentation
(Add check to wgPageContentModel) |
(Adding documentation) |
||
Line 540: | Line 540: | ||
/* | /* | ||
* Get a translation of a message from the messages object in the | * Get a translation of a message from the messages object in the requested | ||
* | * language. | ||
* | |||
* - Missing `messages`, `msgName`, `lang` parameters: `return false;` . | |||
* - Didn't find message in the current language: Try the fallback list. | |||
* - Didn't find a fallback list for current language: Try to find `en` message. | |||
* - Didn't find message in the current fallback language: Try to find message | |||
* in the next fallback language. | |||
* - Found duplicated language code in the fallback list: | |||
* `warnOnFallbackLoop(lang, fallbackChain)`. | |||
* - Didn't find more language code in the fallback list: Try to find `en` message. | |||
* - Didn't find message in `en`: `return false;`. | |||
* | * | ||
* @param {object} messages The message object to look translations up in. | * @param {object} messages The message object to look translations up in. |