lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


> tr.zh_CN["hello"]  = "你好"
> tr.en_US["hello"] = "hello"

You can also try Sputnik's i18n module, which is similar to what
Gustavo proposed but adds handling of fallbacks, so that it could be
configured to, for example, offer "pt_BR" as a fallback for all "pt_*"
locales (i.e., use it if, say "pt_PT" is not available) and to further
fall back on, say, "en_US" if there is nothing better.

https://github.com/yuri/sputnik/blob/master/sputnik/lua/sputnik/i18n.lua

- yuri