Skip to content

Update iOS section of AppLocalizations template to current Xcode workflow#186142

Open
ishaquehassan wants to merge 2 commits into
flutter:masterfrom
ishaquehassan:fix/184916-applocalizations-ios-docs
Open

Update iOS section of AppLocalizations template to current Xcode workflow#186142
ishaquehassan wants to merge 2 commits into
flutter:masterfrom
ishaquehassan:fix/184916-applocalizations-ios-docs

Conversation

@ishaquehassan

Copy link
Copy Markdown
Contributor

Description

The fileTemplate constant in packages/flutter_tools/lib/src/localizations/gen_l10n_templates.dart carries the doc comment that ships at the top of every generated AppLocalizations class. Its ## iOS Applications section still describes the old Info.plist based workflow (open ios/Runner.xcworkspace, locate the Information Property List item, add a Localizations entry there). Every project that runs flutter gen-l10n ends 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 the Info tab, and add supported languages and regions under the Localizations section. 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

…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
@github-actions github-actions Bot added the tool Affects the "flutter" command-line tool. See also t: labels. label May 6, 2026

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment on lines +57 to +58
/// To ensure the App Store entry correctly displays the supported
/// languages, add the supported languages in the Xcode project.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The phrase 'supported languages' is repeated in consecutive lines. Rephrasing improves readability.

Suggested change
/// 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
  1. Optimize for readability: Code is read more often than it is written. (link)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

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.

Suggested change
/// 1. Open your project's `ios/Runner.xcodeproj` Xcode file.
/// 1. Open your project's ios/Runner.xcworkspace Xcode workspace file.
References
  1. Documentation should be useful: Explain the why and the how. (link)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed, switched to Runner.xcworkspace to stay consistent with the CocoaPods workflow that Flutter projects use. Updated in the latest commit.

@bkonyi bkonyi added the team-ios Owned by iOS platform team label May 25, 2026
@vashworth vashworth requested a review from hellohuanlin May 28, 2026 21:42
@LongCatIsLooong LongCatIsLooong added the CICD Run CI/CD label Jun 18, 2026
@okorohelijah

Copy link
Copy Markdown
Contributor

@LouiseHsu from triage

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CICD Run CI/CD team-ios Owned by iOS platform team tool Affects the "flutter" command-line tool. See also t: labels.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Proposal:Update AppLocalizations iOS Documentation

5 participants