[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: i18n in Lua
- From: Yuri Takhteyev <yuri@...>
- Date: Wed, 12 Jan 2011 21:05:18 -0500
> 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