App Intents: extract localizable strings from code at code freeze#25766
Open
crazytonyli wants to merge 3 commits into
Open
App Intents: extract localizable strings from code at code freeze#25766crazytonyli wants to merge 3 commits into
crazytonyli wants to merge 3 commits into
Conversation
iOS 18 and later resolve the widget configuration UI's App Intents strings against the app bundle, whose GlotPress-managed Localizable.strings already carries the ios-widget. keys in every locale, so the static copies in the extension bundle only served iOS 17 (verified on 17.5/18.6/26.5 simulators, including that iOS 17 has no fallback to the app bundle). The iOS 17 user base no longer justifies maintaining 34 hand-refreshed translation snapshots, so its widget configuration UI now shows the English defaults.
genstrings cannot parse LocalizedStringResource, so the App Intents strings reached GlotPress through a hand-maintained mirror of the defaultValues in code, which could silently drift and ship a new string English-only. The code freeze now extracts the call sites with xcstringstool (which understands LocalizedStringResource, including comments) and merges them into the upload like the plural originals, making code the single source of truth. Translator comments move into the code via the comment: parameter, and the mirror file is deleted.
Collaborator
Generated by 🚫 Danger |
Contributor
|
| App Name | WordPress | |
| Configuration | Release-Alpha | |
| Build Number | 33087 | |
| Version | PR #25766 | |
| Bundle ID | org.wordpress.alpha | |
| Commit | d523a8f | |
| Installation URL | 5s6ipli0vi3ho |
Contributor
|
| App Name | Jetpack | |
| Configuration | Release-Alpha | |
| Build Number | 33087 | |
| Version | PR #25766 | |
| Bundle ID | com.jetpack.alpha | |
| Commit | d523a8f | |
| Installation URL | 0adrn5f4sq0sg |
app_intents_entries duplicated current_english_values' fresh-catalog sync inline, which also pushed its ABC size past the RuboCop threshold flagged on the PR. Both now delegate to a shared synced_throwaway_catalog helper, and the empty-stringsdata guard now applies to both callers.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.


Description
Relates to #25753.
The deleted
Localizable.stringsfiles were added in #25753. They were added because, on iOS 17, the App Intents strings looks up the strings tables in the extension bundle, not the app bundle. But from iOS 18, they can look up from the app bundle. This discrepancy is validated on simulators. I'm not sure if that's the case on real devices too. I don't have an iOS 17 device.This PR simplified the localizable strings, by dropping the strings tables in the extension bundle (again, which is newly added in #25753). That means iOS 17 don't get the translated strings. I think this is an okay compromise, because we don't have many users on iOS 17 and we are going to drop it in two months.
To make sure the App Intents strings (used via
LocalizedStringResource) are translated, the code freeze now extracts theLocalizedStringResourcecall sites withxcstringstool(genstringscannot parse them) and merges them into the GlotPress upload.