From 9a35b569b977fa74f4b62e343f199ccea0cff534 Mon Sep 17 00:00:00 2001 From: Pierre-Louis <6655696+guidezpl@users.noreply.github.com> Date: Thu, 19 May 2022 11:24:19 +0200 Subject: [PATCH] Use correct time separator for Indonesian locale (#104070) * Update material_id.arb * Update README.md * Update generated_material_localizations.dart * Update README.md * remove trailing whitespace --- .../lib/src/l10n/README.md | 47 ++++++++----------- .../generated_material_localizations.dart | 2 +- .../lib/src/l10n/material_id.arb | 2 +- 3 files changed, 22 insertions(+), 29 deletions(-) diff --git a/packages/flutter_localizations/lib/src/l10n/README.md b/packages/flutter_localizations/lib/src/l10n/README.md index 0146fdfe3c..180d9fb3b8 100644 --- a/packages/flutter_localizations/lib/src/l10n/README.md +++ b/packages/flutter_localizations/lib/src/l10n/README.md @@ -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 @@ -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 -. +. It is converted to an enum value because the `material_en.arb` file has this value labeled as `"x-flutter-type": "icuShortTimePattern"`. @@ -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`. - -You can see what that script would generate by running this command: +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: ```dart -dart dev/tools/localizations/bin/gen_localizations.dart packages/flutter_localizations/lib/src/l10n material +dart dev/tools/localization/bin/gen_localizations.dart ``` -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. +Actually update the generated files with: +```dart +dart dev/tools/localization/bin/gen_localizations.dart --overwrite +``` -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 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 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 diff --git a/packages/flutter_localizations/lib/src/l10n/generated_material_localizations.dart b/packages/flutter_localizations/lib/src/l10n/generated_material_localizations.dart index c97a4ca350..a2e5057f4a 100644 --- a/packages/flutter_localizations/lib/src/l10n/generated_material_localizations.dart +++ b/packages/flutter_localizations/lib/src/l10n/generated_material_localizations.dart @@ -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'; diff --git a/packages/flutter_localizations/lib/src/l10n/material_id.arb b/packages/flutter_localizations/lib/src/l10n/material_id.arb index 640a2c6612..edf3dc1054 100644 --- a/packages/flutter_localizations/lib/src/l10n/material_id.arb +++ b/packages/flutter_localizations/lib/src/l10n/material_id.arb @@ -1,6 +1,6 @@ { "scriptCategory": "English-like", - "timeOfDayFormat": "HH:mm", + "timeOfDayFormat": "HH.mm", "openAppDrawerTooltip": "Buka menu navigasi", "backButtonTooltip": "Kembali", "closeButtonTooltip": "Tutup",