Skip to content

Commit

Permalink
Use correct time separator for Indonesian locale (#104070)
Browse files Browse the repository at this point in the history
* Update material_id.arb

* Update README.md

* Update generated_material_localizations.dart

* Update README.md

* remove trailing whitespace
  • Loading branch information
guidezpl authored May 19, 2022
1 parent 5ae253c commit 9a35b56
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 28 deletions.
45 changes: 19 additions & 26 deletions packages/flutter_localizations/lib/src/l10n/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,7 @@ translation of "CANCEL" which is defined for the `cancelButtonLabel`
resource ID.

Each of the language-specific .arb files contains an entry for
`cancelButtonLabel`. They're all represented by the `Map` in the
generated `localizations.dart` file. The Map is used by the
MaterialLocalizations class.

`cancelButtonLabel`.

### material_en.arb and cupertino_en.arb Define all of the resource IDs

Expand Down Expand Up @@ -143,7 +140,7 @@ The value of `timeOfDayFormat` defines how a time picker displayed by
[showTimePicker()](https://api.flutter.dev/flutter/material/showTimePicker.html)
formats and lays out its time controls. The value of `timeOfDayFormat`
must be a string that matches one of the formats defined by
<https://api.flutter.dev/flutter/material/TimeOfDayFormat-class.html>.
<https://api.flutter.dev/flutter/material/TimeOfDayFormat.html>.
It is converted to an enum value because the `material_en.arb` file
has this value labeled as `"x-flutter-type": "icuShortTimePattern"`.

Expand All @@ -155,36 +152,32 @@ section in the Material spec. The Material theme uses the
[Typography.geometryThemeFor](https://api.flutter.dev/flutter/material/Typography/geometryThemeFor.html).


### 'generated_*_localizations.dart': all of the localizations as a Map
### 'generated_*_localizations.dart': all of the localizations

If you look at the comment at the top of the `generated_material_localizations.dart`
and `generated_cupertino_localizations.dart` files, you'll
see that it was manually generated using a `dev/tools/localizations`
app called `gen_localizations`.
All of the localizations are combined in a single file per library
using the gen_localizations script.

You can see what that script would generate by running this command:
You can see what that script would generate by running:
```dart
dart dev/tools/localization/bin/gen_localizations.dart
```

Actually update the generated files with:
```dart
dart dev/tools/localizations/bin/gen_localizations.dart packages/flutter_localizations/lib/src/l10n material
dart dev/tools/localization/bin/gen_localizations.dart --overwrite
```

The gen_localizations app just combines the contents of all of the
.arb files into a single `Map` per library that has entries for each .arb
file's locale. The `MaterialLocalizations` and `CupertinoLocalizations`
class implementations use these Maps to implement the methods that lookup localized resource values.
The gen_localizations script just combines the contents of all of the
.arb files, each into a class which extends `Global*Localizations`.
The `MaterialLocalizations` and `CupertinoLocalizations`
class implementations use these to lookup localized resource values.

The gen_localizations app must be run by hand after .arb files have
been updated. The app's first parameter is the path to this directory,
the second is the file name prefix (the file name less the locale
The gen_localizations script must be run by hand after .arb files have
been updated. The script optionally takes parameters
1. The path to this directory,
2. The file name prefix (the file name less the locale
suffix) for the .arb files in this directory.

To in-place update the generated localizations file using the default
values, you can just run:

```dart
dart dev/tools/localizations/bin/gen_localizations.dart --overwrite
```


### Special handling for the Kannada (kn) translations

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17733,7 +17733,7 @@ class MaterialLocalizationId extends GlobalMaterialLocalizations {
String get tabLabelRaw => r'Tab $tabIndex dari $tabCount';

@override
TimeOfDayFormat get timeOfDayFormatRaw => TimeOfDayFormat.HH_colon_mm;
TimeOfDayFormat get timeOfDayFormatRaw => TimeOfDayFormat.HH_dot_mm;

@override
String get timePickerDialHelpText => 'PILIH WAKTU';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"scriptCategory": "English-like",
"timeOfDayFormat": "HH:mm",
"timeOfDayFormat": "HH.mm",
"openAppDrawerTooltip": "Buka menu navigasi",
"backButtonTooltip": "Kembali",
"closeButtonTooltip": "Tutup",
Expand Down

0 comments on commit 9a35b56

Please sign in to comment.