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

Is anyone using i18n? I had a problem when I tried to use it

ANSWERED

@JonFitbit Is anyone using i18n? I found when I try to load more than six .po files in the app\i18n directory, the app fails to sideload. It doesn't seem to matter which six and the companion\i18n directory is not so limited.

 

I'm using a javascript method to support the 11 languages Fitbit generally supports, but supporting 11 languages even when loaded from the companion, invariably takes up more javascript memory than I think the i18n should be capable of.

 

I'd like to use the i18n, it looks really useful, and a whole lot cleaner than javascripting it, but I don't want to limit my app to 6 languages.

 

The watchface I'm talking about has translations supported in the device, the settings page, and the help file, but after the i18n problem, it's all pretty much javascript.

 

Watchface is at https://gallery.fitbit.com/details/bda6f514-3946-49ba-a4ed-75e8470ab034

ILuvChronoAnim.gif

 

 

 

 

 

Thanks,

Reign

Best Answer
0 Votes
1 BEST ANSWER

Accepted Solutions

Yes, I regularly use more than 6 languages. The sample app also does https://github.com/Fitbit/sdk-i18n/tree/master/app/i18n

 

It's hard to know what's wrong without seeing the project.

View best answer in original post

Best Answer
0 Votes
8 REPLIES 8

Yes, I regularly use more than 6 languages. The sample app also does https://github.com/Fitbit/sdk-i18n/tree/master/app/i18n

 

It's hard to know what's wrong without seeing the project.

Best Answer
0 Votes

Thanks @JonFitbit, that actually does answer my question, the problem is with my app. That actually seemed likely, but when I searched for i18n I found very few entries other than your introduction of it.

 

Considering that my watchface fails to install and that it is large in both js and resources, it seems likely it is running into some limit.

 

I think I will set up i18n on the companion and settings. That is where most the most need for translation is anyway. And,... if it is a memory or resource limit, the companion app is unlikely to be so limited.

 

Regards,

Best Answer
0 Votes

Had some issues with i18n lately, too. I am using all avaliable languages in my clock faces, but sometimes some of my clock faces refuse to start. I tracked the problem down to chinese i18n files. If I remove those, the clock faces start to work again. Maybe you have the same issues.

 

Regards,

Maxim

Best Answer
0 Votes

@Maxim_ do you have a sample of that file?

Best Answer
0 Votes

@JonFitbitI will send you a pm with a project that fails with chinese language files. If you rename/remove the i18n files, the watch face runs fine. Otherwise an error is thrown directly after install with cli tools (see screenshot in provided .zip). Does not seem to be a memory issue.

Best Answer
0 Votes

If you can remove any 2 other language files instead of the Chinese 2, it may be the same problem.

Best Answer
0 Votes

Ok, I found the issue. You seem to be hitting a file size limit which is on the manifest.json file generated in the build.

 

If you reduce the size of your package.json file, the app installs fine with all languages selected.

 

I removed the i18n section for the clockface name, since you weren't really using it.

{
  "fitbit": {
    "appUUID": "06d7f82c-ff0d-457b-962a-4bf917b7ed11",
    "appType": "clockface",
    "appDisplayName": "Halloween Analog",
    "iconFile": "resources/icon.png",
    "requestedPermissions": [
      "access_internet",
      "access_activity",
      "access_heart_rate",
      "access_location"
    ],
    "buildTargets": [
      "meson",
      "higgs",
      "gemini"
    ]
  },
  "devDependencies": {
    "@fitbit/sdk": "~4.0.0",
    "@fitbit/sdk-cli": "^1.7.0"
  },
  "scripts": {
    "build": "fitbit-build"
  }
}
Best Answer
0 Votes

Thanks for looking into it! I thought the locale definitions where needed, because Fitbit Studio said "Supported Locales". Good to know that I can dismiss them.

Guess it's time for a bulk update, finished my batch update script just in time 🙂

Best Answer
0 Votes