From: Steven Barth Date: Sun, 25 May 2008 15:55:39 +0000 (+0000) Subject: * core: Added shortcut translatef for translate and format X-Git-Tag: 0.8.0~994 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=c6c50b3ec60b284107f459e5923c146d515afd2a;p=oweals%2Fluci.git * core: Added shortcut translatef for translate and format --- diff --git a/core/src/i18n.lua b/core/src/i18n.lua index 88381dde7..4e4187308 100644 --- a/core/src/i18n.lua +++ b/core/src/i18n.lua @@ -55,4 +55,9 @@ end -- Returns the i18n-value defined by "key" or if there is no such: "default" function translate(key, default) return table[key] or default +end + +-- Translate shourtcut with sprintf/string.format inclusion +function translatef(key, default, ...) + return translate(key, default):format(...) end \ No newline at end of file