From b6fa041808a988ac21039fd3993c2b75e2ebb9a2 Mon Sep 17 00:00:00 2001 From: Bruno Leroux Date: Sat, 2 Dec 2023 00:32:57 +0100 Subject: [PATCH] [l10n] Update Material shareButtonLabel (#138899) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## Description This PR updates the Material label for the share option, currently it is "**Share...**" (the expected label on iOS), on Android it should be "**Share**". Native Android TextField screenshot: ![Capture d’écran du 2023-11-20 17-19-02](https://github.com/flutter/flutter/assets/840911/6004b900-0ba4-441e-a814-4afd0c0e2fe2) ## Related Issue Step 2 for https://github.com/flutter/flutter/issues/138728 ## Tests Adds 1 test. --- .../src/material/material_localizations.dart | 2 +- .../generated_material_localizations.dart | 23 ++++++++++++++++++- .../lib/src/l10n/material_en.arb | 8 +++---- .../test/material/translations_test.dart | 11 ++++++++- 4 files changed, 37 insertions(+), 7 deletions(-) diff --git a/packages/flutter/lib/src/material/material_localizations.dart b/packages/flutter/lib/src/material/material_localizations.dart index 8cfd4b046a..e048ad8b96 100644 --- a/packages/flutter/lib/src/material/material_localizations.dart +++ b/packages/flutter/lib/src/material/material_localizations.dart @@ -1195,7 +1195,7 @@ class DefaultMaterialLocalizations implements MaterialLocalizations { String get searchWebButtonLabel => 'Search Web'; @override - String get shareButtonLabel => 'Share...'; + String get shareButtonLabel => 'Share'; @override String get viewLicensesButtonLabel => 'View licenses'; 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 ec6a20a83e..8c2c01cb25 100644 --- a/packages/flutter_localizations/lib/src/l10n/generated_material_localizations.dart +++ b/packages/flutter_localizations/lib/src/l10n/generated_material_localizations.dart @@ -7879,7 +7879,7 @@ class MaterialLocalizationEn extends GlobalMaterialLocalizations { String? get selectedRowCountTitleZero => 'No items selected'; @override - String get shareButtonLabel => 'Share...'; + String get shareButtonLabel => 'Share'; @override String get showAccountsLabel => 'Show accounts'; @@ -7942,6 +7942,9 @@ class MaterialLocalizationEnAu extends MaterialLocalizationEn { required super.twoDigitZeroPaddedFormat, }); + @override + String get shareButtonLabel => 'Share...'; + @override String get lookUpButtonLabel => 'Look up'; @@ -8148,6 +8151,9 @@ class MaterialLocalizationEnGb extends MaterialLocalizationEn { required super.twoDigitZeroPaddedFormat, }); + @override + String get shareButtonLabel => 'Share...'; + @override String get lookUpButtonLabel => 'Look up'; @@ -8248,6 +8254,9 @@ class MaterialLocalizationEnIe extends MaterialLocalizationEn { required super.twoDigitZeroPaddedFormat, }); + @override + String get shareButtonLabel => 'Share...'; + @override String get lookUpButtonLabel => 'Look up'; @@ -8348,6 +8357,9 @@ class MaterialLocalizationEnIn extends MaterialLocalizationEn { required super.twoDigitZeroPaddedFormat, }); + @override + String get shareButtonLabel => 'Share...'; + @override String get lookUpButtonLabel => 'Look up'; @@ -8445,6 +8457,9 @@ class MaterialLocalizationEnNz extends MaterialLocalizationEn { required super.twoDigitZeroPaddedFormat, }); + @override + String get shareButtonLabel => 'Share...'; + @override String get lookUpButtonLabel => 'Look up'; @@ -8542,6 +8557,9 @@ class MaterialLocalizationEnSg extends MaterialLocalizationEn { required super.twoDigitZeroPaddedFormat, }); + @override + String get shareButtonLabel => 'Share...'; + @override String get lookUpButtonLabel => 'Look up'; @@ -8639,6 +8657,9 @@ class MaterialLocalizationEnZa extends MaterialLocalizationEn { required super.twoDigitZeroPaddedFormat, }); + @override + String get shareButtonLabel => 'Share...'; + @override String get lookUpButtonLabel => 'Look up'; diff --git a/packages/flutter_localizations/lib/src/l10n/material_en.arb b/packages/flutter_localizations/lib/src/l10n/material_en.arb index bcce0e2b39..06fa666206 100644 --- a/packages/flutter_localizations/lib/src/l10n/material_en.arb +++ b/packages/flutter_localizations/lib/src/l10n/material_en.arb @@ -199,17 +199,17 @@ "lookUpButtonLabel": "Look Up", "@lookUpButtonLabel": { - "description": "The label for the Look Up button and menu items on iOS." + "description": "The label for the Look Up button and menu items." }, "searchWebButtonLabel": "Search Web", "@searchWebButtonLabel": { - "description": "The label for the Search Web button and menu items on iOS." + "description": "The label for the Search Web button and menu items." }, - "shareButtonLabel": "Share...", + "shareButtonLabel": "Share", "@shareButtonLabel": { - "description": "The label for the Share button and menu items on iOS." + "description": "The label for the Share button and menu items." }, "okButtonLabel": "OK", diff --git a/packages/flutter_localizations/test/material/translations_test.dart b/packages/flutter_localizations/test/material/translations_test.dart index 24b176ba8d..15b5785d0b 100644 --- a/packages/flutter_localizations/test/material/translations_test.dart +++ b/packages/flutter_localizations/test/material/translations_test.dart @@ -535,9 +535,18 @@ void main() { // Regression test for https://github.com/flutter/flutter/issues/110451. testWidgets('Finnish translation for tab label', (WidgetTester tester) async { const Locale locale = Locale('fi'); - expect(GlobalCupertinoLocalizations.delegate.isSupported(locale), isTrue); + expect(GlobalMaterialLocalizations.delegate.isSupported(locale), isTrue); final MaterialLocalizations localizations = await GlobalMaterialLocalizations.delegate.load(locale); expect(localizations, isA()); expect(localizations.tabLabel(tabIndex: 1, tabCount: 2), 'Välilehti 1 kautta 2'); }); + + // Regression test for https://github.com/flutter/flutter/issues/138728. + testWidgets('Share button label on Material', (WidgetTester tester) async { + const Locale locale = Locale('en'); + expect(GlobalMaterialLocalizations.delegate.isSupported(locale), isTrue); + final MaterialLocalizations localizations = await GlobalMaterialLocalizations.delegate.load(locale); + expect(localizations, isA()); + expect(localizations.shareButtonLabel, 'Share'); + }); }