From 51bf2d85fc83619bbc9d18f2c04955b2f9a8eb31 Mon Sep 17 00:00:00 2001 From: Sandip Date: Sun, 4 Aug 2024 00:52:01 +0530 Subject: [PATCH] docs(README): add important links --- README.md | 117 +++++------------------------------------------------- 1 file changed, 11 insertions(+), 106 deletions(-) diff --git a/README.md b/README.md index d663500..5424cc3 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,7 @@ Generated by the [Very Good CLI][very_good_cli_link] πŸ€– -A Sudoku game made with Flutter, and integrated with Gemini +A Sudoku game made with Flutter, and integrated with Gemini. --- @@ -31,7 +31,7 @@ $ flutter run --flavor staging --target lib/main_staging.dart $ flutter run --flavor production --target lib/main_production.dart ``` -_\*Sudoku works on iOS, Android, Web, and Windows._ +_\*Sudoku works on iOS, Android, and Web._ --- @@ -59,112 +59,13 @@ $ open coverage/index.html This project relies on [flutter_localizations][flutter_localizations_link] and follows the [official internationalization guide for Flutter][internationalization_link]. -### Adding Strings +For more details on how to add strings, supported locales, and translations into the app, read the [VGV Documentation][very_good_localizations]. -1. To add a new localizable string, open the `app_en.arb` file at `lib/l10n/arb/app_en.arb`. +## Important Links πŸ”— -```arb -{ - "@@locale": "en", - "counterAppBarTitle": "Counter", - "@counterAppBarTitle": { - "description": "Text shown in the AppBar of the Counter Page" - } -} -``` - -2. Then add a new key/value and description - -```arb -{ - "@@locale": "en", - "counterAppBarTitle": "Counter", - "@counterAppBarTitle": { - "description": "Text shown in the AppBar of the Counter Page" - }, - "helloWorld": "Hello World", - "@helloWorld": { - "description": "Hello World Text" - } -} -``` - -3. Use the new string - -```dart -import 'package:sudoku/l10n/l10n.dart'; - -@override -Widget build(BuildContext context) { - final l10n = context.l10n; - return Text(l10n.helloWorld); -} -``` - -### Adding Supported Locales - -Update the `CFBundleLocalizations` array in the `Info.plist` at `ios/Runner/Info.plist` to include the new locale. - -```xml - ... - - CFBundleLocalizations - - en - es - - - ... -``` - -### Adding Translations - -1. For each supported locale, add a new ARB file in `lib/l10n/arb`. - -``` -β”œβ”€β”€ l10n -β”‚ β”œβ”€β”€ arb -β”‚ β”‚ β”œβ”€β”€ app_en.arb -β”‚ β”‚ └── app_es.arb -``` - -2. Add the translated strings to each `.arb` file: - -`app_en.arb` - -```arb -{ - "@@locale": "en", - "counterAppBarTitle": "Counter", - "@counterAppBarTitle": { - "description": "Text shown in the AppBar of the Counter Page" - } -} -``` - -`app_es.arb` - -```arb -{ - "@@locale": "es", - "counterAppBarTitle": "Contador", - "@counterAppBarTitle": { - "description": "Texto mostrado en la AppBar de la pΓ‘gina del contador" - } -} -``` - -### Generating Translations - -To use the latest translations changes, you will need to generate them: - -1. Generate localizations for the current project: - -```sh -flutter gen-l10n --arb-dir="lib/l10n/arb" -``` - -Alternatively, run `flutter run` and code generation will take place automatically. +- Flutter Flavors Setup with multiple Firebase Environments using FlutterFire - [Article from Andrea Bizzotto][flavours_flutterfire] +- Gradle Error:Execution failed for task ':app:processDebugGoogleServices' - [Stackoverflow Answer][gradle_error_google_services] +- Execution failed for task ':app:checkDebugDuplicateClasses' - [Flutter GiHub Issue][debug_duplicate_classes] [coverage_badge]: coverage_badge.svg [flutter_localizations_link]: https://api.flutter.dev/flutter/flutter_localizations/flutter_localizations-library.html @@ -174,3 +75,7 @@ Alternatively, run `flutter run` and code generation will take place automatical [very_good_analysis_badge]: https://img.shields.io/badge/style-very_good_analysis-B22C89.svg [very_good_analysis_link]: https://pub.dev/packages/very_good_analysis [very_good_cli_link]: https://github.com/VeryGoodOpenSource/very_good_cli +[very_good_localizations]: https://cli.vgv.dev/docs/templates/core#working-with-translations- +[flavours_flutterfire]: https://codewithandrea.com/articles/flutter-flavors-for-firebase-apps/ +[gradle_error_google_services]: https://stackoverflow.com/questions/33572465/gradle-errorexecution-failed-for-task-appprocessdebuggoogleservices +[debug_duplicate_classes]: https://github.com/flutter/flutter/issues/119247#issuecomment-1405825291