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: tweaks to dev mode #5977

Draft
wants to merge 10 commits into
base: develop
Choose a base branch
from
52 changes: 51 additions & 1 deletion packages/smooth_app/lib/l10n/app_en.arb
Original file line number Diff line number Diff line change
Expand Up @@ -3762,6 +3762,56 @@
"photo_field_packaging": "Packaging information photo",
"photo_already_exists": "This photo already exists",
"photo_missing": "This photo is missing",
"contribute_develop_dev_mode_title": "Dev Mode",
"debugging_information": "Debugging Information",
"background_task_title": "Background Task",
"background_task_subtitle": "Manage background tasks",
"offline_data": "Offline Data",
"dev_preferences_export_history_title": "Export History",
"clipboard_barcode_copy": "Copy to Clipboard",
"dev_preferences_export_history_progress_error": "Error",
"dev_preferences_export_history_progress_found": "Found",
"dev_preferences_export_history_progress_not_found": "Not Found",
"dev_preferences_export_history_dialog_title": "Export History",
"copy_to_clipboard": "Copy to Clipboard",
"okay": "Okay",
"refresh_all_products_from_server": "Refresh All Products from Server",
"reset_app_language": "Reset App Language",
"add_cards_to_scanner": "Add Cards to Scanner",
"adds_3_sample_products_to_scanner": "Adds 3 sample products to scanner",
"dev_preferences_environment_switch_title": "Environment Switch",
"dev_preferences_test_environment_title": "Test Environment",
"dev_preferences_test_environment_subtitle": "Current Test Environment: {0}",
"dev_preferences_test_environment_dialog_title": "Change Test Environment",
"cancel": "Cancel",
"dev_preferences_button_positive": "Success",
"dev_mode_section_data": "Data",
"dev_mode_section_server": "Server",
"open_prices_server_configuration": "Open Prices Server Configuration",
"switch_between_prices_prod_and_test": "Switch between Prices Prod and Test",
"dev_mode_section_news": "News",
"dev_preferences_news_custom_url_title": "Custom News URL",
"dev_preferences_news_custom_url_empty_value": "No custom URL set",
"dev_preferences_news_custom_url_subtitle": "Enter custom news URL",
"dev_preferences_news_provider_status_title": "News Provider Status",
"loading": "Loading",
"dev_preferences_news_provider_status_subtitle": "Last update: {0}",
"dev_mode_section_product_page": "Product Page",
"dev_preferences_edit_ingredients_title": "Edit Ingredients",
"dev_mode_hide_ecoscore_title": "Hide Eco-Score",
"dev_preferences_show_folksonomy_title": "Show Folksonomy",
"dev_mode_section_ui": "UI",
"dev_preferences_reset_onboarding_title": "Reset Onboarding",
"dev_preferences_reset_onboarding_subtitle": "Reset onboarding flow",
"remove_colors_from_knowledge_panels": "Remove colors from Knowledge Panels on the product page",
"show_emoji_as_visual_help": "Show emoji as a visual help on the product page",
"dev_mode_spellchecker_for_ocr_title": "Spellchecker for OCR",
"dev_mode_spellchecker_for_ocr_subtitle": "Enable spellchecker for OCR",
"dev_mode_section_experimental_features": "Experimental Features",
"allow_reordering_knowledge_panels": "Allow reordering knowledge panels according to your preferences",
"temporary_access_to_location_search": "Temporary Access to Location Search",
"search_within_help_and_preferences": "Search within help & preferences…",
"side_by_side_comparison": "Side by side comparison for 2 to 3 products",
"date": "Date",
"photo_rotate_left": "Rotate left",
"@photo_rotate_left": {
Expand Down Expand Up @@ -3809,4 +3859,4 @@
}
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import 'package:smooth_app/database/dao_product.dart';
import 'package:smooth_app/database/dao_product_list.dart';
import 'package:smooth_app/database/local_database.dart';
import 'package:smooth_app/generic_lib/dialogs/smooth_alert_dialog.dart';
import 'package:smooth_app/l10n/app_localizations.dart';
import 'package:smooth_app/pages/locations/osm_location.dart';
import 'package:smooth_app/pages/locations/search_location_helper.dart';
import 'package:smooth_app/pages/locations/search_location_preloaded_item.dart';
Expand Down Expand Up @@ -101,7 +102,7 @@ class UserPreferencesDevMode extends AbstractUserPreferences {
value: userPreferences.devMode == 1,
),
UserPreferencesItemTile(
title: 'Debugging information',
title: appLocalizations.debugging_information,
onTap: () async => Navigator.of(context).push(MaterialPageRoute<void>(
builder: (BuildContext context) =>
const UserPreferencesDebugInfo())),
Expand Down Expand Up @@ -199,7 +200,7 @@ class UserPreferencesDevMode extends AbstractUserPreferences {
},
),
UserPreferencesItemTile(
title: 'Refresh all products from server (cf. Nutriscore v2)',
title: appLocalizations.refresh_all_products_from_server,
trailing: const Icon(Icons.refresh),
onTap: () async {
final LocalDatabase localDatabase = context.read<LocalDatabase>();
Expand All @@ -218,8 +219,8 @@ class UserPreferencesDevMode extends AbstractUserPreferences {
},
),
UserPreferencesItemTile(
title: 'Add cards to scanner',
subtitle: 'Adds 3 sample products to the scanner',
title: appLocalizations.add_cards_to_scanner,
subtitle: appLocalizations.adds_3_sample_products_to_scanner,
onTap: () async {
final ContinuousScanModel model =
context.read<ContinuousScanModel>();
Expand All @@ -246,7 +247,7 @@ class UserPreferencesDevMode extends AbstractUserPreferences {
await userPreferences.setFlag(userPreferencesFlagProd, newValue);
ProductQuery.setQueryType(userPreferences);
},
items: const <DropdownMenuItem<bool>>[
items: <DropdownMenuItem<bool>>[
DropdownMenuItem<bool>(
value: true,
child: Text('PROD'),
Expand All @@ -267,11 +268,11 @@ class UserPreferencesDevMode extends AbstractUserPreferences {
),
onTap: () async => _changeTestEnvDomain(),
),
const UserPreferencesItemSection(
label: 'Prices Server configuration',
UserPreferencesItemSection(
label: appLocalizations.open_prices_server_configuration,
),
UserPreferencesItemTile(
title: 'Switch between prices.openfoodfacts.org (PROD) and test env',
title: appLocalizations.switch_between_prices_prod_and_test,
trailing: DropdownButton<bool>(
value:
userPreferences.getFlag(userPreferencesFlagPriceProd) ?? true,
Expand All @@ -283,7 +284,7 @@ class UserPreferencesDevMode extends AbstractUserPreferences {
);
ProductQuery.setQueryType(userPreferences);
},
items: const <DropdownMenuItem<bool>>[
items: <DropdownMenuItem<bool>>[
DropdownMenuItem<bool>(
value: true,
child: Text('PROD'),
Expand Down Expand Up @@ -327,7 +328,7 @@ class UserPreferencesDevMode extends AbstractUserPreferences {
return Consumer<AppNewsProvider>(
builder: (_, AppNewsProvider provider, __) {
return Text(switch (provider.state) {
AppNewsStateLoading() => 'Loading…',
AppNewsStateLoading() => appLocalizations.loading,
AppNewsStateLoaded(lastUpdate: final DateTime date) =>
appLocalizations
.dev_preferences_news_provider_status_subtitle(
Expand Down Expand Up @@ -398,7 +399,7 @@ class UserPreferencesDevMode extends AbstractUserPreferences {
},
),
UserPreferencesItemSwitch(
title: 'Accessibility: remove colors',
title: appLocalizations.remove_colors_from_knowledge_panels,
value: userPreferences
.getFlag(userPreferencesFlagAccessibilityNoColor) ??
false,
Expand All @@ -409,7 +410,7 @@ class UserPreferencesDevMode extends AbstractUserPreferences {
},
),
UserPreferencesItemSwitch(
title: 'Accessibility: show emoji',
title: appLocalizations.show_emoji_as_visual_help,
value:
userPreferences.getFlag(userPreferencesFlagAccessibilityEmoji) ??
false,
Expand Down Expand Up @@ -447,7 +448,7 @@ class UserPreferencesDevMode extends AbstractUserPreferences {
},
),
UserPreferencesItemSwitch(
title: 'User ordered knowledge panels',
title: appLocalizations.allow_reordering_knowledge_panels,
value: userPreferences.getFlag(userPreferencesFlagUserOrderedKP) ??
false,
onChanged: (bool value) async {
Expand All @@ -457,7 +458,7 @@ class UserPreferencesDevMode extends AbstractUserPreferences {
},
),
UserPreferencesItemTile(
title: 'Temporary access to location search',
title: appLocalizations.temporary_access_to_location_search,
onTap: () async {
final LocalDatabase localDatabase = context.read<LocalDatabase>();
final DaoOsmLocation daoOsmLocation = DaoOsmLocation(localDatabase);
Expand Down Expand Up @@ -505,7 +506,7 @@ class UserPreferencesDevMode extends AbstractUserPreferences {
},
),
UserPreferencesItemTile(
title: 'Preference Search...',
title: appLocalizations.search_within_help_and_preferences,
onTap: () async => Navigator.of(context).push(
MaterialPageRoute<void>(
builder: (BuildContext context) =>
Expand All @@ -514,7 +515,7 @@ class UserPreferencesDevMode extends AbstractUserPreferences {
),
),
UserPreferencesItemSwitch(
title: 'Side by side comparison for 2 or 3 products',
title: appLocalizations.side_by_side_comparison,
value:
userPreferences.getFlag(userPreferencesFlagBoostedComparison) ??
false,
Expand Down
Loading