From f1baab74e3a5025ccd8b52516eb0b247b4a189da Mon Sep 17 00:00:00 2001 From: M123-dev Date: Wed, 22 Dec 2021 17:07:12 +0100 Subject: [PATCH 1/7] Delete organization_page.dart --- .../smooth_app/lib/pages/organization_page.dart | 16 ---------------- 1 file changed, 16 deletions(-) delete mode 100644 packages/smooth_app/lib/pages/organization_page.dart diff --git a/packages/smooth_app/lib/pages/organization_page.dart b/packages/smooth_app/lib/pages/organization_page.dart deleted file mode 100644 index 8e5d5da8ada..00000000000 --- a/packages/smooth_app/lib/pages/organization_page.dart +++ /dev/null @@ -1,16 +0,0 @@ -// Flutter imports: -import 'package:flutter/material.dart'; - -// Package imports: -import 'package:flutter_gen/gen_l10n/app_localizations.dart'; - -class OrganizationPage extends StatelessWidget { - @override - Widget build(BuildContext context) { - return Scaffold( - body: Center( - child: Text(AppLocalizations.of(context)!.organizationPage), - ), - ); - } -} From 3d2cd5b9674b05f7163a0c92c33ee82a78d67627 Mon Sep 17 00:00:00 2001 From: M123-dev Date: Wed, 22 Dec 2021 17:07:37 +0100 Subject: [PATCH 2/7] Removed unnecessary translations --- packages/smooth_app/lib/l10n/app_en.arb | 538 +++++++++--------------- 1 file changed, 195 insertions(+), 343 deletions(-) diff --git a/packages/smooth_app/lib/l10n/app_en.arb b/packages/smooth_app/lib/l10n/app_en.arb index 2b0f2b23fc1..14c2af459c3 100644 --- a/packages/smooth_app/lib/l10n/app_en.arb +++ b/packages/smooth_app/lib/l10n/app_en.arb @@ -1,346 +1,198 @@ { - "searchTitle": "Search.\nFind the perfect product", - "@searchTitle": { - "description": "Temporary title for the app main page" - }, - "search": "Search", - "@search": {}, - "welcomeToOpenFoodFacts": "Welcome to Open Food Facts", - "@welcomeToOpenFoodFacts": {}, - "searchPanelHeader": "Search or scan your first product", - "@searchPanelHeader": {}, - "searchHintText": "Enter a barcode or keywords", - "@searchHintText": {}, - "categories": "Categories", - "@categories": {}, - "category": "Category", - "@category": {}, - "showAll": "Show all", - "@showAll": {}, - "scanProductTitle": "Scan products", - "@scanProductTitle": {}, - "organizationPage": "Organization Page", - "@organizationPage": {}, - "contributors": "Contributors", - "@contributors": {}, - "contributionPage": "Contribution Page", - "@contributionPage": {}, - "trackingPage": "Tracking Page", - "@trackingPage": {}, - "preferencesText": "My Preferences", - "@preferencesText": {}, - "saveButtonText": "Save", - "@saveButtonText": {}, - "applyButtonText": "Apply", - "@applyButtonText": {}, - "myPersonalizedRanking": "My personalized ranking", - "@myPersonalizedRanking": { - "description": "When you press this button, all products (in list or category) are sorted according to your preferences." - }, - "scannerProductsEmpty": "Products you scan will appear here", - "@scannerProductsEmpty": {}, - "myPreferences": "My preferences", - "@myPreferences": {}, - "featureInProgress": "We're still working on this feature, stay tuned", - "@featureInProgress": {}, - "configurePreferences": "Configure my preferences", - "@configurePreferences": {}, - "confirmResetPreferences": "Reset your preferences?", - "@confirmResetPreferences": {}, - "yes": "Yes", - "@yes": {}, - "no": "No", - "@no": {}, - "okay": "Okay", - "@okay": {}, - "undo": "UNDO", - "@undo": {}, - "cancel": "Cancel", - "@cancel": {}, - "stop": "Stop", - "@stop": {}, - "close": "Close", - "@close": {}, - "empty": "Empty!", - "@empty": { - "description": "Example: A preview of your search history, if you haven't searched for anything yet, it will show 'Empty!" - }, - "unknownBrand": "Unknown brand", - "@unknownBrand": {}, - "unknownProductName": "Unknown product name", - "@unknownProductName": {}, - "nutrition": "Nutrition", - "@nutrition": {}, - "ingredients": "Ingredients", - "@ingredients": {}, - "ecology": "Ecology", - "@ecology": {}, - "about": "About this app", - "@about": {}, - "licenses": "Licences", - "@licenses": {}, - "whatIsOff": "Open Food Facts is a database of food products, made by everyone, for everyone. You can use it to make better food choices, and as it is open data, anyone can re-use it for any purpose.", - "@whatIsOff": {}, - "learnMore": "Learn more", - "@learnMore": {}, - "termsOfUse": "Terms of use", - "@termsOfUse": {}, - "contribute": "Contribute", - "@contribute": {}, - "contribute_improve_header": "Improving", - "@contribute_improve_header": {}, - "contribute_improve_text": "The database is the core of the project. It's easy and very quick to help. You can download the mobile app for your phone, and start adding or improving products.\n\nOn the other hand, Open Food Facts website offers many ways to contribute: ", - "@contribute_improve_text": {}, - "contribute_improve_ProductsToBeCompleted": "Products to be completed", - "@contribute_improve_ProductsToBeCompleted": {}, - "contribute_develop": "Develop", - "@contribute_develop": {}, - "contribute_develop_text": "The code for every Open Food Facts product is available on GitHub. You are welcome to reuse the code (it's open source) and help us improve it, for everyone, on all the planet.", - "@contribute_develop_text": {}, - "contribute_develop_text_2": "You can join the Open Food Facts Slack chatroom which is the preferred way to ask questions.", - "@contribute_develop_text_2": {}, - "contribute_translate_header": "Translate", - "@contribute_translate_header": {}, - "contribute_translate_text": "Open Food Facts is a global project, containing products from more than 160 countries. Open Food Facts is translated into dozens of languages, with constantly evolving content.", - "@contribute_translate_text": {}, - "contribute_translate_text_2": "Translations is one of the key tasks of the project", - "@contribute_translate_text_2": {}, - "contribute_translate_link_text": "Start Translating", - "@contribute_translate_link_text": {}, - "contribute_donate_header": "Donate to Open Food Facts", - "@contribute_donate_header": {}, - "support": "Support", - "@support": {}, - "error": "Something went wrong", - "@error": {}, - "darkmode": "Darkmode", - "@darkmode": {}, - "settingsTitle": "Settings", - "@settingsTitle": {}, - "reset": "Reset", - "@reset": {}, - "filter": "Filter", - "@filter": { - "description": "A button that opens a menu where you can filter within categories. Juices => Apple juices/Orange juices" - }, - "added_product_thanks": "Thank you for adding this product!", - "@added_product_thanks": {}, - "missing_product": "This product is missing", - "@missing_product": {}, - "add": "Add", - "@add": {}, - "nutri_score_unavailable": "Nutri-Score unavailable", - "@nutri_score_unavailable": {}, - "missing_picture": "Missing picture", - "@missing_picture": {}, - "searching": "Searching…", - "@searching": {}, - "empty_list": "Empty list", - "@empty_list": {}, - "nothing_set": "Nothing set for the moment", - "rename": "Rename", - "@rename": {}, - "delete": "Delete", - "@delete": {}, - "change_icon": "Change icon", - "@change_icon": {}, - "paste": "paste", - "@paste": {}, - "copy": "copy", - "@copy": {}, - "clear": "clear", - "@clear": {}, - "grocery": "grocery", - "@grocery": {}, - "add_date": "Add another date", - "@add_date": {}, - "no_date": "No date", - "@no_date": {}, - "already_in_pantry": "Already in the pantry!", - "@already_in_pantry": {}, - "added_to_pantry": "Added to the pantry!", - "@added_to_pantry": {}, - "want_to_delete_pantry": "Do you want to delete this pantry?", - "@want_to_delete_pantry": {}, - "want_to_delete_shopping": "Do you want to delete this shopping list?", - "@want_to_delete_shopping": {}, - "want_to_delete_list": "Do you want to delete this product list?", - "@want_to_delete_list": {}, - "new_pantry": "New pantry", - "@new_pantry": {}, - "new_shopping": "New shopping list", - "@new_shopping": {}, - "new_list": "New list", - "@new_list": {}, - "rename_pantry": "Rename pantry", - "@rename_pantry": {}, - "rename_shopping": "Rename shopping list", - "@rename_shopping": {}, - "rename_list": "Rename list", - "@rename_list": {}, - "my_pantry_hint": "My own pantry", - "@my_pantry_hint": {}, - "my_shopping_hint": "My shopping list", - "@my_shopping_hint": {}, - "my_list_hint": "My custom list", - "@my_list_hint": {}, - "enter_text": "Please enter some text", - "@enter_text": {}, - "pantry_name_taken": "There's already a pantry with that name", - "@pantry_name_taken": {}, - "shopping_name_taken": "There's already a shopping list with that name", - "@shopping_name_taken": {}, - "list_name_taken": "There's already a list with that name", - "@list_name_taken": {}, - "already_same": "That's the same name!", - "@already_same": {}, - "my_pantrie_lists": "My pantries", - "my_shopping_lists": "My shopping lists", - "my_lists": "My lists", - "food_categories": "Food categories", - "search_history": "Search history", - "label_preferences": "preferences", - "@label_preferences": {}, - "label_lists": "lists", - "@label_lists": {}, - "label_web": "View on the Web", - "@label_web": {}, - "label_refresh": "refresh", - "@label_refresh": { - "description": "Refresh the cached product" - }, - "label_share": "share", - "@label_share": {}, - "product_refreshed": "Product refreshed", - "@product_refreshed": {}, - "food_ranking_parameters": "Food ranking parameters", - "product": "Product", - "@product": {}, - "packaging_information": "Packaging information", - "@packaging_information": {}, - "more_photos": "More interesting photos", - "@more_photos": {}, - "front_photo": "Front photo", - "@front_photo": {}, - "ingredients_photo": "Ingredients photo", - "@ingredients_photo": {}, - "nutrition_facts_photo": "Nutrition facts photo", - "@nutrition_facts_photo": {}, - "packaging_information_photo": "Packaging information photo", - "@packaging_information_photo": {}, - "add_product": "Add a new product", - "@add_product": {}, - "similar_food": "Similar foods", - "@similar_foods": {}, - "refreshing_product": "Refreshing product", - "@refreshing_product": {}, - "looking_for": "Looking for", - "@looking_for": {}, - "could_not_refresh": "Could not refresh product", - "@could_not_refresh": {}, - "no_product_found": "No product found", - "@no_product_found": {}, - "product_internet_error": "Impossible to fetch information about this product due to a network error.", - "product_internet_cancel": "Canceled by user.", - "product_improvement_origins_to_be_completed": "The Eco-Score takes into account the origins of the ingredients. Please take them into a photo (ingredient list and/or any geographic claim or edit the product so that they can be taken into account. If it is not clear, you can contact the food producer.", - "@product_improvement_origins_to_be_completed": { - "description": "Message for ProductImprovement.ORIGINS_TO_BE_COMPLETED" - }, - "product_improvement_categories_but_no_nutriscore": "We could not compute an Nutri-Score for this product. It might be that the category is an exception. If you believe this is an error, contact us.", - "@product_improvement_categories_but_no_nutriscore": { - "description": "Message for ProductImprovement.CATEGORIES_BUT_NO_NUTRISCORE" - }, - "product_improvement_add_nutrition_facts": "Add nutrition facts to compute the Nutri-Score.", - "@product_improvement_add_nutrition_facts": { - "description": "Message for ProductImprovement.ADD_NUTRITION_FACTS" - }, - "product_improvement_add_category": "Add a category to compute the Nutri-Score.", - "@product_improvement_add_category": { - "description": "Message for ProductImprovement.ADD_CATEGORY" - }, - "product_improvement_add_nutrition_facts_and_category": "Add nutrition facts and a category to compute the Nutri-Score.", - "@product_improvement_add_nutrition_facts_and_category": { - "description": "Message for ProductImprovement.ADD_NUTRITION_FACTS_AND_CATEGORY" - }, - "product_improvement_obsolete_nutrition_image": "The nutrition image is obsolete: please refresh it.", - "@product_improvement_obsolete_nutrition_image": { - "description": "Message for ProductImprovement.OBSOLETE_NUTRITION_IMAGE" - }, - "product_improvements_count": "{count,plural, =1{One possible improvement} other{{count} possible improvements}}", - "@product_improvements_count": { - "description": "x possible improvements", - "placeholders": { - "count": {} - } - }, - "products_pasted": "products pasted", - "@products_pasted": {}, - "no_prodcut_in_list": "There is no product in this list", - "@no_product_in_list": {}, - "error_occurred": "An error occurred", - "@error_occurred": {}, - "keyword_search": "(keyword search)", - "category_search": "(category search)", - "my_list": "(my list)", - "scan": "Scan", - "recently_seen_products": "My recently seen products", - "unknown_product_list": "Unknown product list:", - "not_found": "not found:", - "no_product": "no product", - "one_product": "1 product", - "x_products": "products", - "scan_contribute": "CONTRIBUTE", - "@scan_contribute": { - "description": "Switch on top of the Scanner to choose between to scan or add products" - }, - "incompatible": "Incompatible", - "pct_match": "{pct}% match", - "@pct_match": { - "placeholders": { - "pct": {} - } - }, - "scan_choose": "CHOOSE", - "@scan_choose": { - "description": "Switch on top of the Scanner to choose between to scan or add products" - }, - "reloaded_with_new_preferences": "Reloaded with new preferences", - "no_product_in_section": "There is no product in this section", - "what_are_you_looking_for": "What are you looking for?", - "chached_results_from": "Cached results from:", - "plural_ago_minutes": "{count,plural, =0{less than a minute ago} =1{one minute ago} other{{count} minutes ago}}", - "@plural_ago_minutes": { - "description": "Cached results from: x minutes ago", - "placeholders": { - "count": {} - } - }, - "plural_ago_hours": "{count,plural, =1{one hour ago} other{{count} hours ago}}", - "@plural_ago_hours": { - "description": "Cached results from: x hours ago", - "placeholders": { - "count": {} - } - }, - "plural_ago_days": "{count,plural, =1{one day ago} other{{count} days ago}}", - "@plural_ago_days": { - "description": "Cached results from: x days ago", - "placeholders": { - "count": {} - } - }, - "plural_ago_weeks": "{count,plural, =1{one week ago} other{{count} weeks ago}}", - "@plural_ago_weeks": { - "description": "Cached results from: x weeks ago", - "placeholders": { - "count": {} - } - }, - "plural_ago_months": "{count,plural, =1{one month ago} other{{count} months ago}}", - "@plural_ago_months": { - "description": "Cached results from: x months ago", - "placeholders": { - "count": {} - } + "about": "About this app", + "@about": {}, + "added_product_thanks": "Thank you for adding this product!", + "@added_product_thanks": {}, + "applyButtonText": "Apply", + "@applyButtonText": {}, + "category_search": "(category search)", + "chached_results_from": "Cached results from:", + "confirmResetPreferences": "Reset your preferences?", + "@confirmResetPreferences": {}, + "contribute": "Contribute", + "@contribute": {}, + "contribute_develop": "Develop", + "@contribute_develop": {}, + "contribute_develop_text": "The code for every Open Food Facts product is available on GitHub. You are welcome to reuse the code (it's open source) and help us improve it, for everyone, on all the planet.", + "@contribute_develop_text": {}, + "contribute_develop_text_2": "You can join the Open Food Facts Slack chatroom which is the preferred way to ask questions.", + "@contribute_develop_text_2": {}, + "contribute_donate_header": "Donate to Open Food Facts", + "@contribute_donate_header": {}, + "contribute_improve_ProductsToBeCompleted": "Products to be completed", + "@contribute_improve_ProductsToBeCompleted": {}, + "contribute_improve_header": "Improving", + "@contribute_improve_header": {}, + "contribute_improve_text": "The database is the core of the project. It's easy and very quick to help. You can download the mobile app for your phone, and start adding or improving products.\n\nOn the other hand, Open Food Facts website offers many ways to contribute: ", + "@contribute_improve_text": {}, + "contribute_translate_header": "Translate", + "@contribute_translate_header": {}, + "contribute_translate_link_text": "Start Translating", + "@contribute_translate_link_text": {}, + "contribute_translate_text": "Open Food Facts is a global project, containing products from more than 160 countries. Open Food Facts is translated into dozens of languages, with constantly evolving content.", + "@contribute_translate_text": {}, + "contribute_translate_text_2": "Translations is one of the key tasks of the project", + "@contribute_translate_text_2": {}, + "contributors": "Contributors", + "@contributors": {}, + "could_not_refresh": "Could not refresh product", + "@could_not_refresh": {}, + "darkmode": "Darkmode", + "@darkmode": {}, + "error": "Something went wrong", + "@error": {}, + "error_occurred": "An error occurred", + "@error_occurred": {}, + "featureInProgress": "We're still working on this feature, stay tuned", + "@featureInProgress": {}, + "filter": "Filter", + "@filter": { + "description": "A button that opens a menu where you can filter within categories. Juices => Apple juices/Orange juices" + }, + "front_photo": "Front photo", + "@front_photo": {}, + "incompatible": "Incompatible", + "ingredients": "Ingredients", + "@ingredients": {}, + "ingredients_photo": "Ingredients photo", + "@ingredients_photo": {}, + "label_refresh": "refresh", + "@label_refresh": { + "description": "Refresh the cached product" + }, + "label_web": "View on the Web", + "@label_web": {}, + "learnMore": "Learn more", + "@learnMore": {}, + "licenses": "Licences", + "@licenses": {}, + "looking_for": "Looking for", + "@looking_for": {}, + "missing_product": "This product is missing", + "@missing_product": {}, + "more_photos": "More interesting photos", + "@more_photos": {}, + "myPersonalizedRanking": "My personalized ranking", + "@myPersonalizedRanking": { + "description": "When you press this button, all products (in list or category) are sorted according to your preferences." + }, + "myPreferences": "My preferences", + "@myPreferences": {}, + "no": "No", + "@no": {}, + "no_prodcut_in_list": "There is no product in this list", + "no_product_found": "No product found", + "@no_product_found": {}, + "no_product_in_section": "There is no product in this section", + "not_found": "not found:", + "nutrition": "Nutrition", + "@nutrition": {}, + "nutrition_facts_photo": "Nutrition facts photo", + "@nutrition_facts_photo": {}, + "okay": "Okay", + "@okay": {}, + "packaging_information": "Packaging information", + "@packaging_information": {}, + "packaging_information_photo": "Packaging information photo", + "@packaging_information_photo": {}, + "pct_match": "{pct}% match", + "@pct_match": { + "placeholders": { + "pct": {} } + }, + "plural_ago_days": "{count,plural, =1{one day ago} other{{count} days ago}}", + "@plural_ago_days": { + "description": "Cached results from: x days ago", + "placeholders": { + "count": {} + } + }, + "plural_ago_hours": "{count,plural, =1{one hour ago} other{{count} hours ago}}", + "@plural_ago_hours": { + "description": "Cached results from: x hours ago", + "placeholders": { + "count": {} + } + }, + "plural_ago_minutes": "{count,plural, =0{less than a minute ago} =1{one minute ago} other{{count} minutes ago}}", + "@plural_ago_minutes": { + "description": "Cached results from: x minutes ago", + "placeholders": { + "count": {} + } + }, + "plural_ago_months": "{count,plural, =1{one month ago} other{{count} months ago}}", + "@plural_ago_months": { + "description": "Cached results from: x months ago", + "placeholders": { + "count": {} + } + }, + "plural_ago_weeks": "{count,plural, =1{one week ago} other{{count} weeks ago}}", + "@plural_ago_weeks": { + "description": "Cached results from: x weeks ago", + "placeholders": { + "count": {} + } + }, + "product": "Product", + "@product": {}, + "product_improvement_add_category": "Add a category to compute the Nutri-Score.", + "@product_improvement_add_category": { + "description": "Message for ProductImprovement.ADD_CATEGORY" + }, + "product_improvement_add_nutrition_facts": "Add nutrition facts to compute the Nutri-Score.", + "@product_improvement_add_nutrition_facts": { + "description": "Message for ProductImprovement.ADD_NUTRITION_FACTS" + }, + "product_improvement_add_nutrition_facts_and_category": "Add nutrition facts and a category to compute the Nutri-Score.", + "@product_improvement_add_nutrition_facts_and_category": { + "description": "Message for ProductImprovement.ADD_NUTRITION_FACTS_AND_CATEGORY" + }, + "product_improvement_categories_but_no_nutriscore": "We could not compute an Nutri-Score for this product. It might be that the category is an exception. If you believe this is an error, contact us.", + "@product_improvement_categories_but_no_nutriscore": { + "description": "Message for ProductImprovement.CATEGORIES_BUT_NO_NUTRISCORE" + }, + "product_improvement_obsolete_nutrition_image": "The nutrition image is obsolete: please refresh it.", + "@product_improvement_obsolete_nutrition_image": { + "description": "Message for ProductImprovement.OBSOLETE_NUTRITION_IMAGE" + }, + "product_improvement_origins_to_be_completed": "The Eco-Score takes into account the origins of the ingredients. Please take them into a photo (ingredient list and/or any geographic claim or edit the product so that they can be taken into account. If it is not clear, you can contact the food producer.", + "@product_improvement_origins_to_be_completed": { + "description": "Message for ProductImprovement.ORIGINS_TO_BE_COMPLETED" + }, + "product_internet_cancel": "Canceled by user.", + "product_internet_error": "Impossible to fetch information about this product due to a network error.", + "product_refreshed": "Product refreshed", + "@product_refreshed": {}, + "recently_seen_products": "My recently seen products", + "refreshing_product": "Refreshing product", + "@refreshing_product": {}, + "reloaded_with_new_preferences": "Reloaded with new preferences", + "reset": "Reset", + "@reset": {}, + "scan": "Scan", + "search": "Search", + "@search": {}, + "searchPanelHeader": "Search or scan your first product", + "@searchPanelHeader": {}, + "settingsTitle": "Settings", + "@settingsTitle": {}, + "stop": "Stop", + "@stop": {}, + "support": "Support", + "@support": {}, + "termsOfUse": "Terms of use", + "@termsOfUse": {}, + "unknownBrand": "Unknown brand", + "@unknownBrand": {}, + "unknownProductName": "Unknown product name", + "@unknownProductName": {}, + "welcomeToOpenFoodFacts": "Welcome to Open Food Facts", + "@welcomeToOpenFoodFacts": {}, + "whatIsOff": "Open Food Facts is a database of food products, made by everyone, for everyone. You can use it to make better food choices, and as it is open data, anyone can re-use it for any purpose.", + "@whatIsOff": {}, + "yes": "Yes", + "@yes": {} } \ No newline at end of file From 5a7754610487b409d60da711bca14e78fd1b1264 Mon Sep 17 00:00:00 2001 From: M123-dev Date: Wed, 22 Dec 2021 17:51:58 +0100 Subject: [PATCH 3/7] Update app_en.arb --- packages/smooth_app/lib/l10n/app_en.arb | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/packages/smooth_app/lib/l10n/app_en.arb b/packages/smooth_app/lib/l10n/app_en.arb index 14c2af459c3..759195d09cf 100644 --- a/packages/smooth_app/lib/l10n/app_en.arb +++ b/packages/smooth_app/lib/l10n/app_en.arb @@ -1,12 +1,20 @@ { "about": "About this app", "@about": {}, + "add": "Add", + "@add": {}, "added_product_thanks": "Thank you for adding this product!", "@added_product_thanks": {}, "applyButtonText": "Apply", "@applyButtonText": {}, + "cancel": "Cancel", + "@cancel": {}, + "category": "Category", + "@category": {}, "category_search": "(category search)", "chached_results_from": "Cached results from:", + "close": "Close", + "@close": {}, "confirmResetPreferences": "Reset your preferences?", "@confirmResetPreferences": {}, "contribute": "Contribute", From 89f8b297ac57d5e6be07a91b0ea87ef7b6db7384 Mon Sep 17 00:00:00 2001 From: M123-dev Date: Wed, 22 Dec 2021 18:18:01 +0100 Subject: [PATCH 4/7] Sorted and divided into sections --- packages/smooth_app/lib/l10n/app_en.arb | 286 +++++++++++------- .../product/common/product_query_page.dart | 2 +- .../smooth_app/lib/pages/settings_page.dart | 4 +- 3 files changed, 181 insertions(+), 111 deletions(-) diff --git a/packages/smooth_app/lib/l10n/app_en.arb b/packages/smooth_app/lib/l10n/app_en.arb index 759195d09cf..c737225ce52 100644 --- a/packages/smooth_app/lib/l10n/app_en.arb +++ b/packages/smooth_app/lib/l10n/app_en.arb @@ -1,22 +1,80 @@ { - "about": "About this app", - "@about": {}, + + "@Utils": {}, + "add": "Add", "@add": {}, - "added_product_thanks": "Thank you for adding this product!", - "@added_product_thanks": {}, + "okay": "Okay", + "@okay": {}, + "yes": "Yes", + "@yes": {}, + "applyButtonText": "Apply", "@applyButtonText": {}, + "cancel": "Cancel", "@cancel": {}, - "category": "Category", - "@category": {}, - "category_search": "(category search)", - "chached_results_from": "Cached results from:", "close": "Close", "@close": {}, - "confirmResetPreferences": "Reset your preferences?", - "@confirmResetPreferences": {}, + "no": "No", + "@no": {}, + "stop": "Stop", + "@stop": {}, + + "error": "Something went wrong", + "@error": {}, + "error_occurred": "An error occurred", + "@error_occurred": {}, + + "featureInProgress": "We're still working on this feature, stay tuned", + "@featureInProgress": {}, + + "reset": "Reset", + "@reset": {}, + + "label_web": "View on the Web", + "@label_web": {}, + "learnMore": "Learn more", + "@learnMore": {}, + "incompatible": "Incompatible", + "licenses": "Licences", + "@licenses": {}, + "looking_for": "Looking for", + "@looking_for": {}, + + + + + "@Introduction screen": {}, + + "welcomeToOpenFoodFacts": "Welcome to Open Food Facts", + "@welcomeToOpenFoodFacts": {}, + "whatIsOff": "Open Food Facts is a database of food products, made by everyone, for everyone. You can use it to make better food choices, and as it is open data, anyone can re-use it for any purpose.", + "@whatIsOff": {}, + + + + + "@Settings": {}, + + "settingsTitle": "Settings", + "@settingsTitle": {}, + "darkmode": "Darkmode", + "@darkmode": {}, + "contributors": "Contributors", + "@contributors": {}, + "support": "Support", + "@support": {}, + "termsOfUse": "Terms of use", + "@termsOfUse": {}, + "about_this_app": "About this app", + "@about_this_app": {}, + + + + + "@About this app section": {}, + "contribute": "Contribute", "@contribute": {}, "contribute_develop": "Develop", @@ -41,72 +99,142 @@ "@contribute_translate_text": {}, "contribute_translate_text_2": "Translations is one of the key tasks of the project", "@contribute_translate_text_2": {}, - "contributors": "Contributors", - "@contributors": {}, - "could_not_refresh": "Could not refresh product", - "@could_not_refresh": {}, - "darkmode": "Darkmode", - "@darkmode": {}, - "error": "Something went wrong", - "@error": {}, - "error_occurred": "An error occurred", - "@error_occurred": {}, - "featureInProgress": "We're still working on this feature, stay tuned", - "@featureInProgress": {}, + + + + + "@Personal preferences": {}, + + "myPreferences": "My preferences", + "@myPreferences": {}, + "confirmResetPreferences": "Reset your preferences?", + "@confirmResetPreferences": {}, + "myPersonalizedRanking": "My personalized ranking", + "@myPersonalizedRanking": { + "description": "When you press this button, all products (in list or category) are sorted according to your preferences." + }, + "reloaded_with_new_preferences": "Reloaded with new preferences", + + + + + "@other": {}, + + "category": "Category", + "@category": {}, + "category_search": "(category search)", "filter": "Filter", "@filter": { "description": "A button that opens a menu where you can filter within categories. Juices => Apple juices/Orange juices" }, + "scan": "Scan", + "search": "Search", + "@search": {}, + "searchPanelHeader": "Search or scan your first product", + "@searchPanelHeader": {}, + + + + + "@Product": {}, + + "could_not_refresh": "Could not refresh product", + "@could_not_refresh": {}, + "label_refresh": "refresh", + "@label_refresh": { + "description": "Refresh the cached product" + }, "front_photo": "Front photo", "@front_photo": {}, - "incompatible": "Incompatible", + "ingredients": "Ingredients", "@ingredients": {}, "ingredients_photo": "Ingredients photo", "@ingredients_photo": {}, - "label_refresh": "refresh", - "@label_refresh": { - "description": "Refresh the cached product" - }, - "label_web": "View on the Web", - "@label_web": {}, - "learnMore": "Learn more", - "@learnMore": {}, - "licenses": "Licences", - "@licenses": {}, - "looking_for": "Looking for", - "@looking_for": {}, "missing_product": "This product is missing", "@missing_product": {}, "more_photos": "More interesting photos", "@more_photos": {}, - "myPersonalizedRanking": "My personalized ranking", - "@myPersonalizedRanking": { - "description": "When you press this button, all products (in list or category) are sorted according to your preferences." - }, - "myPreferences": "My preferences", - "@myPreferences": {}, - "no": "No", - "@no": {}, - "no_prodcut_in_list": "There is no product in this list", "no_product_found": "No product found", "@no_product_found": {}, - "no_product_in_section": "There is no product in this section", "not_found": "not found:", "nutrition": "Nutrition", "@nutrition": {}, "nutrition_facts_photo": "Nutrition facts photo", "@nutrition_facts_photo": {}, - "okay": "Okay", - "@okay": {}, "packaging_information": "Packaging information", "@packaging_information": {}, "packaging_information_photo": "Packaging information photo", "@packaging_information_photo": {}, + "product": "Product", + "@product": {}, + "unknownBrand": "Unknown brand", + "@unknownBrand": {}, + "unknownProductName": "Unknown product name", + "@unknownProductName": {}, + + + + "@Product query status": {}, + + "refreshing_product": "Refreshing product", + "@refreshing_product": {}, + "product_refreshed": "Product refreshed", + "@product_refreshed": {}, + "product_internet_cancel": "Canceled by user.", + "product_internet_error": "Impossible to fetch information about this product due to a network error.", + "cached_results_from": "Cached results from:", + + + + + "@Product Addition": {}, + + "added_product_thanks": "Thank you for adding this product!", + "@added_product_thanks": {}, + "product_improvement_add_category": "Add a category to compute the Nutri-Score.", + "@product_improvement_add_category": { + "description": "Message for ProductImprovement.ADD_CATEGORY" + }, + "product_improvement_add_nutrition_facts": "Add nutrition facts to compute the Nutri-Score.", + "@product_improvement_add_nutrition_facts": { + "description": "Message for ProductImprovement.ADD_NUTRITION_FACTS" + }, + "product_improvement_add_nutrition_facts_and_category": "Add nutrition facts and a category to compute the Nutri-Score.", + "@product_improvement_add_nutrition_facts_and_category": { + "description": "Message for ProductImprovement.ADD_NUTRITION_FACTS_AND_CATEGORY" + }, + "product_improvement_categories_but_no_nutriscore": "We could not compute an Nutri-Score for this product. It might be that the category is an exception. If you believe this is an error, contact us.", + "@product_improvement_categories_but_no_nutriscore": { + "description": "Message for ProductImprovement.CATEGORIES_BUT_NO_NUTRISCORE" + }, + "product_improvement_obsolete_nutrition_image": "The nutrition image is obsolete: please refresh it.", + "@product_improvement_obsolete_nutrition_image": { + "description": "Message for ProductImprovement.OBSOLETE_NUTRITION_IMAGE" + }, + "product_improvement_origins_to_be_completed": "The Eco-Score takes into account the origins of the ingredients. Please take them into a photo (ingredient list and/or any geographic claim or edit the product so that they can be taken into account. If it is not clear, you can contact the food producer.", + "@product_improvement_origins_to_be_completed": { + "description": "Message for ProductImprovement.ORIGINS_TO_BE_COMPLETED" + }, + + + + + "@Lists": {}, + + "no_prodcut_in_list": "There is no product in this list", + "no_product_in_section": "There is no product in this section", + "recently_seen_products": "My recently seen products", + + + + + "@Plural": {}, + "pct_match": "{pct}% match", "@pct_match": { "placeholders": { - "pct": {} + "pct": {} } }, "plural_ago_days": "{count,plural, =1{one day ago} other{{count} days ago}}", @@ -143,64 +271,6 @@ "placeholders": { "count": {} } - }, - "product": "Product", - "@product": {}, - "product_improvement_add_category": "Add a category to compute the Nutri-Score.", - "@product_improvement_add_category": { - "description": "Message for ProductImprovement.ADD_CATEGORY" - }, - "product_improvement_add_nutrition_facts": "Add nutrition facts to compute the Nutri-Score.", - "@product_improvement_add_nutrition_facts": { - "description": "Message for ProductImprovement.ADD_NUTRITION_FACTS" - }, - "product_improvement_add_nutrition_facts_and_category": "Add nutrition facts and a category to compute the Nutri-Score.", - "@product_improvement_add_nutrition_facts_and_category": { - "description": "Message for ProductImprovement.ADD_NUTRITION_FACTS_AND_CATEGORY" - }, - "product_improvement_categories_but_no_nutriscore": "We could not compute an Nutri-Score for this product. It might be that the category is an exception. If you believe this is an error, contact us.", - "@product_improvement_categories_but_no_nutriscore": { - "description": "Message for ProductImprovement.CATEGORIES_BUT_NO_NUTRISCORE" - }, - "product_improvement_obsolete_nutrition_image": "The nutrition image is obsolete: please refresh it.", - "@product_improvement_obsolete_nutrition_image": { - "description": "Message for ProductImprovement.OBSOLETE_NUTRITION_IMAGE" - }, - "product_improvement_origins_to_be_completed": "The Eco-Score takes into account the origins of the ingredients. Please take them into a photo (ingredient list and/or any geographic claim or edit the product so that they can be taken into account. If it is not clear, you can contact the food producer.", - "@product_improvement_origins_to_be_completed": { - "description": "Message for ProductImprovement.ORIGINS_TO_BE_COMPLETED" - }, - "product_internet_cancel": "Canceled by user.", - "product_internet_error": "Impossible to fetch information about this product due to a network error.", - "product_refreshed": "Product refreshed", - "@product_refreshed": {}, - "recently_seen_products": "My recently seen products", - "refreshing_product": "Refreshing product", - "@refreshing_product": {}, - "reloaded_with_new_preferences": "Reloaded with new preferences", - "reset": "Reset", - "@reset": {}, - "scan": "Scan", - "search": "Search", - "@search": {}, - "searchPanelHeader": "Search or scan your first product", - "@searchPanelHeader": {}, - "settingsTitle": "Settings", - "@settingsTitle": {}, - "stop": "Stop", - "@stop": {}, - "support": "Support", - "@support": {}, - "termsOfUse": "Terms of use", - "@termsOfUse": {}, - "unknownBrand": "Unknown brand", - "@unknownBrand": {}, - "unknownProductName": "Unknown product name", - "@unknownProductName": {}, - "welcomeToOpenFoodFacts": "Welcome to Open Food Facts", - "@welcomeToOpenFoodFacts": {}, - "whatIsOff": "Open Food Facts is a database of food products, made by everyone, for everyone. You can use it to make better food choices, and as it is open data, anyone can re-use it for any purpose.", - "@whatIsOff": {}, - "yes": "Yes", - "@yes": {} + } + } \ No newline at end of file diff --git a/packages/smooth_app/lib/pages/product/common/product_query_page.dart b/packages/smooth_app/lib/pages/product/common/product_query_page.dart index 9752ce42b1f..d9ebbfb2c62 100644 --- a/packages/smooth_app/lib/pages/product/common/product_query_page.dart +++ b/packages/smooth_app/lib/pages/product/common/product_query_page.dart @@ -318,7 +318,7 @@ class _ProductQueryPageState extends State { ProductQueryPageHelper.getDurationStringFromTimestamp( _lastUpdate!, context); final String message = - '${AppLocalizations.of(context)!.chached_results_from} $lastTime'; + '${AppLocalizations.of(context)!.cached_results_from} $lastTime'; _lastUpdate = null; Future.delayed( diff --git a/packages/smooth_app/lib/pages/settings_page.dart b/packages/smooth_app/lib/pages/settings_page.dart index 45e45119870..c71db7bb09d 100644 --- a/packages/smooth_app/lib/pages/settings_page.dart +++ b/packages/smooth_app/lib/pages/settings_page.dart @@ -88,9 +88,9 @@ class ProfilePage extends StatelessWidget { 'https://slack.openfoodfacts.org/', false), ), - //About + //About this app SmoothListTile( - text: appLocalizations.about, + text: appLocalizations.about_this_app, onPressed: () async { final PackageInfo packageInfo = await PackageInfo.fromPlatform(); showDialog( From b2203acf5f5ecb6d4e068d08c886dc09233bdd9d Mon Sep 17 00:00:00 2001 From: M123-dev Date: Wed, 22 Dec 2021 18:49:46 +0100 Subject: [PATCH 5/7] Added descriptions --- packages/smooth_app/lib/l10n/app_en.arb | 141 ++++++++++++------ .../user_contribution_view.dart | 2 +- 2 files changed, 99 insertions(+), 44 deletions(-) diff --git a/packages/smooth_app/lib/l10n/app_en.arb b/packages/smooth_app/lib/l10n/app_en.arb index c737225ce52..891880629bb 100644 --- a/packages/smooth_app/lib/l10n/app_en.arb +++ b/packages/smooth_app/lib/l10n/app_en.arb @@ -2,12 +2,12 @@ "@Utils": {}, + "yes": "Yes", + "@yes": {}, "add": "Add", "@add": {}, "okay": "Okay", "@okay": {}, - "yes": "Yes", - "@yes": {}, "applyButtonText": "Apply", "@applyButtonText": {}, @@ -20,6 +20,8 @@ "@no": {}, "stop": "Stop", "@stop": {}, + "reset": "Reset", + "@reset": {}, "error": "Something went wrong", "@error": {}, @@ -29,8 +31,6 @@ "featureInProgress": "We're still working on this feature, stay tuned", "@featureInProgress": {}, - "reset": "Reset", - "@reset": {}, "label_web": "View on the Web", "@label_web": {}, @@ -40,7 +40,9 @@ "licenses": "Licences", "@licenses": {}, "looking_for": "Looking for", - "@looking_for": {}, + "@looking_for": { + "description": "Looking for: ${BARCODE}" + }, @@ -58,17 +60,27 @@ "@Settings": {}, "settingsTitle": "Settings", - "@settingsTitle": {}, + "@settingsTitle": { + "description": "The title of the Settings page" + }, "darkmode": "Darkmode", - "@darkmode": {}, + "@darkmode": { + "description": "The name of the darkmode on off switch" + }, "contributors": "Contributors", - "@contributors": {}, + "@contributors": { + "description": "Button label: Opens a pop up window where all contributors of this app are shown" + }, "support": "Support", - "@support": {}, + "@support": { + "description": "Button label: Opens a pop up window where all ways to get support are shown" + }, "termsOfUse": "Terms of use", "@termsOfUse": {}, "about_this_app": "About this app", - "@about_this_app": {}, + "@about_this_app": { + "description": "Button label: Opens a popo up window which shows informations about this app" + }, @@ -76,9 +88,13 @@ "@About this app section": {}, "contribute": "Contribute", - "@contribute": {}, - "contribute_develop": "Develop", - "@contribute_develop": {}, + "@contribute": { + "description": "Button label: Shows multiple ways how users can contribute to OFF" + }, + "contribute_sw_development": "Software development", + "@contribute_sw_development": { + "description": "Button label + page title: Ways to help" + }, "contribute_develop_text": "The code for every Open Food Facts product is available on GitHub. You are welcome to reuse the code (it's open source) and help us improve it, for everyone, on all the planet.", "@contribute_develop_text": {}, "contribute_develop_text_2": "You can join the Open Food Facts Slack chatroom which is the preferred way to ask questions.", @@ -86,15 +102,23 @@ "contribute_donate_header": "Donate to Open Food Facts", "@contribute_donate_header": {}, "contribute_improve_ProductsToBeCompleted": "Products to be completed", - "@contribute_improve_ProductsToBeCompleted": {}, + "@contribute_improve_ProductsToBeCompleted": { + "description": "Button label: Shows a list of products which aren't completed" + }, "contribute_improve_header": "Improving", - "@contribute_improve_header": {}, + "@contribute_improve_header": { + "description": "Button label + page title: Ways to improve the database" + }, "contribute_improve_text": "The database is the core of the project. It's easy and very quick to help. You can download the mobile app for your phone, and start adding or improving products.\n\nOn the other hand, Open Food Facts website offers many ways to contribute: ", "@contribute_improve_text": {}, "contribute_translate_header": "Translate", - "@contribute_translate_header": {}, + "@contribute_translate_header": { + "description": "Button label + pop up window title: Shows information about helping by translating" + }, "contribute_translate_link_text": "Start Translating", - "@contribute_translate_link_text": {}, + "@contribute_translate_link_text": { + "description": "Button label: Opens the Crowdin translation portal" + }, "contribute_translate_text": "Open Food Facts is a global project, containing products from more than 160 countries. Open Food Facts is translated into dozens of languages, with constantly evolving content.", "@contribute_translate_text": {}, "contribute_translate_text_2": "Translations is one of the key tasks of the project", @@ -106,14 +130,21 @@ "@Personal preferences": {}, "myPreferences": "My preferences", - "@myPreferences": {}, + "@myPreferences": { + "description": "Page title: Page where the ranking preferences can be changed" + }, "confirmResetPreferences": "Reset your preferences?", - "@confirmResetPreferences": {}, + "@confirmResetPreferences": { + "description": "Pop up title: Reassuring if the food preferences should really be reset" + }, "myPersonalizedRanking": "My personalized ranking", "@myPersonalizedRanking": { "description": "When you press this button, all products (in list or category) are sorted according to your preferences." }, "reloaded_with_new_preferences": "Reloaded with new preferences", + "@reloaded_with_new_preferences": { + "description": "Snackbar title: Shows that the modified settings have been applied" + }, @@ -128,29 +159,50 @@ "description": "A button that opens a menu where you can filter within categories. Juices => Apple juices/Orange juices" }, "scan": "Scan", + "@scan": "Page title: List type: Scanned products", "search": "Search", - "@search": {}, - "searchPanelHeader": "Search or scan your first product", - "@searchPanelHeader": {}, + "@search": { + "description": "Hint text of a search text input field" + }, "@Product": {}, - - "could_not_refresh": "Could not refresh product", - "@could_not_refresh": {}, + + "product": "Product", + "@product": {}, + "unknownBrand": "Unknown brand", + "@unknownBrand": {}, + "unknownProductName": "Unknown product name", + "@unknownProductName": {}, "label_refresh": "refresh", "@label_refresh": { "description": "Refresh the cached product" }, "front_photo": "Front photo", - "@front_photo": {}, + "@front_photo": { + "description": "Button label: For adding a picture of the front of a product" + }, "ingredients": "Ingredients", "@ingredients": {}, "ingredients_photo": "Ingredients photo", - "@ingredients_photo": {}, + "@ingredients_photo": { + "description": "Button label: For adding a picture of the Ingredients of a product" + }, + "nutrition": "Nutrition", + "@nutrition": {}, + "nutrition_facts_photo": "Nutrition facts photo", + "@nutrition_facts_photo": { + "description": "Button label: For adding a picture of the nutrition facts of a product" + }, + "packaging_information": "Packaging information", + "@packaging_information": { + "description": "Button label: For adding a picture of the packaging of a product" + }, + "packaging_information_photo": "Packaging information photo", + "@packaging_information_photo": {}, "missing_product": "This product is missing", "@missing_product": {}, "more_photos": "More interesting photos", @@ -158,32 +210,34 @@ "no_product_found": "No product found", "@no_product_found": {}, "not_found": "not found:", - "nutrition": "Nutrition", - "@nutrition": {}, - "nutrition_facts_photo": "Nutrition facts photo", - "@nutrition_facts_photo": {}, - "packaging_information": "Packaging information", - "@packaging_information": {}, - "packaging_information_photo": "Packaging information photo", - "@packaging_information_photo": {}, - "product": "Product", - "@product": {}, - "unknownBrand": "Unknown brand", - "@unknownBrand": {}, - "unknownProductName": "Unknown product name", - "@unknownProductName": {}, + + "@Product query status": {}, "refreshing_product": "Refreshing product", - "@refreshing_product": {}, + "@refreshing_product": { + "description": "Confirmation, that the product data of a cached product is queried again" + }, "product_refreshed": "Product refreshed", - "@product_refreshed": {}, + "@product_refreshed": { + "description": "Confirmation, that the product data refresh is done" + }, + "could_not_refresh": "Could not refresh product", + "@could_not_refresh": { + "description": "The product data couldn't be refreshed" + }, "product_internet_cancel": "Canceled by user.", + "@product_internet_cancel": { + "description": "Confirmation, that the product data got canceled by the user" + }, "product_internet_error": "Impossible to fetch information about this product due to a network error.", "cached_results_from": "Cached results from:", + "@cached_results_from": { + "description": "Cached results from: x time ago (time ago should not be added to the string)" + }, @@ -233,6 +287,7 @@ "pct_match": "{pct}% match", "@pct_match": { + "description": "This product has a x percent match with your preferences", "placeholders": { "pct": {} } diff --git a/packages/smooth_app/lib/views/bottom_sheet_views/user_contribution_view.dart b/packages/smooth_app/lib/views/bottom_sheet_views/user_contribution_view.dart index 3db3716f767..01c2ecbe52c 100644 --- a/packages/smooth_app/lib/views/bottom_sheet_views/user_contribution_view.dart +++ b/packages/smooth_app/lib/views/bottom_sheet_views/user_contribution_view.dart @@ -47,7 +47,7 @@ class UserContributionView extends StatelessWidget { //Develop SmoothListTile( text: AppLocalizations.of(context)! - .contribute_develop, + .contribute_sw_development, onPressed: () => _develop(context), ), From 1542ff8efe8b572cf6f64549440a0acabfd09c83 Mon Sep 17 00:00:00 2001 From: M123-dev Date: Wed, 22 Dec 2021 19:55:40 +0100 Subject: [PATCH 6/7] Added new Strings --- packages/smooth_app/lib/l10n/app_en.arb | 57 ++++++++++++++++++- .../smooth_app/lib/pages/page_manager.dart | 11 ++-- .../common/product_list_dialog_helper.dart | 3 +- .../product/common/product_list_page.dart | 5 +- .../lib/pages/product/summary_card.dart | 3 +- .../lib/pages/scan/continuous_scan_page.dart | 12 ++-- .../lib/pages/user_management/login_page.dart | 31 +++++----- .../user_contribution_view.dart | 2 +- 8 files changed, 92 insertions(+), 32 deletions(-) diff --git a/packages/smooth_app/lib/l10n/app_en.arb b/packages/smooth_app/lib/l10n/app_en.arb index 891880629bb..d13e58660c2 100644 --- a/packages/smooth_app/lib/l10n/app_en.arb +++ b/packages/smooth_app/lib/l10n/app_en.arb @@ -57,6 +57,32 @@ + "@user_management": {}, + + "sign_in_text": "Sign in to your Open Food Facts account to save your contributions", + "incorrect_credentials": "Incorrect user name or password.", + "login": "Darkmode", + "@login": { + "description": "Text field hint: unified name for " + }, + "sign_in": "Sign in", + "@sign_in": { + "description": "Button label: For sign in" + }, + "password": "Password", + "forgot_password": "Forgot password", + "@forgot_password": { + "description": "Button label: Opens a page where a password reset email can be requested" + }, + "enter_some_text": "Please enter some text", + "@enter_some_text": { + "description": "Error when text field is empty" + }, + + + + + "@Settings": {}, "settingsTitle": "Settings", @@ -151,6 +177,19 @@ "@other": {}, + "profile_navbar_label": "Profile", + "@profile_navbar_label": { + "description": "BottomNavigationBarLabel: For the profile and personal preferences page" + }, + "scan_navbar_label": "Profile", + "@scan_navbar_label": { + "description": "BottomNavigationBarLabel: For the profile and personal preferences page" + } , + "history_navbar_label": "Profile", + "@history_navbar_label": { + "description": "BottomNavigationBarLabel: For the profile and personal preferences page" + }, + "category": "Category", "@category": {}, "category_search": "(category search)", @@ -159,11 +198,14 @@ "description": "A button that opens a menu where you can filter within categories. Juices => Apple juices/Orange juices" }, "scan": "Scan", - "@scan": "Page title: List type: Scanned products", + "@scan": { + "description": "Page title: List type: Scanned products" + }, "search": "Search", "@search": { "description": "Hint text of a search text input field" }, + "tab_for_more": "Tap to see more info...", @@ -210,6 +252,7 @@ "no_product_found": "No product found", "@no_product_found": {}, "not_found": "not found:", + "searchPanelHeader": "Search or scan your first product", @@ -279,6 +322,11 @@ "no_prodcut_in_list": "There is no product in this list", "no_product_in_section": "There is no product in this section", "recently_seen_products": "My recently seen products", + "clear": "Clear", + "@clear": { + "description": "Clears a product list" + }, + "really_clear": "Do you really want to clear this list?", @@ -326,6 +374,13 @@ "placeholders": { "count": {} } + }, + "plural_compare_x_products": "{count,plural, =other{Compare {count} Products}", + "@plural_compare_x_products": { + "description": "Button label", + "placeholders": { + "count": {} + } } } \ No newline at end of file diff --git a/packages/smooth_app/lib/pages/page_manager.dart b/packages/smooth_app/lib/pages/page_manager.dart index a81d8db88ef..0cbf484291b 100644 --- a/packages/smooth_app/lib/pages/page_manager.dart +++ b/packages/smooth_app/lib/pages/page_manager.dart @@ -1,4 +1,5 @@ import 'package:flutter/material.dart'; +import 'package:flutter_gen/gen_l10n/app_localizations.dart'; import 'package:smooth_app/widgets/tab_navigator.dart'; enum BottomNavigationTab { @@ -48,6 +49,7 @@ class PageManagerState extends State { @override Widget build(BuildContext context) { + final AppLocalizations appLocalizations = AppLocalizations.of(context)!; return WillPopScope( onWillPop: () async { final bool isFirstRouteInCurrentTab = @@ -76,19 +78,18 @@ class PageManagerState extends State { _selectTab(_pageKeys[index], index); }, currentIndex: _currentPage.index, - items: const [ - // TODO(M123): Translate + items: [ BottomNavigationBarItem( icon: Icon(Icons.account_circle), - label: 'Profile', + label: appLocalizations.profile_navbar_label, ), BottomNavigationBarItem( icon: Icon(Icons.search), - label: 'Scan or Search', + label: appLocalizations.scan_navbar_label, ), BottomNavigationBarItem( icon: Icon(Icons.history), - label: 'History', + label: appLocalizations.history_navbar_label, ), ], ), diff --git a/packages/smooth_app/lib/pages/product/common/product_list_dialog_helper.dart b/packages/smooth_app/lib/pages/product/common/product_list_dialog_helper.dart index 7ed43fa7bba..df940b5bcda 100644 --- a/packages/smooth_app/lib/pages/product/common/product_list_dialog_helper.dart +++ b/packages/smooth_app/lib/pages/product/common/product_list_dialog_helper.dart @@ -27,8 +27,7 @@ class ProductListDialogHelper { context: context, builder: (BuildContext context) => SmoothAlertDialog( close: false, - body: const Text( - 'Do you really want to clear this list?'), // TODO(monsieurtanuki): translate + body: Text(AppLocalizations.of(context)!.really_clear), actions: [ SmoothSimpleButton( text: AppLocalizations.of(context)!.no, diff --git a/packages/smooth_app/lib/pages/product/common/product_list_page.dart b/packages/smooth_app/lib/pages/product/common/product_list_page.dart index 05e2fb66d49..4c63b90c618 100644 --- a/packages/smooth_app/lib/pages/product/common/product_list_page.dart +++ b/packages/smooth_app/lib/pages/product/common/product_list_page.dart @@ -1,3 +1,4 @@ +import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:flutter_gen/gen_l10n/app_localizations.dart'; import 'package:openfoodfacts/model/Product.dart'; @@ -67,9 +68,9 @@ class _ProductListPageState extends State { PopupMenuButton( itemBuilder: (final BuildContext context) => >[ - const PopupMenuItem( + PopupMenuItem( value: 'clear', - child: Text('Clear'), // TODO(monsieurtanuki): translate + child: Text(appLocalizations.clear), enabled: true, ), ], diff --git a/packages/smooth_app/lib/pages/product/summary_card.dart b/packages/smooth_app/lib/pages/product/summary_card.dart index b47005739bf..aa677c387f4 100644 --- a/packages/smooth_app/lib/pages/product/summary_card.dart +++ b/packages/smooth_app/lib/pages/product/summary_card.dart @@ -99,9 +99,8 @@ class _SummaryCardState extends State { BorderRadius.vertical(bottom: SmoothCard.CIRCULAR_RADIUS), ), child: Center( - // TODO(jasmeet): Internationalize child: Text( - 'Tap to see more info...', + AppLocalizations.of(context)!.tab_for_more, style: Theme.of(context) .textTheme .bodyText1! diff --git a/packages/smooth_app/lib/pages/scan/continuous_scan_page.dart b/packages/smooth_app/lib/pages/scan/continuous_scan_page.dart index 06eef83d89b..3259c267a5a 100644 --- a/packages/smooth_app/lib/pages/scan/continuous_scan_page.dart +++ b/packages/smooth_app/lib/pages/scan/continuous_scan_page.dart @@ -1,4 +1,5 @@ import 'package:flutter/material.dart'; +import 'package:flutter_gen/gen_l10n/app_localizations.dart'; import 'package:flutter_svg/flutter_svg.dart'; import 'package:provider/provider.dart'; import 'package:qr_code_scanner/qr_code_scanner.dart'; @@ -123,6 +124,7 @@ class _ContinuousScanPageState extends State { } Widget _buildButtonsRow(BuildContext context, ContinuousScanModel model) { + final AppLocalizations appLocalizations = AppLocalizations.of(context)!; final ButtonStyle buttonStyle = ButtonStyle( shape: MaterialStateProperty.all( RoundedRectangleBorder( @@ -143,15 +145,17 @@ class _ContinuousScanPageState extends State { style: buttonStyle, icon: const Icon(Icons.cancel_outlined), onPressed: model.clearScanSession, - // TODO(jasmeet): Internationalize - label: const Text('Clear'), + label: Text(appLocalizations.clear), ), ElevatedButton.icon( style: buttonStyle, icon: const Icon(Icons.emoji_events_outlined), onPressed: () => _openPersonalizedRankingPage(context), - // TODO(jasmeet): Internationalize - label: Text('Compare ${model.getBarcodes().length} Products'), + label: Text( + appLocalizations.plural_compare_x_products( + model.getBarcodes().length, + ), + ), ), ], ), diff --git a/packages/smooth_app/lib/pages/user_management/login_page.dart b/packages/smooth_app/lib/pages/user_management/login_page.dart index 1c1e759a867..1b9e3920e5e 100644 --- a/packages/smooth_app/lib/pages/user_management/login_page.dart +++ b/packages/smooth_app/lib/pages/user_management/login_page.dart @@ -1,4 +1,5 @@ import 'package:flutter/material.dart'; +import 'package:flutter_gen/gen_l10n/app_localizations.dart'; import 'package:openfoodfacts/openfoodfacts.dart'; import 'package:provider/provider.dart'; import 'package:smooth_app/helpers/user_management_helper.dart'; @@ -8,7 +9,6 @@ import 'package:smooth_ui_library/widgets/smooth_text_form_field.dart'; // TODO(M123-dev): Autofill support // TODO(M123-dev): Handle colors better -// TODO(M123-dev): internationalize everything // TODO(M123-dev): Better validation class LoginPage extends StatefulWidget { @@ -69,6 +69,7 @@ class _LoginPageState extends State { Widget build(BuildContext context) { final ThemeData theme = Theme.of(context); final ThemeProvider themeProvider = context.watch(); + final AppLocalizations appLocalizations = AppLocalizations.of(context)!; final Size size = MediaQuery.of(context).size; // Needs to be changed @@ -97,7 +98,7 @@ class _LoginPageState extends State { const Spacer(flex: 4), Text( - 'Sign in to your Open Food Facts account to save your contributions ', + appLocalizations.sign_in_text, textAlign: TextAlign.center, style: theme.textTheme.headline1?.copyWith( fontSize: 20.0, @@ -108,13 +109,13 @@ class _LoginPageState extends State { const Spacer(flex: 8), - if (_wrongCredentials) ...const [ + if (_wrongCredentials) ...[ SmoothCard( padding: EdgeInsets.all(10.0), color: Colors.red, - child: Text('Incorrect user name or password.'), + child: Text(appLocalizations.incorrect_credentials), ), - Spacer( + const Spacer( flex: 1, ) ], @@ -123,7 +124,7 @@ class _LoginPageState extends State { SmoothTextFormField( type: TextFieldTypes.PLAIN_TEXT, controller: userIdController, - hintText: 'Login', + hintText: appLocalizations.login, textColor: customGrey, backgroundColor: textFieldBackgroundColor, prefixIcon: const Icon(Icons.person), @@ -131,7 +132,7 @@ class _LoginPageState extends State { textInputAction: TextInputAction.next, // Moves focus to next. validator: (String? value) { if (value == null || value.isEmpty) { - return 'Please enter some text'; + return appLocalizations.enter_some_text; } return null; }, @@ -143,7 +144,7 @@ class _LoginPageState extends State { SmoothTextFormField( type: TextFieldTypes.PASSWORD, controller: passwordController, - hintText: 'Password', + hintText: appLocalizations.password, textColor: customGrey, backgroundColor: textFieldBackgroundColor, prefixIcon: const Icon(Icons.vpn_key), @@ -151,7 +152,7 @@ class _LoginPageState extends State { textInputAction: TextInputAction.done, // Hides the keyboard validator: (String? value) { if (value == null || value.isEmpty) { - return 'Please enter some text'; + return appLocalizations.enter_some_text; } return null; }, @@ -163,7 +164,7 @@ class _LoginPageState extends State { ElevatedButton( onPressed: () => _login(context), child: Text( - 'Sign in', + appLocalizations.sign_in, style: theme.textTheme.bodyText2?.copyWith( fontSize: 18.0, color: theme.colorScheme.onSurface, @@ -184,13 +185,13 @@ class _LoginPageState extends State { //Forgot password TextButton( onPressed: () { - const SnackBar snackBar = SnackBar( - content: Text('Not implemented yet'), + final SnackBar snackBar = SnackBar( + content: Text(appLocalizations.featureInProgress), ); ScaffoldMessenger.of(context).showSnackBar(snackBar); }, child: Text( - 'Forgot password', + appLocalizations.forgot_password, style: theme.textTheme.bodyText2?.copyWith( fontSize: 18.0, color: theme.colorScheme.primary, @@ -205,8 +206,8 @@ class _LoginPageState extends State { height: size.height * 0.06, child: OutlinedButton( onPressed: () { - const SnackBar snackBar = SnackBar( - content: Text('Not implemented yet'), + final SnackBar snackBar = SnackBar( + content: Text(appLocalizations.featureInProgress), ); ScaffoldMessenger.of(context).showSnackBar(snackBar); }, diff --git a/packages/smooth_app/lib/views/bottom_sheet_views/user_contribution_view.dart b/packages/smooth_app/lib/views/bottom_sheet_views/user_contribution_view.dart index 01c2ecbe52c..85f1d06f05c 100644 --- a/packages/smooth_app/lib/views/bottom_sheet_views/user_contribution_view.dart +++ b/packages/smooth_app/lib/views/bottom_sheet_views/user_contribution_view.dart @@ -131,7 +131,7 @@ class UserContributionView extends StatelessWidget { context: context, builder: (BuildContext context) { return SmoothAlertDialog( - title: AppLocalizations.of(context)!.contribute_develop, + title: AppLocalizations.of(context)!.contribute_sw_development, body: Column( children: [ Text( From 5283d36c7ca39e4f21ac1a358ac952148ffcd2a3 Mon Sep 17 00:00:00 2001 From: M123-dev Date: Wed, 22 Dec 2021 20:00:25 +0100 Subject: [PATCH 7/7] const --- packages/smooth_app/lib/pages/page_manager.dart | 6 +++--- .../lib/pages/product/common/product_list_page.dart | 1 - .../smooth_app/lib/pages/user_management/login_page.dart | 2 +- 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/packages/smooth_app/lib/pages/page_manager.dart b/packages/smooth_app/lib/pages/page_manager.dart index 0cbf484291b..e469e47edab 100644 --- a/packages/smooth_app/lib/pages/page_manager.dart +++ b/packages/smooth_app/lib/pages/page_manager.dart @@ -80,15 +80,15 @@ class PageManagerState extends State { currentIndex: _currentPage.index, items: [ BottomNavigationBarItem( - icon: Icon(Icons.account_circle), + icon: const Icon(Icons.account_circle), label: appLocalizations.profile_navbar_label, ), BottomNavigationBarItem( - icon: Icon(Icons.search), + icon: const Icon(Icons.search), label: appLocalizations.scan_navbar_label, ), BottomNavigationBarItem( - icon: Icon(Icons.history), + icon: const Icon(Icons.history), label: appLocalizations.history_navbar_label, ), ], diff --git a/packages/smooth_app/lib/pages/product/common/product_list_page.dart b/packages/smooth_app/lib/pages/product/common/product_list_page.dart index 4c63b90c618..eccbf1758b8 100644 --- a/packages/smooth_app/lib/pages/product/common/product_list_page.dart +++ b/packages/smooth_app/lib/pages/product/common/product_list_page.dart @@ -1,4 +1,3 @@ -import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:flutter_gen/gen_l10n/app_localizations.dart'; import 'package:openfoodfacts/model/Product.dart'; diff --git a/packages/smooth_app/lib/pages/user_management/login_page.dart b/packages/smooth_app/lib/pages/user_management/login_page.dart index 1b9e3920e5e..4029e76b7f5 100644 --- a/packages/smooth_app/lib/pages/user_management/login_page.dart +++ b/packages/smooth_app/lib/pages/user_management/login_page.dart @@ -111,7 +111,7 @@ class _LoginPageState extends State { if (_wrongCredentials) ...[ SmoothCard( - padding: EdgeInsets.all(10.0), + padding: const EdgeInsets.all(10.0), color: Colors.red, child: Text(appLocalizations.incorrect_credentials), ),