Skip to content

Commit

Permalink
docs: add localization section to new CONTRIBUTING.md
Browse files Browse the repository at this point in the history
  • Loading branch information
maelchiotti committed Apr 9, 2024
1 parent 4281a8f commit 71fda17
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 2 deletions.
10 changes: 10 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# Contributing

## Localization

In order to improve or add support for a language, please follow these steps:

- Localized strings can be found in two different places:
- The `app_XX.arb` file located in [`lib/l10n`](lib/l10n) (where `XX` corresponds to the language code), that contains the vast majority of all strings. Please make sure that you do not localize any parameter name (ex: `{parameter}`) and that you do escape single quotes (ex: `I''m ok` instead of `I'm ok`).
- The [`harcoded_localizations.dart`](lib/l10n/harcoded_localizations.dart), that contains a few specific strings that need to be hardcoded.
- Localized strings can be generated with the `flutter gen-l10n` command. Check that the [`unstranslated.txt`](lib/l10n/untranslated.txt) file is empty, otherwise it will indicate which strings you did not translate.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ See more screenshots [here](assets/screenshots).
- French
- Turkish

To improve or add a language, please see [CONTRIBUTING.md](CONTRIBUTING.md).
To improve or add support for a language, please see [CONTRIBUTING.md](CONTRIBUTING.md#localization).

## Credits

Expand Down
2 changes: 1 addition & 1 deletion lib/l10n/harcoded_localizations.dart
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import 'package:localmaterialnotes/utils/locale_manager.dart';
/// App name.
const _appName = 'Material Notes';

/// List of supported localizations.
/// All supported localizations.
enum SupportedLocalizations {
english(Locale('en')),
french(Locale('fr')),
Expand Down

0 comments on commit 71fda17

Please sign in to comment.