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

Monolingual product? #6159

Open
g123k opened this issue Jan 8, 2025 · 3 comments
Open

Monolingual product? #6159

g123k opened this issue Jan 8, 2025 · 3 comments

Comments

@g123k
Copy link
Collaborator

g123k commented Jan 8, 2025

Hi everyone (and especially @monsieurtanuki)!

With the following product (8445291024304), the app considers the ingredients as monolingual.

However, on the website, we can add new languages for this field.
Are-there any reason?

@monsieurtanuki
Copy link
Contributor

Hi @g123k!
My computer is gone for at least 2 weeks, which doesn't help.
If I go to https://world.openfoodfacts.org/api/v3/product/8445291024304?fields=ingredients_text,ingredients_text_languages, this is what I get:

{
  "code": "8445291024304",
  "errors": [],
  "product": {
    "ingredients_text": "",
    "ingredients_text_languages": {
      "fr": ""
    }
  },
  "result": {
    "id": "product_found",
    "lc_name": "Product found",
    "name": "Product found"
  },
  "status": "success",
  "warnings": []
}

From what I see in multilingual_helper.dart, in some cases an empty multilingual text means a monolingual text:

bool isMonolingual() => _initialMultilingualTexts.isEmpty;

My hunch (reading the init method) is that this product has no images at all (very rare case by the time this was coded) and that it somehow causes the app to consider it monolingual, as it has no relevant ingredient texts either.
It's not an excuse, it's an explanation.
Feel free to fix it.

@g123k
Copy link
Collaborator Author

g123k commented Jan 8, 2025

By fixing it, basically, I will remove the code and it will always be multilingual ;)

To be sure, @alexgarel / @stephanegigandet:

  • Our problem here is when there's no photo of the ingredients
  • Should we keep that monolingual feature? / When should we consider a product monolingual?
  • On the website, with this product, the dropdown with the languages is working

@monsieurtanuki
Copy link
Contributor

By fixing it, basically, I will remove the code and it will always be multilingual ;)

As you wish. As long as you're able to find the correct "mono" language.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: 💬 To discuss and validate
Development

No branches or pull requests

2 participants