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

feat: 3863 - multilingual input for product name #3890

Merged
merged 5 commits into from
Apr 21, 2023

Conversation

monsieurtanuki
Copy link
Contributor

Impacted files:

  • language_selector.dart: moved code to new static method openLanguageSelector
  • user_preferences_languages_list.dart: minor refactoring
  • user_preferences_settings.dart: minor refactoring

What

  • Preliminary work regarding multilingual features: we needed a reusable language selector method.

Part of

Impacted files:
* `language_selector.dart`: moved code to new static method `openLanguageSelector`
* `user_preferences_languages_list.dart`: minor refactoring
* `user_preferences_settings.dart`: minor refactoring
@monsieurtanuki monsieurtanuki marked this pull request as draft April 21, 2023 09:10
@codecov-commenter
Copy link

codecov-commenter commented Apr 21, 2023

Codecov Report

Merging #3890 (a437ba7) into develop (26b456e) will decrease coverage by 0.04%.
The diff coverage is 0.66%.

@@             Coverage Diff             @@
##           develop    #3890      +/-   ##
===========================================
- Coverage    10.59%   10.55%   -0.04%     
===========================================
  Files          270      270              
  Lines        13366    13424      +58     
===========================================
+ Hits          1416     1417       +1     
- Misses       11950    12007      +57     
Impacted Files Coverage Δ
...smooth_app/lib/data_models/up_to_date_changes.dart 0.00% <0.00%> (ø)
...app/lib/generic_lib/widgets/language_selector.dart 0.00% <0.00%> (ø)
...b/pages/preferences/user_preferences_settings.dart 6.57% <0.00%> (-0.07%) ⬇️
..._app/lib/pages/product/add_basic_details_page.dart 0.00% <0.00%> (ø)
packages/smooth_app/lib/query/product_query.dart 8.10% <ø> (ø)
...s/preferences/user_preferences_languages_list.dart 5.88% <6.66%> (+5.88%) ⬆️

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

Impacted files:
* `language_selector.dart`: added the concept of "pre selected languages" and their different displays
* `product_query.dart`: added a `TODO`
* `user_preferences_settings.dart`: minor refactoring
Impacted files:
* `add_basic_details_page.dart`: introduced the multilingual input
* `language_selector.dart`: added an optional "displayed language" parameter, useful for `AddBasicDetailsPage`
* `product_query.dart`: now we download the `NAME_ALL_LANGUAGES` product field too
* `up_to_date_changes.dart`: now we manage the `productNameInLanguages` product field too
@monsieurtanuki monsieurtanuki changed the title feat: 3863 - language selector refactoring feat: 3863 - multilingual input for product name Apr 21, 2023
@monsieurtanuki monsieurtanuki marked this pull request as ready for review April 21, 2023 14:10
Impacted file:
* `add_basic_details_page.dart`
@monsieurtanuki
Copy link
Contributor Author

@teolemon The UX is very smooth for multilingual product names.

Used to be:
Screenshot_2023-04-21-15-02-32

Now is

French translation language selector Dutch translation
Screenshot_2023-04-21-15-03-21 Screenshot_2023-04-21-15-03-25 Screenshot_2023-04-21-15-03-29

There's still a bit confusion on "how to get rid of a translation": sometimes if you put an empty String it removes the translation for that language, sometimes it sets it to ...erm... an empty String.

Some multilingual products to play with:

  • 8027498025058
  • 3760091722508
  • 7300400481588

@monsieurtanuki monsieurtanuki merged commit 011336f into openfoodfacts:develop Apr 21, 2023
6 checks passed
@monsieurtanuki
Copy link
Contributor Author

Thank you @teolemon for your approval!
Now we have a basis for multilingual inputs.

@teolemon
Copy link
Member

@monsieurtanuki testing in the internal, I realize that products with one language don't have the option to add more languages

@monsieurtanuki
Copy link
Contributor Author

@monsieurtanuki testing in the internal, I realize that products with one language don't have the option to add more languages

@teolemon What you mean is that "old" products don't have the option to add more languages.
Refreshed products with one language do have the option to add languages.
Functionally, technically and visually, I'm not sure how to handle both monolingual and multilingual cases on the same page.
Little by little, the products will get refreshed and therefore will get the extra multilingual field. Which will solve the issue, eventually.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Make it possible to view the product name in several languages
3 participants