@@ -56,10 +56,7 @@ translation of "CANCEL" which is defined for the `cancelButtonLabel`
5656resource ID.
5757
5858Each of the language-specific .arb files contains an entry for
59- ` cancelButtonLabel ` . They're all represented by the ` Map ` in the
60- generated ` localizations.dart ` file. The Map is used by the
61- MaterialLocalizations class.
62-
59+ ` cancelButtonLabel ` .
6360
6461### material_en.arb and cupertino_en.arb Define all of the resource IDs
6562
@@ -143,7 +140,7 @@ The value of `timeOfDayFormat` defines how a time picker displayed by
143140[ showTimePicker()] ( https://api.flutter.dev/flutter/material/showTimePicker.html )
144141formats and lays out its time controls. The value of ` timeOfDayFormat `
145142must be a string that matches one of the formats defined by
146- < https://api.flutter.dev/flutter/material/TimeOfDayFormat-class .html > .
143+ < https://api.flutter.dev/flutter/material/TimeOfDayFormat.html > .
147144It is converted to an enum value because the ` material_en.arb ` file
148145has this value labeled as ` "x-flutter-type": "icuShortTimePattern" ` .
149146
@@ -155,36 +152,32 @@ section in the Material spec. The Material theme uses the
155152[ Typography.geometryThemeFor] ( https://api.flutter.dev/flutter/material/Typography/geometryThemeFor.html ) .
156153
157154
158- ### 'generated_ * _ localizations.dart': all of the localizations as a Map
155+ ### 'generated_ * _ localizations.dart': all of the localizations
159156
160- If you look at the comment at the top of the ` generated_material_localizations.dart `
161- and ` generated_cupertino_localizations.dart ` files, you'll
162- see that it was manually generated using a ` dev/tools/localizations `
163- app called ` gen_localizations ` .
157+ All of the localizations are combined in a single file per library
158+ using the gen_localizations script.
164159
165- You can see what that script would generate by running this command:
160+ You can see what that script would generate by running:
161+ ``` dart
162+ dart dev/tools/localization/bin/gen_localizations.dart
163+ ```
166164
165+ Actually update the generated files with:
167166``` dart
168- dart dev/tools/localizations /bin/gen_localizations.dart packages/flutter_localizations/lib/src/l10n material
167+ dart dev/tools/localization /bin/gen_localizations.dart --overwrite
169168```
170169
171- The gen_localizations app just combines the contents of all of the
172- .arb files into a single ` Map ` per library that has entries for each .arb
173- file's locale. The ` MaterialLocalizations ` and ` CupertinoLocalizations `
174- class implementations use these Maps to implement the methods that lookup localized resource values.
170+ The gen_localizations script just combines the contents of all of the
171+ .arb files, each into a class which extends ` Global*Localizations ` .
172+ The ` MaterialLocalizations ` and ` CupertinoLocalizations `
173+ class implementations use these to lookup localized resource values.
175174
176- The gen_localizations app must be run by hand after .arb files have
177- been updated. The app's first parameter is the path to this directory,
178- the second is the file name prefix (the file name less the locale
175+ The gen_localizations script must be run by hand after .arb files have
176+ been updated. The script optionally takes parameters
177+ 1 . The path to this directory,
178+ 2 . The file name prefix (the file name less the locale
179179suffix) for the .arb files in this directory.
180180
181- To in-place update the generated localizations file using the default
182- values, you can just run:
183-
184- ``` dart
185- dart dev/tools/localizations/bin/gen_localizations.dart --overwrite
186- ```
187-
188181
189182### Special handling for the Kannada (kn) translations
190183
0 commit comments