Repository navigation
Localize the remaining texts of SearchableGridPicker and MultiSelector - #19
Merged
Merged
Conversation
"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.
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.
Overview
"None" in
SearchableGridPickerand the macOS "Done" inMultiSelectorwere looked up in the app's main bundle, so they stayed English although the package catalog has both in all 37 languages. They now usebundle: .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 asSearchableGridPicker), 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
LocalizationTestsreads the expected languages fromLocalizable.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: .moduleremoved again (main's lookup):Green, this branch:
The empty search state has no unit test; it is Apple's
ContentUnavailableView.search.