PhantomCaleb (talk | contribs) m (HylianKing moved page Module:Translate to Module:I18n without leaving a redirect) |
PhantomCaleb (talk | contribs) No edit summary |
||
Line 1: | Line 1: | ||
local p = {} |
local p = {} |
||
− | function p. |
+ | function p.getString(path) |
+ | local code = mw.getContentLanguage():getCode() |
||
− | mw.logObject(Strings) |
||
+ | local localeStrings = Strings[code] |
||
+ | local subkey = mw.text.split(path, "%.") |
||
+ | |||
+ | local result = localeStrings |
||
+ | for _, subkey in ipairs() do |
||
+ | result = result[subkey] |
||
+ | end |
||
+ | return result |
||
end |
end |
||
Revision as of 01:04, 14 March 2020
Documentation for this module may be created at Module:I18n/Documentation