diff --git a/druid/extended/lang_text.lua b/druid/extended/lang_text.lua old mode 100644 new mode 100755 index af4ba16..06b5a8e --- a/druid/extended/lang_text.lua +++ b/druid/extended/lang_text.lua @@ -61,11 +61,20 @@ end --- Translate the text by locale_id -- @tparam LangText self -- @tparam string locale_id Locale id -function LangText.translate(self, locale_id, ...) - self.last_locale_args = {...} +-- @tparam string ... Locale arguments to pass in text function +function LangText.translate(self, locale_id, a, b, c, d, e, f, g) + self.last_locale_args = { a, b, c, d, e, f, g } self.last_locale = locale_id or self.last_locale - self.text:set_to(settings.get_text(self.last_locale, ...) or "") + self.text:set_to(settings.get_text(self.last_locale, a, b, c, d, e, f, g) or "") end +--- Format string with new text params on localized text +-- @tparam LangText self +-- @tparam string ... Locale arguments to pass in text function +function LangText.format(self, a, b, c, d, e, f, g) + self.last_locale_args = { a, b, c, d, e, f, g } + self.text:set_to(settings.get_text(self.last_locale, a, b, c, d, e, f, g) or "") +end + return LangText diff --git a/druid/system/settings.lua b/druid/system/settings.lua old mode 100644 new mode 100755 index 0b9cfd9..9d217ab --- a/druid/system/settings.lua +++ b/druid/system/settings.lua @@ -9,7 +9,7 @@ local M = {} M.default_style = nil -function M.get_text(name, ...) +function M.get_text(name, a, b, c, d, e, f, g) return "[Druid]: locales not inited" end