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

Default productName and languages #816

Closed
monsieurtanuki opened this issue Oct 26, 2023 · 2 comments · Fixed by #817
Closed

Default productName and languages #816

monsieurtanuki opened this issue Oct 26, 2023 · 2 comments · Fixed by #817
Labels
🐛 bug Something isn't working

Comments

@monsieurtanuki
Copy link
Contributor

Description

Starting about 3 days ago, the unit tests don't pass anymore, cf. https://github.com/monsieurtanuki/openfoodfacts-dart/actions/runs/6653878935/job/18080780143

When we ask for the product_name, we expect it to match the language (lc) when relevant.

In the following case, that means we expected product_name to be "Pfannkuchen", as we ask for a German localization and there's a localization in German.
https://world.openfoodfacts.net/api/v3/product/2222222222225?fields=code,product_name,product_name_languages&lc=de&cc=de

{
    "code": "2222222222225",
    "errors": [],
    "product": {
        "code": "2222222222225",
        "product_name": "Pancakes",
        "product_name_languages": {
            "de": "Pfannkuchen",
            "en": "Pancakes",
            "ru": "Блинчики"
        }
    },
    "result": {
        "id": "product_found",
        "lc_name": "Produkt gefunden",
        "name": "Product found"
    },
    "status": "success",
    "warnings": []
}

Expected behavior

We expect the unit tests to pass.
Other solution: if the business rules changed regarding the default language for product_name, we need to reflect that in our unit tests.

@monsieurtanuki
Copy link
Contributor Author

@stephanegigandet Has something recently changed regarding the default product_name when several translations are available?

@monsieurtanuki
Copy link
Contributor Author

Maybe related to openfoodfacts/smooth-app#4672

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐛 bug Something isn't working
1 participant