openfoodfacts/openfoodfacts-ios

Nutriments are not translated in edit mode

teolemon opened this issue · 5 comments

For some of the nutrients, we need to be using the tag name of the nutrient instead of its English or French or whatever language
saturated-fat instead of "Saturated Fat"
image

See also #716

I suspect this is related to Realm, as it can not find the translation in the Nutriments taxonomy.

When you click on add a nutrient, you get a list of very nice looking nutrients. Are those from Realm as well ?

Yes those are taken from Realm as well, but with a different call.

I can only explain this if the key we use has changed.

We seem to have lost the prefix en: somehow. Adding it solves the issue for most keys.

There is only an issue for carbohydrates and fiber left.

The intention of the change was to use the same keys for the json as for the nutriment taxonomies. And there seems to be a mismatch.

  • carbohydrate vs en:carbohydrates
  • fiber vs en:dietary-fiber