I just made the initial version of recoyx_messaeg_localization, which parses locale and country codes (not any String
is a valid language identifier), associates country to a locale (for example, English (United States)) and provides a MessageLocator
(loads from HTTP or File System, can be cloned (robust for website routers) and reflect options given at MessageLocator
instantiation).
While translating messages, you can add underscore suffixes, like locator.get_formatted("_.message_id", vec![ "female" ])
, which is equivalent to locator.get("_.message_id_female")
.
Features it doesn't have, but maybe could be easy to add, are currency, collation and plurals (these could be implemented in Locale
itself rather than in LocaleMap
).