From e3636b43bf1e4e603b2d65adf22b6ac7a8bd0d69 Mon Sep 17 00:00:00 2001 From: luk3yx Date: Fri, 11 Feb 2022 10:04:21 +1300 Subject: [PATCH] Add core.get_translator_auto(true) --- builtin/intllib/init.lua | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/builtin/intllib/init.lua b/builtin/intllib/init.lua index 45a3fe7ed..743c94cdb 100644 --- a/builtin/intllib/init.lua +++ b/builtin/intllib/init.lua @@ -217,6 +217,12 @@ function core.get_translator_auto(langs) return (intllib.make_gettext_pair()) end end + elseif langs then + -- If intllib can find any translations for this mod in the current + -- language then use intllib. + if next(intllib.get_strings()) then + return (intllib.make_gettext_pair()) + end end return core.get_translator(core.get_current_modname())