summaryrefslogtreecommitdiffhomepage
path: root/core
diff options
context:
space:
mode:
authorSteven Barth <steven@midlink.org>2008-05-25 15:55:39 +0000
committerSteven Barth <steven@midlink.org>2008-05-25 15:55:39 +0000
commitc6c50b3ec60b284107f459e5923c146d515afd2a (patch)
tree476cc5fcb1321da458e0b94a72e4cdfa14b696f3 /core
parent0200ca38ebe185408f830f334e15fb391d542a39 (diff)
* core: Added shortcut translatef for translate and format
Diffstat (limited to 'core')
-rw-r--r--core/src/i18n.lua5
1 files changed, 5 insertions, 0 deletions
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