Open shunkongcheung opened 5 years ago
The idea was never brought up but I am not against it. We've got english, I could handle the French and if you provide a 3rd language, that could be a good start.
Have you thought about the API. Currently, it is one large object literal with the "{code}_NAME" and "{code}_MESSAGE" properties. I am not sure "{code}_NAME" should and would be easy to translate, I consider them more as code than name. An easy way to handle this issue is to create an alternative "{code}_MESSAGE" property in the form of "{code}MESSAGE{lang}". An other way would be to expose a function which take the lang as argument and which contextualize the return object. The latter approach is dynamic and could provide more flexibility to handle locale with subcodes (eg: fr-CA) and default values.
Any plan on supporting multi-language? Thanks