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
6 changed files with 21 additions and 4 deletions

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, '查询');
});
}