Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
minikin committed Nov 21, 2023
1 parent 0b21427 commit 0add6e3
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 7 deletions.
2 changes: 1 addition & 1 deletion catalyst_voices/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,4 +75,4 @@ genhtml coverage/lcov.info -o coverage/

# Open Coverage Report
open coverage/index.html
```
```
30 changes: 26 additions & 4 deletions catalyst_voices/packages/catalyst_voices_localization/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,39 @@ This package contains the localization files for the Catalyst Voices app.

* [Catalyst Voices Localization](#catalyst-voices-localization)
* [Working with Translations](#working-with-translations)
* [Creating New Locale Messages](#creating-new-locale-messages)
* [Generating VoicesLocalizations](#generating-voiceslocalizations)
* [Adding Strings](#adding-strings)
* [Adding Supported Locales](#adding-supported-locales)
* [Adding Translations](#adding-translations)

## Working with Translations

This project relies on [flutter_localizations](https://github.com/flutter/flutter/tree/master/packages/flutter_localizations).
It follows the [official internationalization guide for Flutter][flutter-intl-guide].
It follows the
[official internationalization guide for Flutter](https://docs.flutter.dev/development/accessibility-and-localization/internationalization).

## Creating New Locale Messages

To add new strings for localization, modify `intl_en.arb`,
which this project uses as its template.

New entries must adhere to the format below:

```arb
"dartGetterVariableName": "english translation of the message",
"@dartGetterVariableName": {
"description": "description for use by the localizations delegate."
},
```

Here, `dartGetterVariableName` represents the Dart method/property name utilized in your localizations delegate.

Once you've updated `intl_en.arb` with the new message, regenerate the `VoicesLocalizations` delegate to enable
immediate use of the English message in your application code through the localizations delegate,
bypassing the need to wait for translation completion.

## Generating VoicesLocalizations

### Adding Strings

Expand Down Expand Up @@ -113,6 +138,3 @@ Update the `CFBundleLocalizations` array in the `Info.plist` at `ios/Runner/Info
```shell
flutter gen-l10n
```


[flutter-intl-guide]: https://docs.flutter.dev/development/accessibility-and-localization/internationalization
5 changes: 3 additions & 2 deletions cspell.json
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@
//.config/dictionaries/cspell/sv/cspell-ext.json
//.config/dictionaries/cspell/tr_TR/cspell-ext.json
//.config/dictionaries/cspell/uk_UA/cspell-ext.json
//.config/dictionaries/cspell/vi_VN/cspell-ext.json
//.config/dictionaries/cspell/vi_VN/cspell-ext.json
],
"ignorePaths": [
".config/dictionaries/**",
Expand All @@ -233,6 +233,7 @@
"**/historic_data/**/*.json",
"**/test_data/**/*.sql",
"styles.min.css",
"web-components.min.js"
"web-components.min.js",
"**/generated/**"
]
}

0 comments on commit 0add6e3

Please sign in to comment.