Skip to content

Localize the remaining texts of SearchableGridPicker and MultiSelector - #19

Merged
Jeehut merged 2 commits into
mainfrom
wip/localize-picker-texts
Oct 15, 2026
Merged

Jeehut merged 2 commits into
mainfrom
wip/localize-picker-texts

Conversation

@Jeehut

@Jeehut Jeehut commented Oct 14, 2026

Copy link
Copy Markdown
Member

Overview

"None" in SearchableGridPicker and the macOS "Done" in MultiSelector were looked up in the app's main bundle, so they stayed English although the package catalog has both in all 37 languages. They now use bundle: .module.

The empty search state said "No emojis match '…'" even when the picker lists SF Symbols, and was not localized. It is now ContentUnavailableView.search(text:) (same availability as SearchableGridPicker), which is neutral about the option type and uses Apple's wording in every language. The two catalog keys it replaces ("No matches", "No emojis match '%@'") are removed as unused.

Split out of #7. Adds the renderedPixels(of:) test helper.

How this was verified

LocalizationTests reads the expected languages from Localizable.xcstrings, checks that both keys are translated into each, and renders "None" and "Done" under every language's locale, expecting something other than the English source.

Red, with bundle: .module removed again (main's lookup):

✘ doneButtonTextIsLocalized(language:) "ar", "bg", "ca", "cs", …: render(text) != englishSource
✘ noSelectionTextIsLocalized(language:) "bg", "ca", …: render(text) != englishSource

Green, this branch:

✔ Test run with 4 tests in 1 suite passed.

The empty search state has no unit test; it is Apple's ContentUnavailableView.search.

"None" in SearchableGridPicker and "Done" in the macOS sheet of
MultiSelector were looked up in the app's main bundle, so they stayed
English although the package's catalog has them in 37 languages. They
now use bundle: .module.

The empty search result showed "No emojis match", which is wrong when
the picker lists SF Symbols, and was not localized either. It now uses
the system's ContentUnavailableView.search(text:), which is available
wherever SearchableGridPicker is and uses Apple's own wording in every
language. The two catalog keys it replaces are removed as unused.
The localization test hard-coded 37 languages. It now reads the
languages from the catalog file and compares them with the compiled
bundle, so adding a language needs no test change.
@Jeehut
Jeehut merged commit 03b8abb into main Oct 15, 2026
5 checks passed
@Jeehut
Jeehut deleted the wip/localize-picker-texts branch October 15, 2026 10:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant