regenerate.md 1.03 KB
Newer Older
1
# Regenerating the i18n files
2

3 4 5 6
The files in this directory are used to generate `stock_strings.dart`,
which contains the `StockStrings` class. This localizations class is
used by the stocks application to look up localized message strings.
The stocks app uses the [Dart `intl` package](https://github.com/dart-lang/intl).
7

8 9
To update the English and Spanish localizations, modify the
`stocks_en_US.arb`, `stocks_en.arb`, or `stocks_es.arb` files. See the
10
[ARB specification](https://github.com/google/app-resource-bundle/wiki/ApplicationResourceBundleSpecification)
11
for more info.
12

13 14
To modify the project's configuration of the localizations tool,
change the `l10n.yaml` file.
15

16 17
The `StockStrings` class creates a delegate that performs message lookups
based on the locale of the device. In this case, the stocks app supports
18 19
`en`, `en_US`, and `es` locales. Thus, the `StockStringsEn` and
`StockStringsEs` classes extends `StockStrings`. `StockStringsEnUs` extends
20
`StockStringsEn`. This allows `StockStringsEnUs` to fall back on messages
21
in `StockStringsEn`.