docs: instructions for i18n (#138)

This commit is contained in:
Shreyas Thirumalai 2021-01-05 15:00:05 +05:30 committed by GitHub
parent 0a1da29c3e
commit 1bee099191
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 12 additions and 2 deletions

View File

@ -20,8 +20,18 @@ lib
│   └── # File with no prefix: common screens
├── utils
│   ├── # Utilities
└── widgets
└── # Reusable widgets
├── widgets
│ ├── # Reusable widgets
└── l10n
└── # Arb Files (translation mappings)
```
## Adding Translations
- Use the [Flutter Intl](https://marketplace.visualstudio.com/items?itemName=localizely.flutter-intl) extension. See this [demo](https://twitter.com/localizely/status/1255175275454881793) to get a better idea.
- You can find the keywords to be translated in any of the existing `.arb` files. To add a new language, all you have to do is copy the `json` from one of the files and replace the `value` of the `key` with the correct translation. Create the new `.arb` file for the new language using the extension.
- To add a new sentence/phrase to be translated, use the extension and proceed as indicated by the demo. Use of extension is recommended as it adds the sentence/phrase to all the `.arb` files instead of having to add them to every file manually.
Feel free to open an issue to discuss it if you get stuck.