Skip to content

Commit

Permalink
docs(README): add important links
Browse files Browse the repository at this point in the history
  • Loading branch information
thisissandipp committed Aug 3, 2024
1 parent a5cb56b commit 51bf2d8
Showing 1 changed file with 11 additions and 106 deletions.
117 changes: 11 additions & 106 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.

---

Expand All @@ -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._

---

Expand Down Expand Up @@ -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
...

<key>CFBundleLocalizations</key>
<array>
<string>en</string>
<string>es</string>
</array>

...
```

### 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]

Check warning on line 66 in README.md

View workflow job for this annotation

GitHub Actions / spell-check / build

Unknown word (Bizzotto)
- Gradle Error:Execution failed for task ':app:processDebugGoogleServices' - [Stackoverflow Answer][gradle_error_google_services]

Check warning on line 67 in README.md

View workflow job for this annotation

GitHub Actions / spell-check / build

Unknown word (Stackoverflow)
- 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
Expand All @@ -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

0 comments on commit 51bf2d8

Please sign in to comment.