Module:I18n: Difference between revisions
m Protected "Module:I18n" ([Edit=Allow only administrators] (indefinite) [Move=Allow only administrators] (indefinite)) |
add useLanguageConversionType from https://dev.fandom.com/wiki/Module:I18n line 378-386 |
||
| (3 intermediate revisions by 2 users not shown) | |||
| Line 2: | Line 2: | ||
-- The module is designed to enable message separation from modules & | -- The module is designed to enable message separation from modules & | ||
-- templates. It has support for handling language fallbacks. This | -- templates. It has support for handling language fallbacks. This | ||
-- module is a Lua port of | -- module is a Lua port of I18n-js and i18n modules that can be loaded | ||
-- by it are editable through | -- by it are editable through I18nEdit. | ||
-- | -- | ||
-- @module i18n | -- @module i18n | ||
| Line 13: | Line 13: | ||
-- @attribution [[User:Cqm|Cqm]] | -- @attribution [[User:Cqm|Cqm]] | ||
-- @release stable | -- @release stable | ||
-- <nowiki> | -- <nowiki> | ||
local i18n, _i18n = {}, {} | local i18n, _i18n = {}, {} | ||
| Line 283: | Line 280: | ||
and code | and code | ||
or self.tempLang | or self.tempLang | ||
return self | |||
end | |||
--- Sets temporary data language to a specificed language conversion resolution. | |||
-- Only affects the next @{Data:msg} call. | |||
-- @function Data:useLanguageConversionType | |||
-- @param {string} convType Language conversion type to use. | |||
-- @return {Data} Datastore instance. | |||
function Data:useLanguageConversionType(convType) | |||
self.tempLanguageConversionType = convType | |||
return self | return self | ||
end | end | ||