-
Notifications
You must be signed in to change notification settings - Fork 29.7k
Add localization for Back and Cancel buttons in CupertinoNavigationBar
#162581
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add localization for Back and Cancel buttons in CupertinoNavigationBar
#162581
Conversation
|
Drive by comments: the analyze check is failing. Looks like it's just asking for the imports for navbar to be arranged alphabetically. For the localizations, our process for adding new strings is to just setup the string for localizations and just have it default to an English string for all localization files: https://github.com/flutter/flutter/blob/master/packages/flutter_localizations/README.md Then once that's merged the rest is handled by Flutter members within Google. A different team within Google that specializes in translations gives us all the localized strings, which we use to generate the files. What did you use to get all the translations? Even if you used Google translate, that's a lot of effort. cc @QuncCccccc |
|
Thanks for the information, @MitchellGoodwin. I misinterpreted *"until they can be translated" in the README as a step that needed to be done. For the translations, I used the ones from Material’s Would you like me to revert the translations back to English? I’ll try to fix the import order tomorrow. |
Yes thanks a lot:) Once the change is merged, we will wait until the translation is finished and then back-integrate the translations :)
That's impressive! I'm thinking if these two labels are needed for both material and cupertino, should we move these 2 in widget layer? like in |
|
I've reverted the translations to English and also arranged the imports in @QuncCccccc I scanned both localization files for duplicates and found 13 other 1:1 matches between Material and Cupertino. So it's not just me! :) Examples:
I think moving these shared translations to |
d7c5d00 to
ea8e077
Compare
247ee8f to
39d1f56
Compare
| /// indicate that a tap outside dismisses the context menu. | ||
| String get menuDismissLabel; | ||
|
|
||
| /// The label for the cancel button in modal views, used in [CupertinoNavigationBar]. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also add the sliver variant, CupertinoSliverNavigationBar.
| /// The label for the cancel button in modal views, used in [CupertinoNavigationBar]. | ||
| String get cancelButtonLabel; | ||
|
|
||
| /// The label for the back button, used in [CupertinoNavigationBar]. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same here.
| }, | ||
| "backButtonLabel": "Back", | ||
| "@backButtonLabel": { | ||
| "description": "Label for the back button." |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: maybe add a usage?
QuncCccccc
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM:) Thanks for your contribution! Once we fixed all the comments, we are good to go!🥳
| "description": "Accessibility announcement for the selected hour on a time picker such as '5 o'clock' or '5点'", | ||
| "plural": "hour" | ||
| }, | ||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we can leave these blank lines, just to be consistent with material_en.arb and widgets_en.arb:)
| "cancelButtonLabel": "Cancel", | ||
| "@cancelButtonLabel": { | ||
| "description": "Label for the cancel button in modal views." | ||
| }, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| }, | |
| }, | |
| "menuDismissLabel": "Dismiss menu", | ||
| "@menuDismissLabel": { | ||
| "description": "Label read out by accessibility tools (TalkBack or VoiceOver) for the area around a menu to indicate that a tap dismisses the menu." | ||
| }, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| }, | |
| }, | |
71631f9 to
4cf0049
Compare
|
Thanks for the feedback @victorsanni @QuncCccccc ! I've pushed updates that add newlines between translations, update docstrings to include |
4cf0049 to
2305ead
Compare
victorsanni
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Thanks for the PR.
QuncCccccc
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM:) Thanks for the contribution!
…NavigationBar (flutter/flutter#162581)
…NavigationBar (flutter/flutter#162581)
…NavigationBar (flutter/flutter#162581)
Roll Flutter from 1659206 to 2e570ca (75 revisions) flutter/flutter@1659206...2e570ca 2025-02-27 [email protected] Roll Skia from ac08df9c8d82 to e5a33102401c (1 revision) (flutter/flutter#164288) 2025-02-27 [email protected] Roll Skia from 6018dff0233a to ac08df9c8d82 (1 revision) (flutter/flutter#164275) 2025-02-27 [email protected] Roll Dart SDK from 4a218fbffc80 to fcda71ce147b (1 revision) (flutter/flutter#164276) 2025-02-27 [email protected] Roll Skia from 0f2e106c9abc to 6018dff0233a (1 revision) (flutter/flutter#164266) 2025-02-27 [email protected] Add windowing channel support to Linux embedder (flutter/flutter#163180) 2025-02-27 [email protected] Roll Dart SDK from 7fa5901bd8a3 to 4a218fbffc80 (2 revisions) (flutter/flutter#164260) 2025-02-27 [email protected] Roll Skia from fdd97386193e to 0f2e106c9abc (4 revisions) (flutter/flutter#164259) 2025-02-27 [email protected] Run more builds faster (flutter/flutter#164125) 2025-02-27 [email protected] Increase customer test timeout to 60 minutes (flutter/flutter#164239) 2025-02-27 [email protected] Reland "Add a buildtools directory and move third_party/ninja to the project root in order to match the expectations of depot_tools" (flutter/flutter#164240) 2025-02-27 [email protected] Use the Dart isolate ownership API on the root isolate (flutter/flutter#163703) 2025-02-26 [email protected] Roll Fuchsia Linux SDK from g-2SJtblPjjaH7Egy... to 1elkOxihZuTEiTXzY... (flutter/flutter#164243) 2025-02-26 [email protected] Show Linux driver information in flutter doctor (flutter/flutter#163980) 2025-02-26 [email protected] Implement opacity `FlutterMutator` for hcpp (flutter/flutter#164147) 2025-02-26 [email protected] Roll Fuchsia Linux SDK from g-2SJtblPjjaH7Egy... to 1elkOxihZuTEiTXzY... (flutter/flutter#164232) 2025-02-26 [email protected] Roll Skia from 47b84f354604 to fdd97386193e (8 revisions) (flutter/flutter#164221) 2025-02-26 [email protected] [Impeller] Reland: move AHB check into Flutter main, don't disable ImageReader on 29. (flutter/flutter#164201) 2025-02-26 [email protected] Roll Dart SDK from 80865748abe0 to 7fa5901bd8a3 (3 revisions) (flutter/flutter#164226) 2025-02-26 [email protected] Update fuchsia_test_scripts_version to the latest version (flutter/flutter#164123) 2025-02-26 [email protected] Guard against zero item extent for carousel (flutter/flutter#163310) 2025-02-26 [email protected] [Impeller] work around for crashy Nexus 5 Driver. (flutter/flutter#164040) 2025-02-26 98614782+auto-submit[bot]@users.noreply.github.com Reverts "Add a buildtools directory and move third_party/ninja to the project root in order to match the expectations of depot_tools (#163890)" (flutter/flutter#164209) 2025-02-26 [email protected] Add localization for `Back` and `Cancel` buttons in CupertinoNavigationBar (flutter/flutter#162581) 2025-02-26 [email protected] Added compilation failure if a max ubo size is exceeded (flutter/flutter#164038) 2025-02-26 [email protected] Roll Skia from 5336e20498d9 to 47b84f354604 (2 revisions) (flutter/flutter#164188) 2025-02-26 [email protected] Add a buildtools directory and move third_party/ninja to the project root in order to match the expectations of depot_tools (flutter/flutter#163890) 2025-02-26 [email protected] Roll Skia from 3ce6f25dc13e to 5336e20498d9 (9 revisions) (flutter/flutter#164174) 2025-02-26 [email protected] Roll Dart SDK from b8292dfeaa67 to 80865748abe0 (9 revisions) (flutter/flutter#164168) 2025-02-26 [email protected] [Engine] Remove dead code for RoundedSuperellipse (flutter/flutter#164163) 2025-02-26 [email protected] [Impeller] detect mediatek soc and fall back to GLES. (flutter/flutter#164126) 2025-02-26 [email protected] [Impeller] make DLOG into LOG for startup errors. (flutter/flutter#164110) 2025-02-26 [email protected] Intercept error when iOS 18.4 crashes with JIT mode and give guided error (flutter/flutter#164072) 2025-02-26 98614782+auto-submit[bot]@users.noreply.github.com Reverts "[Impeller] move AHB check to Vulkan, use Vulkan surface on 29. (#164109)" (flutter/flutter#164166) 2025-02-26 [email protected] Run new gallery transition perf benchmark on Galaxy S24 (flutter/flutter#163665) 2025-02-26 [email protected] [Impeller] move AHB check to Vulkan, use Vulkan surface on 29. (flutter/flutter#164109) 2025-02-26 [email protected] [iOS] Add platform view to integration_test example (flutter/flutter#164144) 2025-02-26 [email protected] Fix minor issues in documentation of WidgetsApp (flutter/flutter#163942) 2025-02-26 [email protected] Fix extra numbers showing up when enabling VoiceControl (flutter/flutter#163593) 2025-02-26 [email protected] Set SliverResizingHeader's maxScrollObstructionExtent to minExtent (flutter/flutter#162955) 2025-02-26 [email protected] Roll Dart SDK from aea6fff33f06 to b8292dfeaa67 (1 revision) (flutter/flutter#163973) 2025-02-26 [email protected] [DisplayList] Delete all legacy Skia-oriented method overloads in DlCanvas (flutter/flutter#164054) 2025-02-25 [email protected] Clean up leak tracker instrumentation tech debt. (flutter/flutter#164070) 2025-02-25 [email protected] Revert "Marks Linux_pixel_7pro service_extensions_test to be flaky" (flutter/flutter#163882) 2025-02-25 [email protected] Check if simctl is installed before trying to list devices or runtimes (flutter/flutter#163895) 2025-02-25 [email protected] Update dragDevices doc to include default PointerDeviceKind.trackpad (flutter/flutter#163898) 2025-02-25 [email protected] Update multiple flutters benchmark test to latest gradle and agp and gradle defined dependencies (flutter/flutter#164029) ...
…NavigationBar (flutter/flutter#162581)
…NavigationBar (flutter/flutter#162581)
…NavigationBar (flutter/flutter#162581)
Roll Flutter from 1659206 to 2e570ca (75 revisions) flutter/flutter@1659206...2e570ca 2025-02-27 [email protected] Roll Skia from ac08df9c8d82 to e5a33102401c (1 revision) (flutter/flutter#164288) 2025-02-27 [email protected] Roll Skia from 6018dff0233a to ac08df9c8d82 (1 revision) (flutter/flutter#164275) 2025-02-27 [email protected] Roll Dart SDK from 4a218fbffc80 to fcda71ce147b (1 revision) (flutter/flutter#164276) 2025-02-27 [email protected] Roll Skia from 0f2e106c9abc to 6018dff0233a (1 revision) (flutter/flutter#164266) 2025-02-27 [email protected] Add windowing channel support to Linux embedder (flutter/flutter#163180) 2025-02-27 [email protected] Roll Dart SDK from 7fa5901bd8a3 to 4a218fbffc80 (2 revisions) (flutter/flutter#164260) 2025-02-27 [email protected] Roll Skia from fdd97386193e to 0f2e106c9abc (4 revisions) (flutter/flutter#164259) 2025-02-27 [email protected] Run more builds faster (flutter/flutter#164125) 2025-02-27 [email protected] Increase customer test timeout to 60 minutes (flutter/flutter#164239) 2025-02-27 [email protected] Reland "Add a buildtools directory and move third_party/ninja to the project root in order to match the expectations of depot_tools" (flutter/flutter#164240) 2025-02-27 [email protected] Use the Dart isolate ownership API on the root isolate (flutter/flutter#163703) 2025-02-26 [email protected] Roll Fuchsia Linux SDK from g-2SJtblPjjaH7Egy... to 1elkOxihZuTEiTXzY... (flutter/flutter#164243) 2025-02-26 [email protected] Show Linux driver information in flutter doctor (flutter/flutter#163980) 2025-02-26 [email protected] Implement opacity `FlutterMutator` for hcpp (flutter/flutter#164147) 2025-02-26 [email protected] Roll Fuchsia Linux SDK from g-2SJtblPjjaH7Egy... to 1elkOxihZuTEiTXzY... (flutter/flutter#164232) 2025-02-26 [email protected] Roll Skia from 47b84f354604 to fdd97386193e (8 revisions) (flutter/flutter#164221) 2025-02-26 [email protected] [Impeller] Reland: move AHB check into Flutter main, don't disable ImageReader on 29. (flutter/flutter#164201) 2025-02-26 [email protected] Roll Dart SDK from 80865748abe0 to 7fa5901bd8a3 (3 revisions) (flutter/flutter#164226) 2025-02-26 [email protected] Update fuchsia_test_scripts_version to the latest version (flutter/flutter#164123) 2025-02-26 [email protected] Guard against zero item extent for carousel (flutter/flutter#163310) 2025-02-26 [email protected] [Impeller] work around for crashy Nexus 5 Driver. (flutter/flutter#164040) 2025-02-26 98614782+auto-submit[bot]@users.noreply.github.com Reverts "Add a buildtools directory and move third_party/ninja to the project root in order to match the expectations of depot_tools (#163890)" (flutter/flutter#164209) 2025-02-26 [email protected] Add localization for `Back` and `Cancel` buttons in CupertinoNavigationBar (flutter/flutter#162581) 2025-02-26 [email protected] Added compilation failure if a max ubo size is exceeded (flutter/flutter#164038) 2025-02-26 [email protected] Roll Skia from 5336e20498d9 to 47b84f354604 (2 revisions) (flutter/flutter#164188) 2025-02-26 [email protected] Add a buildtools directory and move third_party/ninja to the project root in order to match the expectations of depot_tools (flutter/flutter#163890) 2025-02-26 [email protected] Roll Skia from 3ce6f25dc13e to 5336e20498d9 (9 revisions) (flutter/flutter#164174) 2025-02-26 [email protected] Roll Dart SDK from b8292dfeaa67 to 80865748abe0 (9 revisions) (flutter/flutter#164168) 2025-02-26 [email protected] [Engine] Remove dead code for RoundedSuperellipse (flutter/flutter#164163) 2025-02-26 [email protected] [Impeller] detect mediatek soc and fall back to GLES. (flutter/flutter#164126) 2025-02-26 [email protected] [Impeller] make DLOG into LOG for startup errors. (flutter/flutter#164110) 2025-02-26 [email protected] Intercept error when iOS 18.4 crashes with JIT mode and give guided error (flutter/flutter#164072) 2025-02-26 98614782+auto-submit[bot]@users.noreply.github.com Reverts "[Impeller] move AHB check to Vulkan, use Vulkan surface on 29. (#164109)" (flutter/flutter#164166) 2025-02-26 [email protected] Run new gallery transition perf benchmark on Galaxy S24 (flutter/flutter#163665) 2025-02-26 [email protected] [Impeller] move AHB check to Vulkan, use Vulkan surface on 29. (flutter/flutter#164109) 2025-02-26 [email protected] [iOS] Add platform view to integration_test example (flutter/flutter#164144) 2025-02-26 [email protected] Fix minor issues in documentation of WidgetsApp (flutter/flutter#163942) 2025-02-26 [email protected] Fix extra numbers showing up when enabling VoiceControl (flutter/flutter#163593) 2025-02-26 [email protected] Set SliverResizingHeader's maxScrollObstructionExtent to minExtent (flutter/flutter#162955) 2025-02-26 [email protected] Roll Dart SDK from aea6fff33f06 to b8292dfeaa67 (1 revision) (flutter/flutter#163973) 2025-02-26 [email protected] [DisplayList] Delete all legacy Skia-oriented method overloads in DlCanvas (flutter/flutter#164054) 2025-02-25 [email protected] Clean up leak tracker instrumentation tech debt. (flutter/flutter#164070) 2025-02-25 [email protected] Revert "Marks Linux_pixel_7pro service_extensions_test to be flaky" (flutter/flutter#163882) 2025-02-25 [email protected] Check if simctl is installed before trying to list devices or runtimes (flutter/flutter#163895) 2025-02-25 [email protected] Update dragDevices doc to include default PointerDeviceKind.trackpad (flutter/flutter#163898) 2025-02-25 [email protected] Update multiple flutters benchmark test to latest gradle and agp and gradle defined dependencies (flutter/flutter#164029) ...
Roll Flutter from 1659206 to 2e570ca (75 revisions) flutter/flutter@1659206...2e570ca 2025-02-27 [email protected] Roll Skia from ac08df9c8d82 to e5a33102401c (1 revision) (flutter/flutter#164288) 2025-02-27 [email protected] Roll Skia from 6018dff0233a to ac08df9c8d82 (1 revision) (flutter/flutter#164275) 2025-02-27 [email protected] Roll Dart SDK from 4a218fbffc80 to fcda71ce147b (1 revision) (flutter/flutter#164276) 2025-02-27 [email protected] Roll Skia from 0f2e106c9abc to 6018dff0233a (1 revision) (flutter/flutter#164266) 2025-02-27 [email protected] Add windowing channel support to Linux embedder (flutter/flutter#163180) 2025-02-27 [email protected] Roll Dart SDK from 7fa5901bd8a3 to 4a218fbffc80 (2 revisions) (flutter/flutter#164260) 2025-02-27 [email protected] Roll Skia from fdd97386193e to 0f2e106c9abc (4 revisions) (flutter/flutter#164259) 2025-02-27 [email protected] Run more builds faster (flutter/flutter#164125) 2025-02-27 [email protected] Increase customer test timeout to 60 minutes (flutter/flutter#164239) 2025-02-27 [email protected] Reland "Add a buildtools directory and move third_party/ninja to the project root in order to match the expectations of depot_tools" (flutter/flutter#164240) 2025-02-27 [email protected] Use the Dart isolate ownership API on the root isolate (flutter/flutter#163703) 2025-02-26 [email protected] Roll Fuchsia Linux SDK from g-2SJtblPjjaH7Egy... to 1elkOxihZuTEiTXzY... (flutter/flutter#164243) 2025-02-26 [email protected] Show Linux driver information in flutter doctor (flutter/flutter#163980) 2025-02-26 [email protected] Implement opacity `FlutterMutator` for hcpp (flutter/flutter#164147) 2025-02-26 [email protected] Roll Fuchsia Linux SDK from g-2SJtblPjjaH7Egy... to 1elkOxihZuTEiTXzY... (flutter/flutter#164232) 2025-02-26 [email protected] Roll Skia from 47b84f354604 to fdd97386193e (8 revisions) (flutter/flutter#164221) 2025-02-26 [email protected] [Impeller] Reland: move AHB check into Flutter main, don't disable ImageReader on 29. (flutter/flutter#164201) 2025-02-26 [email protected] Roll Dart SDK from 80865748abe0 to 7fa5901bd8a3 (3 revisions) (flutter/flutter#164226) 2025-02-26 [email protected] Update fuchsia_test_scripts_version to the latest version (flutter/flutter#164123) 2025-02-26 [email protected] Guard against zero item extent for carousel (flutter/flutter#163310) 2025-02-26 [email protected] [Impeller] work around for crashy Nexus 5 Driver. (flutter/flutter#164040) 2025-02-26 98614782+auto-submit[bot]@users.noreply.github.com Reverts "Add a buildtools directory and move third_party/ninja to the project root in order to match the expectations of depot_tools (#163890)" (flutter/flutter#164209) 2025-02-26 [email protected] Add localization for `Back` and `Cancel` buttons in CupertinoNavigationBar (flutter/flutter#162581) 2025-02-26 [email protected] Added compilation failure if a max ubo size is exceeded (flutter/flutter#164038) 2025-02-26 [email protected] Roll Skia from 5336e20498d9 to 47b84f354604 (2 revisions) (flutter/flutter#164188) 2025-02-26 [email protected] Add a buildtools directory and move third_party/ninja to the project root in order to match the expectations of depot_tools (flutter/flutter#163890) 2025-02-26 [email protected] Roll Skia from 3ce6f25dc13e to 5336e20498d9 (9 revisions) (flutter/flutter#164174) 2025-02-26 [email protected] Roll Dart SDK from b8292dfeaa67 to 80865748abe0 (9 revisions) (flutter/flutter#164168) 2025-02-26 [email protected] [Engine] Remove dead code for RoundedSuperellipse (flutter/flutter#164163) 2025-02-26 [email protected] [Impeller] detect mediatek soc and fall back to GLES. (flutter/flutter#164126) 2025-02-26 [email protected] [Impeller] make DLOG into LOG for startup errors. (flutter/flutter#164110) 2025-02-26 [email protected] Intercept error when iOS 18.4 crashes with JIT mode and give guided error (flutter/flutter#164072) 2025-02-26 98614782+auto-submit[bot]@users.noreply.github.com Reverts "[Impeller] move AHB check to Vulkan, use Vulkan surface on 29. (#164109)" (flutter/flutter#164166) 2025-02-26 [email protected] Run new gallery transition perf benchmark on Galaxy S24 (flutter/flutter#163665) 2025-02-26 [email protected] [Impeller] move AHB check to Vulkan, use Vulkan surface on 29. (flutter/flutter#164109) 2025-02-26 [email protected] [iOS] Add platform view to integration_test example (flutter/flutter#164144) 2025-02-26 [email protected] Fix minor issues in documentation of WidgetsApp (flutter/flutter#163942) 2025-02-26 [email protected] Fix extra numbers showing up when enabling VoiceControl (flutter/flutter#163593) 2025-02-26 [email protected] Set SliverResizingHeader's maxScrollObstructionExtent to minExtent (flutter/flutter#162955) 2025-02-26 [email protected] Roll Dart SDK from aea6fff33f06 to b8292dfeaa67 (1 revision) (flutter/flutter#163973) 2025-02-26 [email protected] [DisplayList] Delete all legacy Skia-oriented method overloads in DlCanvas (flutter/flutter#164054) 2025-02-25 [email protected] Clean up leak tracker instrumentation tech debt. (flutter/flutter#164070) 2025-02-25 [email protected] Revert "Marks Linux_pixel_7pro service_extensions_test to be flaky" (flutter/flutter#163882) 2025-02-25 [email protected] Check if simctl is installed before trying to list devices or runtimes (flutter/flutter#163895) 2025-02-25 [email protected] Update dragDevices doc to include default PointerDeviceKind.trackpad (flutter/flutter#163898) 2025-02-25 [email protected] Update multiple flutters benchmark test to latest gradle and agp and gradle defined dependencies (flutter/flutter#164029) ...
Description
This PR adds localization support for the "Back" and "Cancel" buttons used in
CupertinoNavigationBar.Changes:
cancelButtonLabelandbackButtonLabelinCupertinoLocalizations.Updated all ARB files with appropriate translations._NavigationBarStaticComponentsand_BackLabelto use these labels.Auto back/close buttonin thepackages/flutter/test/cupertino/localizations_test.dart.Why is this needed?
Currently, the "Back" and "Cancel" (prev. "Close") buttons in
CupertinoNavigationBarare hardcoded in English. This update ensures they are properly localized across supported languages.Tests
One test failed (even before my changes):

Saturation is applied before blurManual Testing with the
modal_bottom_sheetPackageI tested the change using my custom mini app and the
modal_bottom_sheetpackage. I verified that the button is correctly translated into German localization.Before
After
Button Name Change: From "Close" to "Cancel"
I have renamed the button from "Close" to "Cancel" to align with the iOS native naming convention for buttons in modal dialogs.
Example:
Related Issues
CupertinoNavigationBar's "Close", "Back", and "Cancel" buttons are not localized. #48616
CupertinoNavigationBar's "Back" button is not localized #120722
Pre-launch Checklist
///).If you need help, consider asking for advice on the #hackers-new channel on [Discord].