diff --git a/.github/actions/pre_build/action.yml b/.github/actions/pre_build/action.yml index 69396d01..49aa9292 100644 --- a/.github/actions/pre_build/action.yml +++ b/.github/actions/pre_build/action.yml @@ -4,18 +4,18 @@ description: 'Internal Action for Tail App' runs: using: "composite" steps: - - name: Configure Flutter CLI - shell: bash - run: flutter config --no-cli-animations --enable-analytics --color - - name: Enable Flutter tools - shell: bash - run: export TERM=xterm-color && dart pub global activate flutter_gen --color && dart pub global activate intl_translation --color && dart pub global activate build_runner --color - - name: Get dependencies - shell: bash - run: export TERM=xterm-color && flutter pub get --color - - name: Generate translation files - shell: bash - run: export TERM=xterm-color && dart pub global run --color intl_translation:generate_from_arb --output-dir=lib/l10n --no-use-deferred-loading lib/Frontend/intn_defs.dart lib/l10n/*.arb - - name: Generate dart .g files - shell: bash - run: export TERM=xterm-color && dart pub global run --color build_runner build --delete-conflicting-outputs + - name: Configure Flutter CLI + shell: bash + run: flutter config --no-cli-animations --enable-analytics --color + - name: Enable Flutter tools + shell: bash + run: export TERM=xterm-color && dart pub global activate flutter_gen --color && dart pub global activate intl_translation --color && dart pub global activate build_runner --color + - name: Get dependencies + shell: bash + run: export TERM=xterm-color && flutter pub get --color + - name: Generate translation files + shell: bash + run: export TERM=xterm-color && dart pub global run --color intl_translation:generate_from_arb --output-dir=lib/l10n --no-use-deferred-loading lib/Frontend/translation_string_definitions.dart lib/l10n/*.arb + - name: Generate dart .g files + shell: bash + run: export TERM=xterm-color && dart pub global run --color build_runner build --delete-conflicting-outputs diff --git a/.github/workflows/localization_strings_update.yml b/.github/workflows/localization_strings_update.yml index c3d7c7d5..db13814a 100644 --- a/.github/workflows/localization_strings_update.yml +++ b/.github/workflows/localization_strings_update.yml @@ -1,7 +1,7 @@ on: push: paths: - - 'lib/Frontend/intn_defs.dart' + - 'lib/Frontend/translation_string_definitions.dart' jobs: build_android: name: Update Localization Files @@ -18,7 +18,7 @@ jobs: - name: Install packages run: flutter config --no-cli-animations && flutter pub get - name: Generate intl_translation - run: dart pub global activate intl_translation && dart pub global run intl_translation:extract_to_arb --locale=en --output-file='./lib/l10n/messages_en.arb' ./lib/Frontend/intn_defs.dart + run: dart pub global activate intl_translation && dart pub global run intl_translation:extract_to_arb --locale=en --output-file='./lib/l10n/messages_en.arb' ./lib/Frontend/translation_string_definitions.dart - name: Stage Changes run: git config user.email "github-actions[bot]@users.noreply.github.com" && git config user.name "github-actions[bot]" && git commit -am "Update EN language file" - name: Push changes diff --git a/README.md b/README.md index 298efa10..1092e600 100644 --- a/README.md +++ b/README.md @@ -66,6 +66,23 @@ Small or large, feel free to leave suggestions for new features, or changes to e - [Git](https://git-scm.com/downloads) - [Ruby](https://www.ruby-lang.org/en/) for FastLane +### Updating EN Localizations + +To update EN localization strings, the file `[translation_string_definitions.dart](lib/Frontend/translation_string_definitions.dart)` needs to be updated. + +```dart +String message() => Intl.message('Displayed Message', name: 'message', desc: 'A description of the string and where it is used'); +``` + +The `Displayed Message` is the string that appears in the UI. +The `name` is the variable name. This must match the variable name used such as `message()` but without the `()`. +The `desc` is a description of the string for use by translators. + +When `[translation_string_definitions.dart](lib/Frontend/translation_string_definitions.dart)` is updated, the job `[localization_strings_update.yml](.github/workflows/localization_strings_update.yml)` updates the generated localization file [messages_en.arb](lib/l10n/messages_en.arb) which makes the strings available to [Weblate](https://weblate.codel1417.xyz/projects/tail_app/tail_app/). +New Strings are auto translated by Google Translate but will not overwrite manually translated strings. + +When non EN translations are updated in [Weblate](https://weblate.codel1417.xyz/projects/tail_app/tail_app/), A pull request will automatically open with the changes. This may take a few minutes. + ### Building #### Preparing for build @@ -83,7 +100,7 @@ Small or large, feel free to leave suggestions for new features, or changes to e > dart pub global activate intl_translation > > flutter pub get # Downloads Dependencies -> dart run intl_translation:generate_from_arb --output-dir=lib/l10n --no-use-deferred-loading lib/Frontend/intn_defs.dart lib/l10n/*.arb +> dart run intl_translation:generate_from_arb --output-dir=lib/l10n --no-use-deferred-loading lib/Frontend/translation_string_definitions.dart lib/l10n/*.arb > flutter pub run build_runner build --delete-conflicting-outputs # Generates .g files > ``` @@ -92,14 +109,14 @@ Small or large, feel free to leave suggestions for new features, or changes to e > > ```shell > dart pub global activate intl_translation -> dart run intl_translation:extract_to_arb --locale=en --output-file='./lib/l10n/messages_en.arb' ./lib/Frontend/intn_defs.dart +> dart run intl_translation:extract_to_arb --locale=en --output-file='./lib/l10n/messages_en.arb' ./lib/Frontend/translation_string_definitions.dart > ``` > > To build localization files, run > > ```shell > dart pub global activate intl_translation -> dart run intl_translation:generate_from_arb --output-dir=lib/l10n --no-use-deferred-loading lib/Frontend/intn_defs.dart lib/l10n/*.arb +> dart run intl_translation:generate_from_arb --output-dir=lib/l10n --no-use-deferred-loading lib/Frontend/translation_string_definitions.dart lib/l10n/*.arb > ``` > > To build generated `.g` files, run @@ -216,27 +233,13 @@ Some of these values aren't actually secret and can be shared. Specifically the #### Sentry -A github app which allows Sentry to authenticate with Github and this repo. It allows Source Code stack trace linking and Creating issues from the Sentry UI. +A github app which allows [Sentry](https://sentry.codel1417.xyz/organizations/sentry/projects/tail_app/?project=2) to authenticate with Github and this repo. It allows Source Code stack trace linking and Creating issues from the [Sentry](https://sentry.codel1417.xyz/organizations/sentry/projects/tail_app/?project=2) UI. #### Weblate -A Webhook to notify Weblate that code was pushed to this repo. - -A SSH key is installed in my account which allows weblate to push translation changes to the repo. - -### Updating EN Localizations - -To update EN localization strings, the file [intn_defs.dart](lib/Frontend/intn_defs.dart) needs to be updated. - -```dart -String message() => Intl.message('Displayed Message', name: 'message', desc: 'A description of the string and where it is used'); -``` - -The `Displayed Message` is the string that appears in the UI. -The `name` is the variable name. This must match the variable name used such as `message()` but without the `()`. -The `desc` is a description of the string for use by translators. +A Webhook to notify [Weblate](https://weblate.codel1417.xyz/projects/tail_app/tail_app/) that code was pushed to this repo. -When [intn_defs.dart](lib/Frontend/intn_defs.dart) is updated, the job [localization_strings_update.yml](.github/workflows/localization_strings_update.yml) updates the generated localization file [messages_en.arb](lib/l10n/messages_en.arb) which makes the strings available to [Weblate](https://weblate.codel1417.xyz/projects/tail_app/tail_app/). +A SSH key is installed in my account which allows [Weblate](https://weblate.codel1417.xyz/projects/tail_app/tail_app/) to push translation changes to the repo. ### Developer Mode Features diff --git a/lib/Backend/Definitions/Action/base_action.dart b/lib/Backend/Definitions/Action/base_action.dart index cb821689..ebc6bcae 100644 --- a/lib/Backend/Definitions/Action/base_action.dart +++ b/lib/Backend/Definitions/Action/base_action.dart @@ -1,5 +1,5 @@ import 'package:hive/hive.dart'; -import 'package:tail_app/Frontend/intn_defs.dart'; +import 'package:tail_app/Frontend/translation_string_definitions.dart'; import 'package:uuid/uuid.dart'; import '../Device/device_definition.dart'; diff --git a/lib/Backend/Definitions/Device/device_definition.dart b/lib/Backend/Definitions/Device/device_definition.dart index 7cc50aae..d9534d40 100644 --- a/lib/Backend/Definitions/Device/device_definition.dart +++ b/lib/Backend/Definitions/Device/device_definition.dart @@ -15,7 +15,7 @@ import 'package:tail_app/Backend/Bluetooth/bluetooth_manager.dart'; import 'package:tail_app/Backend/Bluetooth/bluetooth_manager_plus.dart'; import 'package:tail_app/Backend/firmware_update.dart'; -import '../../../Frontend/intn_defs.dart'; +import '../../../Frontend/translation_string_definitions.dart'; import '../../../Frontend/utils.dart'; import '../../Bluetooth/bluetooth_message.dart'; diff --git a/lib/Backend/move_lists.dart b/lib/Backend/move_lists.dart index 1ca94de5..554a64b3 100644 --- a/lib/Backend/move_lists.dart +++ b/lib/Backend/move_lists.dart @@ -1,8 +1,6 @@ -import 'package:audio_session/audio_session.dart'; import 'package:chart_sparkline/chart_sparkline.dart'; import 'package:flutter/material.dart'; import 'package:hive/hive.dart'; -import 'package:just_audio/just_audio.dart'; import 'package:logging/logging.dart'; import 'package:riverpod_annotation/riverpod_annotation.dart'; import 'package:sentry_hive/sentry_hive.dart'; @@ -10,7 +8,7 @@ import 'package:tail_app/Backend/Bluetooth/bluetooth_message.dart'; import 'package:tail_app/Backend/Definitions/Action/base_action.dart'; import 'package:tail_app/Backend/Definitions/Device/device_definition.dart'; import 'package:tail_app/Backend/audio.dart'; -import 'package:tail_app/Frontend/intn_defs.dart'; +import 'package:tail_app/Frontend/translation_string_definitions.dart'; import '../main.dart'; @@ -257,12 +255,10 @@ Future runAction(BaseAction action, BaseStatefulDevice device) async { } } } - } - else if (action is AudioAction){ + } else if (action is AudioAction) { String file = action.file; playSound(file); - } } diff --git a/lib/Backend/sensors.dart b/lib/Backend/sensors.dart index 2c271a44..78c0bfaf 100644 --- a/lib/Backend/sensors.dart +++ b/lib/Backend/sensors.dart @@ -19,7 +19,7 @@ import 'package:tail_app/Backend/Bluetooth/bluetooth_manager_plus.dart'; import 'package:tail_app/Backend/Bluetooth/bluetooth_message.dart'; import 'package:tail_app/Backend/action_registry.dart'; -import '../Frontend/intn_defs.dart'; +import '../Frontend/translation_string_definitions.dart'; import '../constants.dart'; import 'Bluetooth/bluetooth_manager.dart'; import 'Definitions/Action/base_action.dart'; diff --git a/lib/Frontend/Widgets/back_button_to_close.dart b/lib/Frontend/Widgets/back_button_to_close.dart index 8dc5180f..3e4be53a 100644 --- a/lib/Frontend/Widgets/back_button_to_close.dart +++ b/lib/Frontend/Widgets/back_button_to_close.dart @@ -5,7 +5,7 @@ import 'package:flutter/material.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; import '../../Backend/Bluetooth/bluetooth_manager_plus.dart'; -import '../intn_defs.dart'; +import '../translation_string_definitions.dart'; class BackButtonToClose extends ConsumerStatefulWidget { const BackButtonToClose({required this.child, super.key}); diff --git a/lib/Frontend/Widgets/device_type_widget.dart b/lib/Frontend/Widgets/device_type_widget.dart index 96577b26..0772596b 100644 --- a/lib/Frontend/Widgets/device_type_widget.dart +++ b/lib/Frontend/Widgets/device_type_widget.dart @@ -1,7 +1,7 @@ import 'package:flutter/material.dart'; import '../../Backend/Definitions/Device/device_definition.dart'; -import '../intn_defs.dart'; +import '../translation_string_definitions.dart'; class DeviceTypeWidget extends StatelessWidget { const DeviceTypeWidget({super.key, required this.selected, required this.onSelectionChanged}); diff --git a/lib/Frontend/Widgets/known_gear.dart b/lib/Frontend/Widgets/known_gear.dart index 17360da1..02d7a790 100644 --- a/lib/Frontend/Widgets/known_gear.dart +++ b/lib/Frontend/Widgets/known_gear.dart @@ -8,8 +8,8 @@ import 'package:tail_app/Frontend/Widgets/scan_for_new_device.dart'; import '../../Backend/Bluetooth/bluetooth_manager.dart'; import '../../constants.dart'; import '../../main.dart'; -import '../intn_defs.dart'; import '../pages/shell.dart'; +import '../translation_string_definitions.dart'; class KnownGear extends ConsumerStatefulWidget { const KnownGear({super.key}); @@ -40,60 +40,65 @@ class ScanForNewGearButton extends ConsumerWidget { @override Widget build(BuildContext context, WidgetRef ref) { - return TweenAnimationBuilder(tween: ref.watch(knownDevicesProvider).isEmpty ? Tween(begin: 0, end: 1) : Tween(begin: 1, end: 0), duration: animationTransitionDuration, builder: (context, value, child) { - return Card( - clipBehavior: Clip.antiAlias, - color: Color.lerp(Theme.of(context).cardColor, Theme.of(context).primaryColor, value), - child:child , - ); - },child: InkWell( - child: Padding( - padding: const EdgeInsets.all(8.0), - child: SizedBox( - height: 50 * MediaQuery.textScalerOf(context).scale(1), - width: ref.watch(knownDevicesProvider).values.length > 1 ? 100 * MediaQuery.textScalerOf(context).scale(1) : 200 * MediaQuery.textScalerOf(context).scale(1), - child: Center( - child: Text( - scanDevicesTitle(), - textAlign: TextAlign.center, + return TweenAnimationBuilder( + tween: ref.watch(knownDevicesProvider).isEmpty ? Tween(begin: 0, end: 1) : Tween(begin: 1, end: 0), + duration: animationTransitionDuration, + builder: (context, value, child) { + return Card( + clipBehavior: Clip.antiAlias, + color: Color.lerp(Theme.of(context).cardColor, Theme.of(context).primaryColor, value), + child: child, + ); + }, + child: InkWell( + child: Padding( + padding: const EdgeInsets.all(8.0), + child: SizedBox( + height: 50 * MediaQuery.textScalerOf(context).scale(1), + width: ref.watch(knownDevicesProvider).values.length > 1 ? 100 * MediaQuery.textScalerOf(context).scale(1) : 200 * MediaQuery.textScalerOf(context).scale(1), + child: Center( + child: Text( + scanDevicesTitle(), + textAlign: TextAlign.center, + ), ), ), ), - ), - onTap: () { - plausible.event(page: "Scan For New Gear"); - showModalBottomSheet( - context: context, - showDragHandle: true, - isScrollControlled: true, - enableDrag: true, - isDismissible: true, - builder: (BuildContext context) { - return DraggableScrollableSheet( - initialChildSize: 0.5, - expand: false, - builder: (BuildContext context, ScrollController scrollController) { - return Column( - children: [ - ListTile( - title: Text( - scanDevicesTitle(), - style: Theme.of(context).textTheme.titleLarge, + onTap: () { + plausible.event(page: "Scan For New Gear"); + showModalBottomSheet( + context: context, + showDragHandle: true, + isScrollControlled: true, + enableDrag: true, + isDismissible: true, + builder: (BuildContext context) { + return DraggableScrollableSheet( + initialChildSize: 0.5, + expand: false, + builder: (BuildContext context, ScrollController scrollController) { + return Column( + children: [ + ListTile( + title: Text( + scanDevicesTitle(), + style: Theme.of(context).textTheme.titleLarge, + ), ), - ), - Expanded( - child: ScanForNewDevice( - scrollController: scrollController, + Expanded( + child: ScanForNewDevice( + scrollController: scrollController, + ), ), - ), - ], - ); - }, - ); - }, - ); - }, - ),); + ], + ); + }, + ); + }, + ); + }, + ), + ); } } diff --git a/lib/Frontend/Widgets/scan_for_new_device.dart b/lib/Frontend/Widgets/scan_for_new_device.dart index f442fb3d..6b4d7649 100644 --- a/lib/Frontend/Widgets/scan_for_new_device.dart +++ b/lib/Frontend/Widgets/scan_for_new_device.dart @@ -12,7 +12,7 @@ import '../../Backend/device_registry.dart'; import '../../constants.dart'; import '../../gen/assets.gen.dart'; import '../../main.dart'; -import '../intn_defs.dart'; +import '../translation_string_definitions.dart'; import 'lottie_lazy_load.dart'; class ScanForNewDevice extends ConsumerStatefulWidget { diff --git a/lib/Frontend/Widgets/speed_widget.dart b/lib/Frontend/Widgets/speed_widget.dart index daadd0c9..352c17ed 100644 --- a/lib/Frontend/Widgets/speed_widget.dart +++ b/lib/Frontend/Widgets/speed_widget.dart @@ -1,6 +1,6 @@ import 'package:flutter/material.dart'; -import '../intn_defs.dart'; +import '../translation_string_definitions.dart'; class SpeedWidget extends StatelessWidget { const SpeedWidget({super.key, required this.value, required this.onChanged}); diff --git a/lib/Frontend/Widgets/trigger_select.dart b/lib/Frontend/Widgets/trigger_select.dart index 9a44309c..19c0d1e2 100644 --- a/lib/Frontend/Widgets/trigger_select.dart +++ b/lib/Frontend/Widgets/trigger_select.dart @@ -3,7 +3,7 @@ import 'package:flutter/material.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; import '../../Backend/sensors.dart'; -import '../intn_defs.dart'; +import '../translation_string_definitions.dart'; class TriggerSelect extends ConsumerStatefulWidget { const TriggerSelect({super.key}); diff --git a/lib/Frontend/pages/action_selector.dart b/lib/Frontend/pages/action_selector.dart index 536b7fd7..2e7c1525 100644 --- a/lib/Frontend/pages/action_selector.dart +++ b/lib/Frontend/pages/action_selector.dart @@ -6,7 +6,7 @@ import 'package:tail_app/constants.dart'; import '../../Backend/Definitions/Action/base_action.dart'; import '../../Backend/Definitions/Device/device_definition.dart'; import '../../Backend/action_registry.dart'; -import '../intn_defs.dart'; +import '../translation_string_definitions.dart'; class ActionSelectorInfo { final Set deviceType; diff --git a/lib/Frontend/pages/actions.dart b/lib/Frontend/pages/actions.dart index e5a57290..076325ae 100644 --- a/lib/Frontend/pages/actions.dart +++ b/lib/Frontend/pages/actions.dart @@ -17,7 +17,7 @@ import '../../Backend/device_registry.dart'; import '../../Backend/move_lists.dart'; import '../../constants.dart'; import '../Widgets/tutorial_card.dart'; -import '../intn_defs.dart'; +import '../translation_string_definitions.dart'; import 'home.dart'; class ActionPage extends ConsumerWidget { diff --git a/lib/Frontend/pages/custom_audio.dart b/lib/Frontend/pages/custom_audio.dart index 89fed335..95b1fec3 100644 --- a/lib/Frontend/pages/custom_audio.dart +++ b/lib/Frontend/pages/custom_audio.dart @@ -10,7 +10,7 @@ import 'package:tail_app/Backend/audio.dart'; import 'package:uuid/uuid.dart'; import '../Widgets/tutorial_card.dart'; -import '../intn_defs.dart'; +import '../translation_string_definitions.dart'; final Logger _audioLogger = Logger('Audio'); diff --git a/lib/Frontend/pages/direct_gear_control.dart b/lib/Frontend/pages/direct_gear_control.dart index 6c2b734a..5dbb4333 100644 --- a/lib/Frontend/pages/direct_gear_control.dart +++ b/lib/Frontend/pages/direct_gear_control.dart @@ -14,7 +14,7 @@ import '../../Backend/Definitions/Device/device_definition.dart'; import '../../Backend/move_lists.dart'; import '../../constants.dart'; import '../Widgets/device_type_widget.dart'; -import '../intn_defs.dart'; +import '../translation_string_definitions.dart'; class DirectGearControl extends ConsumerStatefulWidget { const DirectGearControl({super.key}); diff --git a/lib/Frontend/pages/home.dart b/lib/Frontend/pages/home.dart index 74ac3886..adba4848 100644 --- a/lib/Frontend/pages/home.dart +++ b/lib/Frontend/pages/home.dart @@ -12,7 +12,7 @@ import 'package:tail_app/constants.dart'; import 'package:url_launcher/url_launcher.dart'; import '../Widgets/tail_blog.dart'; -import '../intn_defs.dart'; +import '../translation_string_definitions.dart'; import 'markdown_viewer.dart'; final log.Logger homeLogger = log.Logger('Home'); diff --git a/lib/Frontend/pages/intro.dart b/lib/Frontend/pages/intro.dart index ce6cce3e..2e74e632 100644 --- a/lib/Frontend/pages/intro.dart +++ b/lib/Frontend/pages/intro.dart @@ -7,7 +7,7 @@ import 'package:introduction_screen/introduction_screen.dart'; import 'package:sentry_hive/sentry_hive.dart'; import 'package:tail_app/Backend/Bluetooth/bluetooth_manager_plus.dart'; import 'package:tail_app/Frontend/Widgets/lottie_lazy_load.dart'; -import 'package:tail_app/Frontend/intn_defs.dart'; +import 'package:tail_app/Frontend/translation_string_definitions.dart'; import 'package:url_launcher/url_launcher.dart'; import '../../constants.dart'; diff --git a/lib/Frontend/pages/more.dart b/lib/Frontend/pages/more.dart index 72437154..0f1c70d4 100644 --- a/lib/Frontend/pages/more.dart +++ b/lib/Frontend/pages/more.dart @@ -10,8 +10,8 @@ import 'package:package_info_plus/package_info_plus.dart'; import 'package:path_provider/path_provider.dart'; import 'package:sentry_flutter/sentry_flutter.dart'; import 'package:sentry_hive/sentry_hive.dart'; -import 'package:tail_app/Frontend/intn_defs.dart'; import 'package:tail_app/Frontend/pages/markdown_viewer.dart'; +import 'package:tail_app/Frontend/translation_string_definitions.dart'; import 'package:url_launcher/url_launcher.dart'; import '../../constants.dart'; diff --git a/lib/Frontend/pages/move_list.dart b/lib/Frontend/pages/move_list.dart index fc2ab187..c0f9d5ff 100644 --- a/lib/Frontend/pages/move_list.dart +++ b/lib/Frontend/pages/move_list.dart @@ -16,7 +16,7 @@ import '../../constants.dart'; import '../../main.dart'; import '../Widgets/device_type_widget.dart'; import '../Widgets/tutorial_card.dart'; -import '../intn_defs.dart'; +import '../translation_string_definitions.dart'; class MoveListView extends ConsumerStatefulWidget { const MoveListView({super.key}); diff --git a/lib/Frontend/pages/ota_update.dart b/lib/Frontend/pages/ota_update.dart index 29f0fb0d..b4107968 100644 --- a/lib/Frontend/pages/ota_update.dart +++ b/lib/Frontend/pages/ota_update.dart @@ -22,7 +22,7 @@ import '../../constants.dart'; import '../../gen/assets.gen.dart'; import '../../main.dart'; import '../Widgets/lottie_lazy_load.dart'; -import '../intn_defs.dart'; +import '../translation_string_definitions.dart'; import '../utils.dart'; class OtaUpdate extends ConsumerStatefulWidget { @@ -358,7 +358,7 @@ class _OtaUpdateState extends ConsumerState { if (chunk.isNotEmpty) { try { _otaLogger.info("Updating $uploadProgress"); - if (current > 0){ + if (current > 0) { timeRemainingMS = Duration(milliseconds: ((timeToUpdate.elapsedMilliseconds / current) * (total - current)).toInt()); } diff --git a/lib/Frontend/pages/settings.dart b/lib/Frontend/pages/settings.dart index 67179a1a..506cb66b 100644 --- a/lib/Frontend/pages/settings.dart +++ b/lib/Frontend/pages/settings.dart @@ -9,7 +9,7 @@ import 'package:wakelock_plus/wakelock_plus.dart'; import '../../Backend/Definitions/Device/device_definition.dart'; import '../../constants.dart'; import '../../main.dart'; -import '../intn_defs.dart'; +import '../translation_string_definitions.dart'; class Settings extends ConsumerStatefulWidget { const Settings({super.key}); diff --git a/lib/Frontend/pages/shell.dart b/lib/Frontend/pages/shell.dart index 17c54db2..2e244a1b 100644 --- a/lib/Frontend/pages/shell.dart +++ b/lib/Frontend/pages/shell.dart @@ -21,7 +21,7 @@ import '../../constants.dart'; import '../../main.dart'; import '../Widgets/base_card.dart'; import '../Widgets/known_gear.dart'; -import '../intn_defs.dart'; +import '../translation_string_definitions.dart'; /// Flutter code sample for [NavigationDrawer]. diff --git a/lib/Frontend/pages/triggers.dart b/lib/Frontend/pages/triggers.dart index 9e2b02bd..13e93ae0 100644 --- a/lib/Frontend/pages/triggers.dart +++ b/lib/Frontend/pages/triggers.dart @@ -12,7 +12,7 @@ import '../../constants.dart'; import '../../main.dart'; import '../Widgets/device_type_widget.dart'; import '../Widgets/tutorial_card.dart'; -import '../intn_defs.dart'; +import '../translation_string_definitions.dart'; import 'action_selector.dart'; class Triggers extends ConsumerStatefulWidget { diff --git a/lib/Frontend/intn_defs.dart b/lib/Frontend/translation_string_definitions.dart similarity index 99% rename from lib/Frontend/intn_defs.dart rename to lib/Frontend/translation_string_definitions.dart index f7b2d27d..6c91e335 100644 --- a/lib/Frontend/intn_defs.dart +++ b/lib/Frontend/translation_string_definitions.dart @@ -1,9 +1,9 @@ import 'package:intl/intl.dart'; //generate file for translation. Run when adding new translations -//dart run intl_translation:extract_to_arb --locale=en --output-file='./lib/l10n/messages_en.arb' ./lib/Frontend/intn_defs.dart +//dart run intl_translation:extract_to_arb --locale=en --output-file='./lib/l10n/messages_en.arb' ./lib/Frontend/translation_string_definitions.dart //convert to dart -// dart run intl_translation:generate_from_arb --output-dir=lib/l10n --no-use-deferred-loading lib/Frontend/intn_defs.dart lib/l10n/*.arb +// dart run intl_translation:generate_from_arb --output-dir=lib/l10n --no-use-deferred-loading lib/Frontend/translation_string_definitions.dart lib/l10n/*.arb String title() => Intl.message('The Tail Company', name: 'title', desc: 'The name of the app'); String homeNewsTitle() => Intl.message('Fresh from the Tail Blog', name: 'homeNewsTitle', desc: 'The title header for the news in the home screen when no gear is connected'); diff --git a/lib/main.dart b/lib/main.dart index a7c2b6bb..f1b41dfa 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -32,7 +32,7 @@ import 'Backend/notifications.dart'; import 'Backend/plausible_dio.dart'; import 'Backend/sensors.dart'; import 'Frontend/go_router_config.dart'; -import 'Frontend/intn_defs.dart'; +import 'Frontend/translation_string_definitions.dart'; import 'constants.dart'; import 'l10n/messages_all_locales.dart';