Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Get a localized list of countries #890

Open
monsieurtanuki opened this issue Mar 11, 2024 · 4 comments · May be fixed by #904
Open

Get a localized list of countries #890

monsieurtanuki opened this issue Mar 11, 2024 · 4 comments · May be fixed by #904

Comments

@monsieurtanuki
Copy link
Contributor

Why - Problem description

cf. openfoodfacts/smooth-app#4921
In Smoothie we use a package in order to localize the country names.
This package is only available for iOS and Android (not linux, macOS, web, windows).
And on the server we can retrieve localized countries, with https://world.openfoodfacts.org/cgi/countries.pl?lc=de

What - Proposed solution

We should be able to use the server to localize country names.
Something like that:

  static Future<Map<OpenFoodFactsCountry, String>> getLocalizedCountries(
    final OpenFoodFactsLanguage language, {
    final UriProductHelper uriHelper = uriHelperFoodProd,
  }) async { //...

Additional context

That could also be a good opportunity to check if some countries are missing in OpenFoodFactsCountry.values.

@shubhsardana29
Copy link

Are there any specific considerations or requirements regarding how the localized country names should be handled in cases where there might be discrepancies or inconsistencies between the data provided by the server and the expected country names within the application's context?

@monsieurtanuki
Copy link
Contributor Author

@shubhsardana29 We just want to return a map of OpenFoodFactsCountry and String. We have no expectations regarding the localizations.
In the process, we may find unexpected countries: just report them and we'll see later what to do with them (e.g. we may not need Yugoslavia in 2024).

@monsieurtanuki
Copy link
Contributor Author

@shubhsardana29 Feel like starting to code? No hard sell.

@monsieurtanuki
Copy link
Contributor Author

@shubhsardana29 Too late ;)

@monsieurtanuki monsieurtanuki removed their assignment Apr 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging a pull request may close this issue.

2 participants