Add core.get_translator_auto(true)

master
luk3yx 2022-02-11 10:04:21 +13:00
parent 5cf79ce632
commit e3636b43bf
1 changed files with 6 additions and 0 deletions

View File

@ -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())