-
-
Notifications
You must be signed in to change notification settings - Fork 314
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: Language filter #2539
feat: Language filter #2539
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for making that big effort to map the data to the language translations (+1 points for not using any librabry) and research about the supported languages for flutter.
Had some comments , If u could have a look.
packages/smooth_app/lib/pages/preferences/user_preferences_languages_list.dart
Outdated
Show resolved
Hide resolved
packages/smooth_app/lib/pages/preferences/user_preferences_languages_list.dart
Outdated
Show resolved
Hide resolved
packages/smooth_app/lib/pages/preferences/user_preferences_languages_list.dart
Outdated
Show resolved
Hide resolved
packages/smooth_app/lib/pages/preferences/user_preferences_dev_mode.dart
Outdated
Show resolved
Hide resolved
packages/smooth_app/lib/pages/preferences/user_preferences_dev_mode.dart
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @abughalib!
I'm sure the code can be improved; please have a look at my comments.
packages/smooth_app/lib/pages/preferences/user_preferences_languages_list.dart
Outdated
Show resolved
Hide resolved
packages/smooth_app/lib/pages/preferences/user_preferences_dev_mode.dart
Outdated
Show resolved
Hide resolved
packages/smooth_app/lib/pages/preferences/user_preferences_languages_list.dart
Outdated
Show resolved
Hide resolved
packages/smooth_app/lib/pages/preferences/user_preferences_languages_list.dart
Outdated
Show resolved
Hide resolved
packages/smooth_app/lib/pages/preferences/user_preferences_languages_list.dart
Outdated
Show resolved
Hide resolved
We have the theoretical possibility of using : https://static.openfoodfacts.org/data/taxonomies/languages.json |
Codecov Report
@@ Coverage Diff @@
## develop #2539 +/- ##
==========================================
- Coverage 8.86% 7.45% -1.42%
==========================================
Files 161 214 +53
Lines 6623 10251 +3628
==========================================
+ Hits 587 764 +177
- Misses 6036 9487 +3451
|
screen-20220711-183438.mp4 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's much better @abughalib, thank you for your strong rewriting!
I still have several comments, please have a look at them.
In particular, I don't see the point of using your new Pair
class: what you need is either a list of 2-character lang codes or even better a list of OpenFoodFactsLanguage
s. From it you can retrieve everything (name in English, name in language, 2-character code).
packages/smooth_app/lib/pages/preferences/user_preferences_languages_list.dart
Outdated
Show resolved
Hide resolved
packages/smooth_app/lib/generic_lib/widgets/language_selector.dart
Outdated
Show resolved
Hide resolved
packages/smooth_app/lib/pages/preferences/user_preferences_languages_list.dart
Outdated
Show resolved
Hide resolved
packages/smooth_app/lib/pages/preferences/user_preferences_languages_list.dart
Outdated
Show resolved
Hide resolved
packages/smooth_app/lib/pages/preferences/user_preferences_languages_list.dart
Outdated
Show resolved
Hide resolved
packages/smooth_app/lib/pages/preferences/user_preferences_languages_list.dart
Outdated
Show resolved
Hide resolved
packages/smooth_app/lib/pages/preferences/user_preferences_languages_list.dart
Outdated
Show resolved
Hide resolved
packages/smooth_app/lib/generic_lib/widgets/language_selector.dart
Outdated
Show resolved
Hide resolved
packages/smooth_app/lib/generic_lib/widgets/language_selector.dart
Outdated
Show resolved
Hide resolved
packages/smooth_app/lib/generic_lib/widgets/language_selector.dart
Outdated
Show resolved
Hide resolved
packages/smooth_app/lib/pages/preferences/user_preferences_languages_list.dart
Outdated
Show resolved
Hide resolved
packages/smooth_app/lib/pages/preferences/user_preferences_languages_list.dart
Outdated
Show resolved
Hide resolved
packages/smooth_app/lib/pages/preferences/user_preferences_languages_list.dart
Outdated
Show resolved
Hide resolved
packages/smooth_app/lib/generic_lib/widgets/language_selector.dart
Outdated
Show resolved
Hide resolved
…into language_filter
…-app into language_filter
screen-20220720-210816.mp4The search method now supports Name in English and language code in English. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you @abughalib!
This is not the way I would have coded it but I must say that there were massive improvements compared to the early version and I assume that the code works.
We'll see later (in a future issue/PR) if changes are needed. Regarding performance or possible typos about the name in English.
[I haven't seen your latest changes]
@monsieurtanuki |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should be good to go for now, we can optimize it later if needed
@AshAman999 merging this one for now, and yes, we can then open a PR to make language selection for all (might require some other behavior changes, for data refresh) |
Anyways, Congratulations on your 1st PR here ㊗️ |
💯 |
And sorry that it took so long @abughalib |
@M123-dev |
What
Screenshot
screen-20220707-233805.mp4
Part of
#2482