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

Gallery opens on the wrong language #6054

Open
fgouget opened this issue Dec 16, 2024 · 5 comments
Open

Gallery opens on the wrong language #6054

fgouget opened this issue Dec 16, 2024 · 5 comments

Comments

@fgouget
Copy link

fgouget commented Dec 16, 2024

What

The product below has two languages, "French" and "English" where "French" is the main language according to the website:
https://fr.openfoodfacts.org/produit/3154230802280

And yet, in the Android application, the gallery opens the English tab by default instead of the French one. This is very confusing as this results in photos appearing to be missing when they are in fact present.
In contrast the Ingredients section shows the French ingredients list by default.
(Of course the product packaging being all French there should probably not be any data for the English in the first place but that's a separate issue.)

Smartphone model

  • Device: Galaxy S7
  • OS: Android 8
  • App Version: 4.16.9
@monsieurtanuki
Copy link
Contributor

Hi @fgouget!

The product below has two languages, "French" and "English" where "French" is the main language according to the website:
https://fr.openfoodfacts.org/produit/3154230802280

In your link I cannot see where it says that French is the main language. Where is it displayed? Could be that you're in the French version of the website; what about https://uk.openfoodfacts.org/product/3154230802280/smoked-bacon-pieces-without-nitrites-herta?

And yet, in the Android application, the gallery opens the English tab by default instead of the French one.

I couldn't reproduce this: on my app in French (latest dev version) the gallery does open on the French tab first.
Could it be that your app is in English?
Could you try with the latest app version? (4.17.0 or 4.17.1)

@monsieurtanuki
Copy link
Contributor

Maybe linked to #6050.

@fgouget
Copy link
Author

fgouget commented Dec 16, 2024

Hi @fgouget!

The product below has two languages, "French" and "English" where "French" is the main language according to the website:
https://fr.openfoodfacts.org/produit/3154230802280

In your link I cannot see where it says that French is the main language. Where is it displayed?

It is displayed in the usual place. Switch to edit mode, the main language is shown near the top of the page:
Image

Could be that you're in the French version of the website; what about https://uk.openfoodfacts.org/product/3154230802280/smoked-bacon-pieces-without-nitrites-herta?

The website systematically revert me to the English version but that clearly has no impact on that the main language is (see above screenshot).

And yet, in the Android application, the gallery opens the English tab by default instead of the French one.

I couldn't reproduce this: on my app in French (latest dev version) the gallery does open on the French tab first. Could it be that your app is in English?

No. The app is clearly in French, see:
Image

Could you try with the latest app version? (4.17.0 or 4.17.1)

I cannot. Version 4.16.9 is the latest version available from either the Play Store or F-Droid.

Maybe linked to #6050.

It is related to language handling too but it is still quite different. Unlike issue 6050:

  • It is neither an issue with the Main Language being wrong,
  • Nor is it an issue with being unable to change the Main Language from the Android App.

@fgouget
Copy link
Author

fgouget commented Dec 16, 2024

So this was wrong 30 minutes ago but now Français is the first tab as expected. I wonder if it's just opening the first language in some hashtable or something. And yes, this is still 4.16.9.

@monsieurtanuki
Copy link
Contributor

From what I read in the code of _ImageGalleryLanguagesProvider:

  • the product main language is first
  • then the app language
  • then the product languages for FRONT, INGREDIENTS, NUTRITION and PACKAGING images, ordered by 2-letter codes

As explained here, we do change the product main language each time we change product details.
Therefore if you changed a detail for this product with the app in French, the main language was automatically set to French. Then, the first tab was French.

cf. #4771

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

No branches or pull requests

3 participants