From caba667ed4bd59020d48174ceaf57ddf3714ea15 Mon Sep 17 00:00:00 2001 From: LouiseHsu Date: Thu, 25 Jan 2024 10:24:42 -0800 Subject: [PATCH] Fix incorrect zh-cn translation for Look Up Label in selection controls (#142158) Fixes https://github.com/flutter/flutter/issues/141764 Translation suggestion here: https://tc.corp.google.com/btviewer/edittranslation?project=Flutter&msgId=8222331119728136330&language=zh-CN ## Pre-launch Checklist - [x] I read the [Contributor Guide] and followed the process outlined there for submitting PRs. - [x] I read the [Tree Hygiene] wiki page, which explains my responsibilities. - [x] I read and followed the [Flutter Style Guide], including [Features we expect every widget to implement]. - [x] I signed the [CLA]. - [x] I listed at least one issue that this PR fixes in the description above. - [x] I updated/added relevant documentation (doc comments with `///`). - [x] I added new tests to check the change I am making, or this PR is [test-exempt]. - [x] All existing and new tests are passing. --- .../flutter_localizations/lib/src/l10n/cupertino_zh.arb | 2 +- .../lib/src/l10n/generated_cupertino_localizations.dart | 2 +- .../lib/src/l10n/generated_material_localizations.dart | 2 +- .../flutter_localizations/lib/src/l10n/material_zh.arb | 2 +- .../test/cupertino/translations_test.dart | 8 ++++++++ .../test/material/translations_test.dart | 9 +++++++++ 6 files changed, 21 insertions(+), 4 deletions(-) diff --git a/packages/flutter_localizations/lib/src/l10n/cupertino_zh.arb b/packages/flutter_localizations/lib/src/l10n/cupertino_zh.arb index f2a1d3ee72..b0f76097d6 100644 --- a/packages/flutter_localizations/lib/src/l10n/cupertino_zh.arb +++ b/packages/flutter_localizations/lib/src/l10n/cupertino_zh.arb @@ -24,7 +24,7 @@ "searchTextFieldPlaceholderLabel": "搜索", "noSpellCheckReplacementsLabel": "找不到替换文字", "menuDismissLabel": "关闭菜单", - "lookUpButtonLabel": "向上看", + "lookUpButtonLabel": "查询", "searchWebButtonLabel": "在网络上搜索", "shareButtonLabel": "分享…", "clearButtonLabel": "Clear" diff --git a/packages/flutter_localizations/lib/src/l10n/generated_cupertino_localizations.dart b/packages/flutter_localizations/lib/src/l10n/generated_cupertino_localizations.dart index 618dc0850f..90aa1b73a8 100644 --- a/packages/flutter_localizations/lib/src/l10n/generated_cupertino_localizations.dart +++ b/packages/flutter_localizations/lib/src/l10n/generated_cupertino_localizations.dart @@ -14015,7 +14015,7 @@ class CupertinoLocalizationZh extends GlobalCupertinoLocalizations { String? get datePickerMinuteSemanticsLabelZero => null; @override - String get lookUpButtonLabel => '向上看'; + String get lookUpButtonLabel => '查询'; @override String get menuDismissLabel => '关闭菜单'; 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 55763f7659..661e0b932c 100644 --- a/packages/flutter_localizations/lib/src/l10n/generated_material_localizations.dart +++ b/packages/flutter_localizations/lib/src/l10n/generated_material_localizations.dart @@ -43724,7 +43724,7 @@ class MaterialLocalizationZh extends GlobalMaterialLocalizations { String get licensesPageTitle => '许可'; @override - String get lookUpButtonLabel => '向上看'; + String get lookUpButtonLabel => '查询'; @override String get menuBarMenuLabel => '菜单栏的菜单'; diff --git a/packages/flutter_localizations/lib/src/l10n/material_zh.arb b/packages/flutter_localizations/lib/src/l10n/material_zh.arb index 3ebaf897e6..c012e5e106 100644 --- a/packages/flutter_localizations/lib/src/l10n/material_zh.arb +++ b/packages/flutter_localizations/lib/src/l10n/material_zh.arb @@ -142,7 +142,7 @@ "expandedHint": "已收起", "collapsedHint": "已展开", "menuDismissLabel": "关闭菜单", - "lookUpButtonLabel": "向上看", + "lookUpButtonLabel": "查询", "searchWebButtonLabel": "在网络上搜索", "shareButtonLabel": "分享…", "clearButtonTooltip": "Clear text" diff --git a/packages/flutter_localizations/test/cupertino/translations_test.dart b/packages/flutter_localizations/test/cupertino/translations_test.dart index 4599634ee6..ccd14ca0a8 100644 --- a/packages/flutter_localizations/test/cupertino/translations_test.dart +++ b/packages/flutter_localizations/test/cupertino/translations_test.dart @@ -231,6 +231,14 @@ void main() { expect(buttonItems.first.onPressed, isNull); }); + // Regression test for https://github.com/flutter/flutter/issues/141764 + testWidgets('zh-CN translation for look up label', (WidgetTester tester) async { + const Locale locale = Locale('zh'); + expect(GlobalCupertinoLocalizations.delegate.isSupported(locale), isTrue); + final CupertinoLocalizations localizations = await GlobalCupertinoLocalizations.delegate.load(locale); + expect(localizations, isA()); + expect(localizations.lookUpButtonLabel, '查询'); + }); } class _FakeEditableText extends EditableText { diff --git a/packages/flutter_localizations/test/material/translations_test.dart b/packages/flutter_localizations/test/material/translations_test.dart index 15b5785d0b..ba23db2542 100644 --- a/packages/flutter_localizations/test/material/translations_test.dart +++ b/packages/flutter_localizations/test/material/translations_test.dart @@ -549,4 +549,13 @@ void main() { expect(localizations, isA()); expect(localizations.shareButtonLabel, 'Share'); }); + + // Regression test for https://github.com/flutter/flutter/issues/141764 + testWidgets('zh-CN translation for look up label', (WidgetTester tester) async { + const Locale locale = Locale('zh'); + expect(GlobalCupertinoLocalizations.delegate.isSupported(locale), isTrue); + final MaterialLocalizations localizations = await GlobalMaterialLocalizations.delegate.load(locale); + expect(localizations, isA()); + expect(localizations.lookUpButtonLabel, '查询'); + }); }