06-06-2019 06:26
06-06-2019 06:26
I really love the new i18n feature and I'm using it for all my clock faces.
One thing I'm missing is the possibility to override the default language.
I like to have the option to change the language of a clock face without having to change the Fitbit profile language.
So I'm proposing an extension to the gettext function: Add a second optional string parameter. If present it overrides the default system language and returns the string in the specified language.
Examples with Fitbit profile language setting to en-US:
gettext("day0") // returns "Monday"
gettext("day0", "de-DE") // returns "Montag"
06-07-2019 02:19
Fitbit Developers oversee the SDK and API forums. We're here to answer questions about Fitbit developer tools, assist with projects, and make sure your voice is heard by the development team.
06-07-2019 02:19
It isn't quite what you're describing, but you can set the default language in package.json via the `defaultLanguage` key within the `fitbit` section.
This will be used when the users preferred language isn't available in your app
Due to resource constraints the firmware only loads a single language at once into memory when the app launches, which is why you can't pass an extra parameter to request a different language for that particular call.
Best Answer06-07-2019 05:23
06-07-2019 05:23
I was afraid that it wouldn't be that simple, thanks for checking.
Wouldn't it be possible to make a second API function to get the strings out of the translation files? I mean the files are there, its just a matter of extracting the right string.
Wouldn't be as effective as gettext, but there would at least be a way to get the strings.
Best Answer