Open teolemon opened 3 years ago
I think it's already fixed for languages: String lc
being deprecated and OpenFoodFactsLanguage language
being used instead.
A solution for countries would be to
OpenFoodFactsCountry
enum
, extended with 2-letter ISO codecc
in AbstractQueryConfiguration
, overridden by a new OpenFoodFactsCountry? country
parameter@teolemon Is that correct? May I start coding that?
We discussed that again last evening with @alexgarel and @jasmeet0817 and the consensus seemed to go for a server side fix. Here's the server side place where it happens: https://github.com/openfoodfacts/openfoodfacts-server/blob/12d65665d997902b6a4850f5c55ba313ed320150/cgi/product_jqm_multilingual.pl#L231
Trying to gather a few more opinions before answering
@teolemon Understood.
The legitimate question of fixing the potentially flawed data provided by the user is not in contradiction with my suggestion, though.
Creating an enum
would bring clarity to the code. For the moment all we say is that there's a parameter called cc
, that it is a String
and that it is optional. A parameter named OpenFoodFactsCountry? country
is easier to understand.
@teolemon #292 partially answers this issue, with explicit country codes. If the issue is more about an implicit country-to-default-language map, that's another story. Even more if this map is dealt with on the server side - what did you guys decide eventually? Please feel free to close this issue or to add specs.