-
-
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: 3897 - ingredients and packaging with multilingual OCR image+text #3911
feat: 3897 - ingredients and packaging with multilingual OCR image+text #3911
Conversation
New file: * `multilingual_helper.dart`: Helper for multilingual inputs (e.g. product name). Deleted file: * `ocr_widget.dart`: moved code to `edit_ingredients_page.dart`, for better state refresh Impacted files: * `add_basic_details_page.dart`: refactored with new class `MultilingualHelper` * `edit_ingredients_page.dart`: added multilingual management; moved code from `ocr_widget.dart` * `ocr_helper.dart`: refactored with multilingual management * `ocr_ingredients_helper.dart`: refactored with multilingual management * `ocr_packaging_helper.dart`: refactored with multilingual management * `product_query.dart`: added multilingual ingredients field; removed duplicate field
Codecov Report
@@ Coverage Diff @@
## develop #3911 +/- ##
===========================================
- Coverage 10.66% 10.64% -0.02%
===========================================
Files 271 271
Lines 13455 13478 +23
===========================================
Hits 1435 1435
- Misses 12020 12043 +23
📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
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.
Here's a product with several languages: https://world.openfoodfacts.org/api/v0/product/5400141625714.json
Hi @teolemon, and thank you for your comment and example. As far as I'm concerned, the PR seems to work too for multilingual packaging. But:
https://fr.openfoodfacts.org/api/v3/product/5400141625714?lc=fr&fields=packaging_text_languages {
"code": "5400141625714",
"errors": [],
"product": {
"packaging_text_languages": {
"aa": "test afar",
"fr": "test fr tanuki",
"nl": "test nl tanuki"
}
},
"result": {
"id": "product_found",
"lc_name": "Produit trouvé",
"name": "Product found"
},
"status": "success",
"warnings": []
} |
Thank you @teolemon for your approval: that's another step towards a fully multilingual app. |
What
7300400481588
or3760091722508
)'packaging_text_languages'
) on the server - at least I couldn't find an example.'ingredients_text_languages'
): if you don't see the language selector in the ingredients OCR page, please refresh the product first.Screenshots
App in French, on the ingredient OCR page, by default with the French settings:
Same app in French, on the ingredient OCR page, after setting the page language to Italian:
Part of
Files
New file:
multilingual_helper.dart
: Helper for multilingual inputs (e.g. product name).Deleted file:
ocr_widget.dart
: moved code toedit_ingredients_page.dart
, for better state refreshImpacted files:
add_basic_details_page.dart
: refactored with new classMultilingualHelper
edit_ingredients_page.dart
: added multilingual management; moved code fromocr_widget.dart
ocr_helper.dart
: refactored with multilingual managementocr_ingredients_helper.dart
: refactored with multilingual managementocr_packaging_helper.dart
: refactored with multilingual managementproduct_query.dart
: added multilingual ingredients field; removed duplicate field