@@ -56,10 +56,7 @@ translation of "CANCEL" which is defined for the `cancelButtonLabel`
56
56
resource ID.
57
57
58
58
Each 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 ` .
63
60
64
61
### material_en.arb and cupertino_en.arb Define all of the resource IDs
65
62
@@ -143,7 +140,7 @@ The value of `timeOfDayFormat` defines how a time picker displayed by
143
140
[ showTimePicker()] ( https://api.flutter.dev/flutter/material/showTimePicker.html )
144
141
formats and lays out its time controls. The value of ` timeOfDayFormat `
145
142
must 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 > .
147
144
It is converted to an enum value because the ` material_en.arb ` file
148
145
has this value labeled as ` "x-flutter-type": "icuShortTimePattern" ` .
149
146
@@ -155,36 +152,32 @@ section in the Material spec. The Material theme uses the
155
152
[ Typography.geometryThemeFor] ( https://api.flutter.dev/flutter/material/Typography/geometryThemeFor.html ) .
156
153
157
154
158
- ### 'generated_ * _ localizations.dart': all of the localizations as a Map
155
+ ### 'generated_ * _ localizations.dart': all of the localizations
159
156
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.
164
159
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
+ ```
166
164
165
+ Actually update the generated files with:
167
166
``` 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
169
168
```
170
169
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.
175
174
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
179
179
suffix) for the .arb files in this directory.
180
180
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
-
188
181
189
182
### Special handling for the Kannada (kn) translations
190
183
0 commit comments