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

fix: 3042 - saving explicitly product name in the correct language #3862

Merged
merged 3 commits into from
Apr 20, 2023

Conversation

monsieurtanuki
Copy link
Contributor

What

  • Now the lang field of product is set explicitly for each server update.
  • As a result, when we set productName, we set it just for that language. The other translations are not impacted.
  • That should also impact ingredients, but I haven't double-checked yet.

Fixes bug(s)

Impacted files:
* `add_basic_details_page.dart`: now setting the product name "in language"
* `background_task_details.dart`: added the `lang` to the "save product to server" calls; minor refactoring
Impacted file:
* `background_task_details.dart`: added the `lang` to the "save product to server" calls; minor refactoring
@codecov-commenter
Copy link

codecov-commenter commented Apr 9, 2023

Codecov Report

Merging #3862 (185489c) into develop (8187e40) will decrease coverage by 0.01%.
The diff coverage is 0.00%.

@@             Coverage Diff             @@
##           develop    #3862      +/-   ##
===========================================
- Coverage    10.73%   10.73%   -0.01%     
===========================================
  Files          273      273              
  Lines        13478    13479       +1     
===========================================
  Hits          1447     1447              
- Misses       12031    12032       +1     
Impacted Files Coverage Δ
...th_app/lib/background/background_task_details.dart 0.00% <0.00%> (ø)

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

Copy link
Member

@teolemon teolemon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It should also impact packaging text.

@monsieurtanuki
Copy link
Contributor Author

It should also impact packaging text.

Probably. Something like "whatever text I'm writing is in this language" (at the product level), in addition to the language and country we already define (at the query level).

@monsieurtanuki
Copy link
Contributor Author

But I'm not sure we use packaging text that much any more. We rather use the "new" packaging items, don't we?

@teolemon teolemon added multilingual products ✏️ Editing Many products are incomplete and don't have Nutri-Score, Eco-Score…so editing is important for users labels Apr 10, 2023
@teolemon
Copy link
Member

Yes @monsieurtanuki . We however have to ensure image upload selection/deselect/crop is present in the new system (which it isn't)

Copy link
Member

@M123-dev M123-dev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Codewise it looks good to me, though I don't know which side effects could happen when having a just partly multilingual app

@monsieurtanuki monsieurtanuki merged commit fe68ea5 into openfoodfacts:develop Apr 20, 2023
@monsieurtanuki
Copy link
Contributor Author

Codewise it looks good to me, though I don't know which side effects could happen when having a just partly multilingual app

Thank you @M123-dev for your review!
I don't know either if there will be side-effects, but it sounds fair to explicitly set the language anyway.
Here it's about monolingual texts; there will soon be changes regarding multilingual texts.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
✏️ Editing Many products are incomplete and don't have Nutri-Score, Eco-Score…so editing is important for users multilingual products
Development

Successfully merging this pull request may close these issues.

On a French device, with French and France as settings, product_name is saved as product_name_en
4 participants