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.
This commit is contained in:
LouiseHsu 2024-01-25 10:24:42 -08:00 committed by GitHub
parent 204a8848a6
commit caba667ed4
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 21 additions and 4 deletions

View file

@ -24,7 +24,7 @@
"searchTextFieldPlaceholderLabel": "搜索",
"noSpellCheckReplacementsLabel": "找不到替换文字",
"menuDismissLabel": "关闭菜单",
"lookUpButtonLabel": "向上看",
"lookUpButtonLabel": "查询",
"searchWebButtonLabel": "在网络上搜索",
"shareButtonLabel": "分享…",
"clearButtonLabel": "Clear"

View file

@ -14015,7 +14015,7 @@ class CupertinoLocalizationZh extends GlobalCupertinoLocalizations {
String? get datePickerMinuteSemanticsLabelZero => null;
@override
String get lookUpButtonLabel => '向上看';
String get lookUpButtonLabel => '查询';
@override
String get menuDismissLabel => '关闭菜单';

View file

@ -43724,7 +43724,7 @@ class MaterialLocalizationZh extends GlobalMaterialLocalizations {
String get licensesPageTitle => '许可';
@override
String get lookUpButtonLabel => '向上看';
String get lookUpButtonLabel => '查询';
@override
String get menuBarMenuLabel => '菜单栏的菜单';

View file

@ -142,7 +142,7 @@
"expandedHint": "已收起",
"collapsedHint": "已展开",
"menuDismissLabel": "关闭菜单",
"lookUpButtonLabel": "向上看",
"lookUpButtonLabel": "查询",
"searchWebButtonLabel": "在网络上搜索",
"shareButtonLabel": "分享…",
"clearButtonTooltip": "Clear text"

View file

@ -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<CupertinoLocalizationZh>());
expect(localizations.lookUpButtonLabel, '查询');
});
}
class _FakeEditableText extends EditableText {

View file

@ -549,4 +549,13 @@ void main() {
expect(localizations, isA<MaterialLocalizationEn>());
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<MaterialLocalizationZh>());
expect(localizations.lookUpButtonLabel, '查询');
});
}