More actions
Create i18n module Tag: Reverted |
No edit summary Tag: Reverted |
||
| Line 1: | Line 1: | ||
local i18n = {} | local i18n = { | ||
label_upload_image = "Upload image", | |||
category_infobox_using_placeholder_image = "Pages using infobox placeholder image" | |||
} | |||
local p = {} | |||
function i18n | function p.new() | ||
return | local self = setmetatable({}, { __index = i18n }) | ||
function self.translate(_, key) | |||
return i18n[key] or key | |||
end | |||
return self | |||
end | end | ||
return | return p | ||
Revision as of 17:57, 24 May 2025
Documentation for this module may be created at Module:I18n/doc
local i18n = {
label_upload_image = "Upload image",
category_infobox_using_placeholder_image = "Pages using infobox placeholder image"
}
local p = {}
function p.new()
local self = setmetatable({}, { __index = i18n })
function self.translate(_, key)
return i18n[key] or key
end
return self
end
return p