Module:Lang: Difference between revisions

Sur (talk | contribs)
m search_string finished
Sur (talk | contribs)
m key param renamed to label for search_string
Line 23: Line 23:
local data = get_lang_file(lang_code)
local data = get_lang_file(lang_code)
if (data == nil) then
if (data == nil) then
return string.format("Language file for code '%s' not found", lang_code)
return string.format("Lang code '%s' does not have a json file", lang_code)
end
end
Line 36: Line 36:
-- Search for a localized string using its English label
-- Search for a localized string using its English label
p.search_string = function(frame)
p.search_string = function(frame)
local key = frame.args[1]
local label = frame.args[1]
local lang_code_override = frame.args[2]
local lang_code_override = frame.args[2]