--- Translate shourtcut with sprintf/string.format inclusion
-function translatef(key, default, ...)
- return translate(key, default):format(...)
-end
\ No newline at end of file
+--- Return the translated value for a specific translation key
+-- and ensure that the returned value is a Lua string value.
+-- This is the same as calling <code>tostring(translate(...))</code>
+-- @param key Default translation text
+-- @return Translated string
+function string(key)
+ return tostring(translate(key))
+end
+
+--- Return the translated value for a specific translation key and use it as sprintf pattern.
+-- Ensure that the returned value is a Lua string value.
+-- This is the same as calling <code>tostring(translatef(...))</code>
+-- @param key Default translation text
+-- @param ... Format parameters
+-- @return Translated and formatted string
+function stringf(key, ...)
+ return tostring(translate(key)):format(...)
+end