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
54 changes: 54 additions & 0 deletions packages/smooth_app/lib/l10n/app_en_tmp.arb
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
{
"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",
"prod": "Prod",
"test": "Test",
teolemon marked this conversation as resolved.
Show resolved Hide resolved
"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",
teolemon marked this conversation as resolved.
Show resolved Hide resolved
"show_emoji_as_visual_help": "Show Emoji as Visual Help",
teolemon marked this conversation as resolved.
Show resolved Hide resolved
"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",
teolemon marked this conversation as resolved.
Show resolved Hide resolved
"temporary_access_to_location_search": "Temporary Access to Location Search",
"search_within_help_and_preferences": "Search within Help and Preferences",
teolemon marked this conversation as resolved.
Show resolved Hide resolved
"side_by_side_comparison": "Side-by-Side Comparison"
teolemon marked this conversation as resolved.
Show resolved Hide resolved
}
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 @@ -98,7 +99,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 @@ -196,7 +197,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 @@ -207,16 +208,15 @@ class UserPreferencesDevMode extends AbstractUserPreferences {
},
),
UserPreferencesItemTile(
// Do not translate
title: 'Reset app language',
title: appLocalizations.reset_app_language,
teolemon marked this conversation as resolved.
Show resolved Hide resolved
onTap: () async {
userPreferences.setAppLanguageCode(null);
ProductQuery.setLanguage(context, userPreferences);
},
),
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 @@ -243,14 +243,14 @@ 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'),
child: Text(appLocalizations.prod),
teolemon marked this conversation as resolved.
Show resolved Hide resolved
),
DropdownMenuItem<bool>(
value: false,
child: Text('TEST'),
child: Text(appLocalizations.test),
teolemon marked this conversation as resolved.
Show resolved Hide resolved
),
],
),
Expand All @@ -264,11 +264,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 @@ -280,14 +280,14 @@ class UserPreferencesDevMode extends AbstractUserPreferences {
);
ProductQuery.setQueryType(userPreferences);
},
items: const <DropdownMenuItem<bool>>[
items: <DropdownMenuItem<bool>>[
DropdownMenuItem<bool>(
value: true,
child: Text('PROD'),
child: Text(appLocalizations.prod),
teolemon marked this conversation as resolved.
Show resolved Hide resolved
),
DropdownMenuItem<bool>(
value: false,
child: Text('TEST'),
child: Text(appLocalizations.test),
teolemon marked this conversation as resolved.
Show resolved Hide resolved
),
],
),
Expand Down Expand Up @@ -316,7 +316,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 @@ -387,7 +387,7 @@ class UserPreferencesDevMode extends AbstractUserPreferences {
},
),
UserPreferencesItemSwitch(
title: 'Accessibility: remove colors',
title: appLocalizations.remove_colors_from_knowledge_panels,
value: userPreferences
.getFlag(userPreferencesFlagAccessibilityNoColor) ??
false,
Expand All @@ -398,7 +398,7 @@ class UserPreferencesDevMode extends AbstractUserPreferences {
},
),
UserPreferencesItemSwitch(
title: 'Accessibility: show emoji',
title: appLocalizations.show_emoji_as_visual_help,
value:
userPreferences.getFlag(userPreferencesFlagAccessibilityEmoji) ??
false,
Expand All @@ -423,7 +423,7 @@ class UserPreferencesDevMode extends AbstractUserPreferences {
label: appLocalizations.dev_mode_section_experimental_features,
),
UserPreferencesItemSwitch(
title: 'User ordered knowledge panels',
title: appLocalizations.allow_reordering_knowledge_panels,
value: userPreferences.getFlag(userPreferencesFlagUserOrderedKP) ??
false,
onChanged: (bool value) async {
Expand All @@ -433,7 +433,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 @@ -481,7 +481,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 @@ -490,7 +490,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