Cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Feature request: extend gettext function by second parameter to chose a different language

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"

 

Best Answer
0 Votes
2 REPLIES 2

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 Answer
0 Votes

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
0 Votes