Update iOS section of AppLocalizations template to current Xcode workflow#186142
Update iOS section of AppLocalizations template to current Xcode workflow#186142ishaquehassan wants to merge 2 commits into
Conversation
…flow The fileTemplate doc comment in gen_l10n_templates.dart describes the old Info.plist based localization workflow. That guidance ships at the top of every generated AppLocalizations class, so every project that runs flutter gen-l10n ends up with stale iOS setup instructions. Replace the iOS Applications paragraph with the project based workflow that matches the current Flutter site documentation: open ios/Runner.xcodeproj, select the Runner project, open the Info tab, and add supported languages under the Localizations section. Fixes flutter#184916
There was a problem hiding this comment.
Code Review
This pull request updates the documentation for configuring iOS localizations in gen_l10n_templates.dart, replacing manual Info.plist instructions with steps for the Xcode project editor. Feedback includes a suggestion to rephrase repetitive language for better readability and a recommendation to use the .xcworkspace file instead of .xcodeproj to maintain consistency with standard Flutter CocoaPods configurations.
| /// To ensure the App Store entry correctly displays the supported | ||
| /// languages, add the supported languages in the Xcode project. |
There was a problem hiding this comment.
The phrase 'supported languages' is repeated in consecutive lines. Rephrasing improves readability.
| /// To ensure the App Store entry correctly displays the supported | |
| /// languages, add the supported languages in the Xcode project. | |
| /// To ensure the App Store entry correctly displays the supported | |
| /// languages, add them to your Xcode project. |
References
- Optimize for readability: Code is read more often than it is written. (link)
There was a problem hiding this comment.
Good catch, applied your suggestion in the latest commit. Reads cleaner without the repeat.
| /// | ||
| /// Next, select the Information Property List item, select Add Item from the | ||
| /// Editor menu, then select Localizations from the pop-up menu. | ||
| /// 1. Open your project's `ios/Runner.xcodeproj` Xcode file. |
There was a problem hiding this comment.
Flutter projects typically use CocoaPods, which requires opening the .xcworkspace file rather than the .xcodeproj file to ensure all dependencies and workspace settings are correctly loaded. This also aligns with the official Flutter documentation cited in the PR description.
| /// 1. Open your project's `ios/Runner.xcodeproj` Xcode file. | |
| /// 1. Open your project's ios/Runner.xcworkspace Xcode workspace file. |
References
- Documentation should be useful: Explain the why and the how. (link)
There was a problem hiding this comment.
Agreed, switched to Runner.xcworkspace to stay consistent with the CocoaPods workflow that Flutter projects use. Updated in the latest commit.
|
@LouiseHsu from triage |
Description
The
fileTemplateconstant inpackages/flutter_tools/lib/src/localizations/gen_l10n_templates.dartcarries the doc comment that ships at the top of every generatedAppLocalizationsclass. Its## iOS Applicationssection still describes the oldInfo.plistbased workflow (openios/Runner.xcworkspace, locate theInformation Property Listitem, add aLocalizationsentry there). Every project that runsflutter gen-l10nends up with stale iOS setup instructions in its generated localization file.This PR replaces that paragraph with the project based workflow that matches the current Flutter site documentation: open
ios/Runner.xcodeproj, select the Runner project, open theInfotab, and add supported languages and regions under theLocalizationssection. The wording follows the guidance at https://docs.flutter.dev/ui/internationalization#localizing-for-ios-updating-the-ios-app-bundle and the text proposed by the reporter on the issue.The change is doc-only inside a template string. There is no code behavior change.
Fixes #184916
Pre-launch Checklist
///).