Unverified Commit c36b75e4 authored by Shi-Hao Hong's avatar Shi-Hao Hong Committed by GitHub

Remove Special Handling of Norwegian Locales (#63034)

* Regenerate _no.arb and _nb.arb from scratch

* Revert no <--> nb synonym logic
parent 787e567d
...@@ -173,13 +173,6 @@ Set<String> _supportedLocales() { ...@@ -173,13 +173,6 @@ Set<String> _supportedLocales() {
supportedLocales.add(filenameRE.firstMatch(filePath)[1]); supportedLocales.add(filenameRE.firstMatch(filePath)[1]);
} }
// See https://github.com/flutter/flutter/issues/53036 for context on why
// 'no' is being used as a synonym for 'nb'. It only uses this synonym
// if 'nb' is not detected as a valid arb file.
if (supportedLocales.contains('no') && !supportedLocales.contains('nb')) {
supportedLocales.add('nb');
}
return supportedLocales; return supportedLocales;
} }
......
...@@ -78,11 +78,6 @@ String generateArbBasedLocalizationSubclasses({ ...@@ -78,11 +78,6 @@ String generateArbBasedLocalizationSubclasses({
assert(supportedLanguagesConstant.isNotEmpty); assert(supportedLanguagesConstant.isNotEmpty);
assert(supportedLanguagesDocMacro.isNotEmpty); assert(supportedLanguagesDocMacro.isNotEmpty);
// See https://github.com/flutter/flutter/issues/53036 for context on why
// 'no' is being used as a synonym for 'nb'. It only uses this synonym
// if 'nb' is not detected as a valid arb file.
bool isNbSynonymOfNo = false;
final StringBuffer output = StringBuffer(); final StringBuffer output = StringBuffer();
output.writeln(generateHeader('dart dev/tools/localization/bin/gen_localizations.dart --overwrite')); output.writeln(generateHeader('dart dev/tools/localization/bin/gen_localizations.dart --overwrite'));
...@@ -108,12 +103,6 @@ String generateArbBasedLocalizationSubclasses({ ...@@ -108,12 +103,6 @@ String generateArbBasedLocalizationSubclasses({
allResourceIdentifiers.addAll(localeToResources[locale].keys.toList()..sort()); allResourceIdentifiers.addAll(localeToResources[locale].keys.toList()..sort());
} }
if (languageToLocales['no'] != null && languageToLocales['nb'] == null) {
languageToLocales['nb'] ??= <LocaleInfo>[];
languageToLocales['nb'].add(LocaleInfo.fromString('nb'));
isNbSynonymOfNo = true;
}
// We generate one class per supported language (e.g. // We generate one class per supported language (e.g.
// `MaterialLocalizationEn`). These implement everything that is needed by the // `MaterialLocalizationEn`). These implement everything that is needed by the
// superclass (e.g. GlobalMaterialLocalizations). // superclass (e.g. GlobalMaterialLocalizations).
...@@ -144,21 +133,6 @@ String generateArbBasedLocalizationSubclasses({ ...@@ -144,21 +133,6 @@ String generateArbBasedLocalizationSubclasses({
for (final String languageName in languageCodes) { for (final String languageName in languageCodes) {
final LocaleInfo languageLocale = LocaleInfo.fromString(languageName); final LocaleInfo languageLocale = LocaleInfo.fromString(languageName);
// See https://github.com/flutter/flutter/issues/53036 for context on why
// 'no' is being used as a synonym for 'nb'. It only uses this synonym
// if 'nb' is not detected as a valid arb file.
if (languageName == 'nb' && isNbSynonymOfNo) {
output.writeln(generateClassDeclaration(
languageLocale,
generatedClassPrefix,
'${generatedClassPrefix}No'),
);
output.writeln(generateConstructor(languageLocale));
output.writeln('}');
supportedLocales.writeln('/// * `$languageName` - ${describeLocale(languageName)}, which, in this library, is a synonym of `no`');
continue;
}
output.writeln(generateClassDeclaration(languageLocale, generatedClassPrefix, baseClass)); output.writeln(generateClassDeclaration(languageLocale, generatedClassPrefix, baseClass));
output.writeln(generateConstructor(languageLocale)); output.writeln(generateConstructor(languageLocale));
......
{
"datePickerHourSemanticsLabelOne": "$hour null-null",
"datePickerHourSemanticsLabelOther": "$hour null-null",
"datePickerMinuteSemanticsLabelOne": "1 minutt",
"datePickerMinuteSemanticsLabelOther": "$minute minutter",
"datePickerDateOrder": "dmy",
"datePickerDateTimeOrder": "date_time_dayPeriod",
"anteMeridiemAbbreviation": "AM",
"postMeridiemAbbreviation": "PM",
"todayLabel": "I dag",
"alertDialogLabel": "Varsel",
"tabSemanticsLabel": "Fane $tabIndex av $tabCount",
"timerPickerHourLabelOne": "time",
"timerPickerHourLabelOther": "timer",
"timerPickerMinuteLabelOne": "min.",
"timerPickerMinuteLabelOther": "min.",
"timerPickerSecondLabelOne": "sek.",
"timerPickerSecondLabelOther": "sek.",
"cutButtonLabel": "Klipp ut",
"copyButtonLabel": "Kopiér",
"pasteButtonLabel": "Lim inn",
"selectAllButtonLabel": "Velg alle",
"modalBarrierDismissLabel": "Avvis"
}
...@@ -9,6 +9,7 @@ ...@@ -9,6 +9,7 @@
"postMeridiemAbbreviation": "PM", "postMeridiemAbbreviation": "PM",
"todayLabel": "I dag", "todayLabel": "I dag",
"alertDialogLabel": "Varsel", "alertDialogLabel": "Varsel",
"tabSemanticsLabel": "Fane $tabIndex av $tabCount",
"timerPickerHourLabelOne": "time", "timerPickerHourLabelOne": "time",
"timerPickerHourLabelOther": "timer", "timerPickerHourLabelOther": "timer",
"timerPickerMinuteLabelOne": "min.", "timerPickerMinuteLabelOne": "min.",
...@@ -19,6 +20,5 @@ ...@@ -19,6 +20,5 @@
"copyButtonLabel": "Kopiér", "copyButtonLabel": "Kopiér",
"pasteButtonLabel": "Lim inn", "pasteButtonLabel": "Lim inn",
"selectAllButtonLabel": "Velg alle", "selectAllButtonLabel": "Velg alle",
"tabSemanticsLabel": "Fane $tabIndex av $tabCount",
"modalBarrierDismissLabel": "Avvis" "modalBarrierDismissLabel": "Avvis"
} }
...@@ -8783,7 +8783,7 @@ class CupertinoLocalizationMy extends GlobalCupertinoLocalizations { ...@@ -8783,7 +8783,7 @@ class CupertinoLocalizationMy extends GlobalCupertinoLocalizations {
} }
/// The translations for Norwegian Bokmål (`nb`). /// The translations for Norwegian Bokmål (`nb`).
class CupertinoLocalizationNb extends CupertinoLocalizationNo { class CupertinoLocalizationNb extends GlobalCupertinoLocalizations {
/// Create an instance of the translation bundle for Norwegian Bokmål. /// Create an instance of the translation bundle for Norwegian Bokmål.
/// ///
/// For details on the meaning of the arguments, see [GlobalCupertinoLocalizations]. /// For details on the meaning of the arguments, see [GlobalCupertinoLocalizations].
...@@ -8808,6 +8808,132 @@ class CupertinoLocalizationNb extends CupertinoLocalizationNo { ...@@ -8808,6 +8808,132 @@ class CupertinoLocalizationNb extends CupertinoLocalizationNo {
singleDigitSecondFormat: singleDigitSecondFormat, singleDigitSecondFormat: singleDigitSecondFormat,
decimalFormat: decimalFormat, decimalFormat: decimalFormat,
); );
@override
String get alertDialogLabel => 'Varsel';
@override
String get anteMeridiemAbbreviation => 'AM';
@override
String get copyButtonLabel => 'Kopiér';
@override
String get cutButtonLabel => 'Klipp ut';
@override
String get datePickerDateOrderString => 'dmy';
@override
String get datePickerDateTimeOrderString => 'date_time_dayPeriod';
@override
String get datePickerHourSemanticsLabelFew => null;
@override
String get datePickerHourSemanticsLabelMany => null;
@override
String get datePickerHourSemanticsLabelOne => '\$hour null-null';
@override
String get datePickerHourSemanticsLabelOther => '\$hour null-null';
@override
String get datePickerHourSemanticsLabelTwo => null;
@override
String get datePickerHourSemanticsLabelZero => null;
@override
String get datePickerMinuteSemanticsLabelFew => null;
@override
String get datePickerMinuteSemanticsLabelMany => null;
@override
String get datePickerMinuteSemanticsLabelOne => '1 minutt';
@override
String get datePickerMinuteSemanticsLabelOther => '\$minute minutter';
@override
String get datePickerMinuteSemanticsLabelTwo => null;
@override
String get datePickerMinuteSemanticsLabelZero => null;
@override
String get modalBarrierDismissLabel => 'Avvis';
@override
String get pasteButtonLabel => 'Lim inn';
@override
String get postMeridiemAbbreviation => 'PM';
@override
String get selectAllButtonLabel => 'Velg alle';
@override
String get tabSemanticsLabelRaw => 'Fane \$tabIndex av \$tabCount';
@override
String get timerPickerHourLabelFew => null;
@override
String get timerPickerHourLabelMany => null;
@override
String get timerPickerHourLabelOne => 'time';
@override
String get timerPickerHourLabelOther => 'timer';
@override
String get timerPickerHourLabelTwo => null;
@override
String get timerPickerHourLabelZero => null;
@override
String get timerPickerMinuteLabelFew => null;
@override
String get timerPickerMinuteLabelMany => null;
@override
String get timerPickerMinuteLabelOne => 'min.';
@override
String get timerPickerMinuteLabelOther => 'min.';
@override
String get timerPickerMinuteLabelTwo => null;
@override
String get timerPickerMinuteLabelZero => null;
@override
String get timerPickerSecondLabelFew => null;
@override
String get timerPickerSecondLabelMany => null;
@override
String get timerPickerSecondLabelOne => 'sek.';
@override
String get timerPickerSecondLabelOther => 'sek.';
@override
String get timerPickerSecondLabelTwo => null;
@override
String get timerPickerSecondLabelZero => null;
@override
String get todayLabel => 'I dag';
} }
/// The translations for Nepali (`ne`). /// The translations for Nepali (`ne`).
...@@ -13479,7 +13605,7 @@ final Set<String> kCupertinoSupportedLanguages = HashSet<String>.from(const <Str ...@@ -13479,7 +13605,7 @@ final Set<String> kCupertinoSupportedLanguages = HashSet<String>.from(const <Str
/// * `mr` - Marathi /// * `mr` - Marathi
/// * `ms` - Malay /// * `ms` - Malay
/// * `my` - Burmese /// * `my` - Burmese
/// * `nb` - Norwegian Bokmål, which, in this library, is a synonym of `no` /// * `nb` - Norwegian Bokmål
/// * `ne` - Nepali /// * `ne` - Nepali
/// * `nl` - Dutch Flemish /// * `nl` - Dutch Flemish
/// * `no` - Norwegian /// * `no` - Norwegian
...@@ -13693,6 +13819,8 @@ GlobalCupertinoLocalizations getCupertinoTranslation( ...@@ -13693,6 +13819,8 @@ GlobalCupertinoLocalizations getCupertinoTranslation(
return CupertinoLocalizationMs(fullYearFormat: fullYearFormat, dayFormat: dayFormat, mediumDateFormat: mediumDateFormat, singleDigitHourFormat: singleDigitHourFormat, singleDigitMinuteFormat: singleDigitMinuteFormat, doubleDigitMinuteFormat: doubleDigitMinuteFormat, singleDigitSecondFormat: singleDigitSecondFormat, decimalFormat: decimalFormat); return CupertinoLocalizationMs(fullYearFormat: fullYearFormat, dayFormat: dayFormat, mediumDateFormat: mediumDateFormat, singleDigitHourFormat: singleDigitHourFormat, singleDigitMinuteFormat: singleDigitMinuteFormat, doubleDigitMinuteFormat: doubleDigitMinuteFormat, singleDigitSecondFormat: singleDigitSecondFormat, decimalFormat: decimalFormat);
case 'my': case 'my':
return CupertinoLocalizationMy(fullYearFormat: fullYearFormat, dayFormat: dayFormat, mediumDateFormat: mediumDateFormat, singleDigitHourFormat: singleDigitHourFormat, singleDigitMinuteFormat: singleDigitMinuteFormat, doubleDigitMinuteFormat: doubleDigitMinuteFormat, singleDigitSecondFormat: singleDigitSecondFormat, decimalFormat: decimalFormat); return CupertinoLocalizationMy(fullYearFormat: fullYearFormat, dayFormat: dayFormat, mediumDateFormat: mediumDateFormat, singleDigitHourFormat: singleDigitHourFormat, singleDigitMinuteFormat: singleDigitMinuteFormat, doubleDigitMinuteFormat: doubleDigitMinuteFormat, singleDigitSecondFormat: singleDigitSecondFormat, decimalFormat: decimalFormat);
case 'nb':
return CupertinoLocalizationNb(fullYearFormat: fullYearFormat, dayFormat: dayFormat, mediumDateFormat: mediumDateFormat, singleDigitHourFormat: singleDigitHourFormat, singleDigitMinuteFormat: singleDigitMinuteFormat, doubleDigitMinuteFormat: doubleDigitMinuteFormat, singleDigitSecondFormat: singleDigitSecondFormat, decimalFormat: decimalFormat);
case 'ne': case 'ne':
return CupertinoLocalizationNe(fullYearFormat: fullYearFormat, dayFormat: dayFormat, mediumDateFormat: mediumDateFormat, singleDigitHourFormat: singleDigitHourFormat, singleDigitMinuteFormat: singleDigitMinuteFormat, doubleDigitMinuteFormat: doubleDigitMinuteFormat, singleDigitSecondFormat: singleDigitSecondFormat, decimalFormat: decimalFormat); return CupertinoLocalizationNe(fullYearFormat: fullYearFormat, dayFormat: dayFormat, mediumDateFormat: mediumDateFormat, singleDigitHourFormat: singleDigitHourFormat, singleDigitMinuteFormat: singleDigitMinuteFormat, doubleDigitMinuteFormat: doubleDigitMinuteFormat, singleDigitSecondFormat: singleDigitSecondFormat, decimalFormat: decimalFormat);
case 'nl': case 'nl':
...@@ -13782,8 +13910,6 @@ GlobalCupertinoLocalizations getCupertinoTranslation( ...@@ -13782,8 +13910,6 @@ GlobalCupertinoLocalizations getCupertinoTranslation(
} }
case 'zu': case 'zu':
return CupertinoLocalizationZu(fullYearFormat: fullYearFormat, dayFormat: dayFormat, mediumDateFormat: mediumDateFormat, singleDigitHourFormat: singleDigitHourFormat, singleDigitMinuteFormat: singleDigitMinuteFormat, doubleDigitMinuteFormat: doubleDigitMinuteFormat, singleDigitSecondFormat: singleDigitSecondFormat, decimalFormat: decimalFormat); return CupertinoLocalizationZu(fullYearFormat: fullYearFormat, dayFormat: dayFormat, mediumDateFormat: mediumDateFormat, singleDigitHourFormat: singleDigitHourFormat, singleDigitMinuteFormat: singleDigitMinuteFormat, doubleDigitMinuteFormat: doubleDigitMinuteFormat, singleDigitSecondFormat: singleDigitSecondFormat, decimalFormat: decimalFormat);
case 'nb':
return CupertinoLocalizationNb(fullYearFormat: fullYearFormat, dayFormat: dayFormat, mediumDateFormat: mediumDateFormat, singleDigitHourFormat: singleDigitHourFormat, singleDigitMinuteFormat: singleDigitMinuteFormat, doubleDigitMinuteFormat: doubleDigitMinuteFormat, singleDigitSecondFormat: singleDigitSecondFormat, decimalFormat: decimalFormat);
} }
assert(false, 'getCupertinoTranslation() called for unsupported locale "$locale"'); assert(false, 'getCupertinoTranslation() called for unsupported locale "$locale"');
return null; return null;
......
{
"scriptCategory": "English-like",
"timeOfDayFormat": "HH:mm",
"openAppDrawerTooltip": "Åpne navigasjonsmenyen",
"backButtonTooltip": "Tilbake",
"closeButtonTooltip": "Lukk",
"deleteButtonTooltip": "Slett",
"moreButtonTooltip": "Mer",
"nextMonthTooltip": "Neste måned",
"previousMonthTooltip": "Forrige måned",
"nextPageTooltip": "Neste side",
"previousPageTooltip": "Forrige side",
"showMenuTooltip": "Vis meny",
"aboutListTileTitle": "Om $applicationName",
"licensesPageTitle": "Lisenser",
"licensesPackageDetailTextOne": "1 lisens",
"licensesPackageDetailTextOther": "$licenseCount lisenser",
"pageRowsInfoTitle": "$firstRow–$lastRow av $rowCount",
"pageRowsInfoTitleApproximate": "$firstRow–$lastRow av omtrent $rowCount",
"rowsPerPageTitle": "Rader per side:",
"tabLabel": "Fane $tabIndex av $tabCount",
"selectedRowCountTitleOne": "1 element er valgt",
"selectedRowCountTitleOther": "$selectedRowCount elementer er valgt",
"cancelButtonLabel": "AVBRYT",
"closeButtonLabel": "LUKK",
"continueButtonLabel": "FORTSETT",
"copyButtonLabel": "Kopiér",
"cutButtonLabel": "Klipp ut",
"okButtonLabel": "OK",
"pasteButtonLabel": "Lim inn",
"selectAllButtonLabel": "Velg alle",
"viewLicensesButtonLabel": "SE LISENSER",
"anteMeridiemAbbreviation": "AM",
"postMeridiemAbbreviation": "PM",
"timePickerHourModeAnnouncement": "Angi timer",
"timePickerMinuteModeAnnouncement": "Angi minutter",
"modalBarrierDismissLabel": "Avvis",
"dateSeparator": "/",
"dateHelpText": "mm/dd/åååå",
"selectYearSemanticsLabel": "Velg året",
"unspecifiedDate": "Dato",
"unspecifiedDateRange": "Datoperiode",
"dateInputLabel": "Skriv inn datoen",
"dateRangeStartLabel": "Startdato",
"dateRangeEndLabel": "Sluttdato",
"dateRangeStartDateSemanticLabel": "Startdato $fullDate",
"dateRangeEndDateSemanticLabel": "Sluttdato $fullDate",
"invalidDateFormatLabel": "Ugyldig format.",
"invalidDateRangeLabel": "Ugyldig periode.",
"dateOutOfRangeLabel": "Utenfor perioden.",
"saveButtonLabel": "LAGRE",
"datePickerHelpText": "VELG DATOEN",
"dateRangePickerHelpText": "VELG PERIODEN",
"calendarModeButtonLabel": "Bytt til kalender",
"inputDateModeButtonLabel": "Bytt til innskriving",
"timePickerDialHelpText": "VELG KLOKKESLETT",
"timePickerInputHelpText": "ANGI ET KLOKKESLETT",
"timePickerHourLabel": "Time",
"timePickerMinuteLabel": "Minutt",
"invalidTimeLabel": "Angi et gyldig klokkeslett",
"dialModeButtonLabel": "Bytt til modus for valg fra urskive",
"inputTimeModeButtonLabel": "Bytt til tekstinndatamodus",
"signedInLabel": "Pålogget",
"hideAccountsLabel": "Skjul kontoer",
"showAccountsLabel": "Vis kontoer",
"drawerLabel": "Navigasjonsmeny",
"popupMenuLabel": "Forgrunnsmeny",
"dialogLabel": "Dialogboks",
"alertDialogLabel": "Varsel",
"searchFieldLabel": "Søk",
"reorderItemToStart": "Flytt til starten",
"reorderItemToEnd": "Flytt til slutten",
"reorderItemUp": "Flytt opp",
"reorderItemDown": "Flytt ned",
"reorderItemLeft": "Flytt til venstre",
"reorderItemRight": "Flytt til høyre",
"expandedIconTapHint": "Skjul",
"collapsedIconTapHint": "Vis",
"remainingTextFieldCharacterCountOne": "1 tegn gjenstår",
"remainingTextFieldCharacterCountOther": "$remainingCount tegn gjenstår",
"refreshIndicatorSemanticLabel": "Laster inn på nytt"
}
...@@ -13,6 +13,8 @@ ...@@ -13,6 +13,8 @@
"showMenuTooltip": "Vis meny", "showMenuTooltip": "Vis meny",
"aboutListTileTitle": "Om $applicationName", "aboutListTileTitle": "Om $applicationName",
"licensesPageTitle": "Lisenser", "licensesPageTitle": "Lisenser",
"licensesPackageDetailTextOne": "1 lisens",
"licensesPackageDetailTextOther": "$licenseCount lisenser",
"pageRowsInfoTitle": "$firstRow–$lastRow av $rowCount", "pageRowsInfoTitle": "$firstRow–$lastRow av $rowCount",
"pageRowsInfoTitleApproximate": "$firstRow–$lastRow av omtrent $rowCount", "pageRowsInfoTitleApproximate": "$firstRow–$lastRow av omtrent $rowCount",
"rowsPerPageTitle": "Rader per side:", "rowsPerPageTitle": "Rader per side:",
...@@ -33,26 +35,6 @@ ...@@ -33,26 +35,6 @@
"timePickerHourModeAnnouncement": "Angi timer", "timePickerHourModeAnnouncement": "Angi timer",
"timePickerMinuteModeAnnouncement": "Angi minutter", "timePickerMinuteModeAnnouncement": "Angi minutter",
"modalBarrierDismissLabel": "Avvis", "modalBarrierDismissLabel": "Avvis",
"signedInLabel": "Pålogget",
"hideAccountsLabel": "Skjul kontoer",
"showAccountsLabel": "Vis kontoer",
"drawerLabel": "Navigasjonsmeny",
"popupMenuLabel": "Forgrunnsmeny",
"dialogLabel": "Dialogboks",
"alertDialogLabel": "Varsel",
"searchFieldLabel": "Søk",
"reorderItemToStart": "Flytt til starten",
"reorderItemToEnd": "Flytt til slutten",
"reorderItemUp": "Flytt opp",
"reorderItemDown": "Flytt ned",
"reorderItemLeft": "Flytt til venstre",
"reorderItemRight": "Flytt til høyre",
"expandedIconTapHint": "Skjul",
"collapsedIconTapHint": "Vis",
"remainingTextFieldCharacterCountZero": "TBD",
"remainingTextFieldCharacterCountOne": "1 tegn gjenstår",
"remainingTextFieldCharacterCountOther": "$remainingCount tegn gjenstår",
"refreshIndicatorSemanticLabel": "Laster inn på nytt",
"dateSeparator": "/", "dateSeparator": "/",
"dateHelpText": "mm/dd/åååå", "dateHelpText": "mm/dd/åååå",
"selectYearSemanticsLabel": "Velg året", "selectYearSemanticsLabel": "Velg året",
...@@ -78,7 +60,23 @@ ...@@ -78,7 +60,23 @@
"invalidTimeLabel": "Angi et gyldig klokkeslett", "invalidTimeLabel": "Angi et gyldig klokkeslett",
"dialModeButtonLabel": "Bytt til modus for valg fra urskive", "dialModeButtonLabel": "Bytt til modus for valg fra urskive",
"inputTimeModeButtonLabel": "Bytt til tekstinndatamodus", "inputTimeModeButtonLabel": "Bytt til tekstinndatamodus",
"licensesPackageDetailTextZero": "No licenses", "signedInLabel": "Pålogget",
"licensesPackageDetailTextOne": "1 lisens", "hideAccountsLabel": "Skjul kontoer",
"licensesPackageDetailTextOther": "$licenseCount lisenser" "showAccountsLabel": "Vis kontoer",
"drawerLabel": "Navigasjonsmeny",
"popupMenuLabel": "Forgrunnsmeny",
"dialogLabel": "Dialogboks",
"alertDialogLabel": "Varsel",
"searchFieldLabel": "Søk",
"reorderItemToStart": "Flytt til starten",
"reorderItemToEnd": "Flytt til slutten",
"reorderItemUp": "Flytt opp",
"reorderItemDown": "Flytt ned",
"reorderItemLeft": "Flytt til venstre",
"reorderItemRight": "Flytt til høyre",
"expandedIconTapHint": "Skjul",
"collapsedIconTapHint": "Vis",
"remainingTextFieldCharacterCountOne": "1 tegn gjenstår",
"remainingTextFieldCharacterCountOther": "$remainingCount tegn gjenstår",
"refreshIndicatorSemanticLabel": "Laster inn på nytt"
} }
...@@ -3,7 +3,6 @@ ...@@ -3,7 +3,6 @@
// found in the LICENSE file. // found in the LICENSE file.
import 'dart:async'; import 'dart:async';
import 'dart:io';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_localizations/flutter_localizations.dart'; import 'package:flutter_localizations/flutter_localizations.dart';
...@@ -29,19 +28,6 @@ void main() { ...@@ -29,19 +28,6 @@ void main() {
}, throwsAssertionError); }, throwsAssertionError);
}); });
// Regression test for https://github.com/flutter/flutter/issues/53036.
test('`nb` uses `no` as a synonym when `nb` arb file is not present', () async {
final File nbMaterialArbFile = File('lib/src/l10n/material_nb.arb');
final File noMaterialArbFile = File('lib/src/l10n/material_no.arb');
// No need to run test if `nb` arb file exists or if `no` arb file does not exist.
if (noMaterialArbFile.existsSync() && !nbMaterialArbFile.existsSync()) {
final GlobalMaterialLocalizations localizations = await GlobalMaterialLocalizations.delegate
.load(const Locale('nb')) as GlobalMaterialLocalizations;
expect(localizations.formatMediumDate(DateTime(2020, 4, 3)), 'fre. 3. apr.');
}
});
group('formatHour', () { group('formatHour', () {
Future<String> formatHour(WidgetTester tester, Locale locale, TimeOfDay timeOfDay) async { Future<String> formatHour(WidgetTester tester, Locale locale, TimeOfDay timeOfDay) async {
final Completer<String> completer = Completer<String>(); final Completer<String> completer = Completer<String>();
......
...@@ -472,38 +472,6 @@ void main() { ...@@ -472,38 +472,6 @@ void main() {
expect(localizations.okButtonLabel, '確定'); expect(localizations.okButtonLabel, '確定');
}); });
// Regression test for https://github.com/flutter/flutter/issues/53036.
testWidgets('`nb` uses `no` as its synonym when `nb` arb file is not present', (WidgetTester tester) async {
final File nbMaterialArbFile = File(
path.join(rootDirectoryPath, 'lib', 'src', 'l10n', 'material_nb.arb'),
);
final File noMaterialArbFile = File(
path.join(rootDirectoryPath, 'lib', 'src', 'l10n', 'material_no.arb'),
);
// No need to run test if `nb` arb file exists or if `no` arb file does not exist.
if (noMaterialArbFile.existsSync() && !nbMaterialArbFile.existsSync()) {
Locale locale = const Locale.fromSubtags(languageCode: 'no', scriptCode: null, countryCode: null);
expect(GlobalMaterialLocalizations.delegate.isSupported(locale), isTrue);
MaterialLocalizations localizations = await GlobalMaterialLocalizations.delegate.load(locale);
expect(localizations, isA<MaterialLocalizationNo>());
final String alertDialogLabelNo = localizations.alertDialogLabel;
final String anteMeridiemAbbreviationNo = localizations.anteMeridiemAbbreviation;
final String closeButtonLabelNo = localizations.closeButtonLabel;
final String okButtonLabelNo = localizations.okButtonLabel;
locale = const Locale.fromSubtags(languageCode: 'nb', scriptCode: null, countryCode: null);
expect(GlobalMaterialLocalizations.delegate.isSupported(locale), isTrue);
localizations = await GlobalMaterialLocalizations.delegate.load(locale);
expect(localizations, isA<MaterialLocalizationNb>());
expect(localizations.alertDialogLabel, alertDialogLabelNo);
expect(localizations.anteMeridiemAbbreviation, anteMeridiemAbbreviationNo);
expect(localizations.closeButtonLabel, closeButtonLabelNo);
expect(localizations.okButtonLabel, okButtonLabelNo);
}
});
// Regression test for https://github.com/flutter/flutter/issues/36704. // Regression test for https://github.com/flutter/flutter/issues/36704.
testWidgets('kn arb file should be properly Unicode escaped', (WidgetTester tester) async { testWidgets('kn arb file should be properly Unicode escaped', (WidgetTester tester) async {
final File file = File( final File file = File(
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment