New in SDK 3.1
Look up the translation for a given message ID
Translations are sourced from PO files within the project sources
PO files should be located within in a directory named
i18n within the directory of the relevant component and named using a supported
BCP-47 language tag. The following tags are currently supported:
PO files look like so:
msgid "hello_world" msgstr "Hello world!" msgid "heart_rate" msgstr "Heart rate"
Falls back to decreasingly specific translations before finally falling back to returning the message ID.
If a user has a locale selected for which there is no exact match supported, they will receive the supported locale within that language where possible.
For example, given a user locale of fr-CA, it will attempt the following in order:
- Return translation from fr-FR.po (France French)
- Return translation from developer configured default language
- Return message ID
The default language if not explicitly set is en-US. Developers may configure the default language by setting
defaultLanguage property within the
fitbit section of their package.json file.
Fallback happens on a PO file level, rather than a per message ID basis.
Additional features such as plurals and contexts are not supported at this time.
Message ID string to look up