Conversation
The app bundle declared no localizations, so macOS showed the camera usage description in English in every language, and AppKit kept the menu items it inserts itself (Start Dictation, Emoji & Symbols, Writing Tools, AutoFill) in English as well, since those follow the bundle's localization rather than the UI catalog. Move the camera usage text into the shared catalogs as permissions.camera_usage_description, and have xtask localize the app from them in both macos bundle and macos dev-bundle, before identity stamping and signing: stamp the English value, declare every shipped locale in CFBundleLocalizations (zh-CN and zh-TW map to Apple's zh-Hans and zh-Hant), and write <localization>.lproj/InfoPlist.strings only where a catalog's value differs from English. A declared locale without a strings file falls back to the English value, so catalogs still carrying the English fill-in need no file. The dev bundle is rebuilt in place, so strings files from an earlier run are removed first. The dev Info.plist template drops its copy of the English text, which now has one owner.
|
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.
Summary
OpenLogi.appdeclares no localizations, which leaks English into a localized app in two places the UI catalogs cannot reach:NSCameraUsageDescription, which only exists in English.Deshacer · Rehacer · Cortar · Copiar · Pegar · Seleccionar todo · Writing Tools · AutoFill · Start Dictation · Emoji & Symbols. The first six come from the catalog; the last four are AppKit's, and they follow the bundle's localization, which is the English development region.This moves the camera usage text into the shared catalogs and has xtask localize the bundle from them.
Changes
support/info_plist.rs:stamp_privacy_usage_descriptions, which stamped an English literal, is replaced bylocalize_app. It readscrates/openlogi-ui/locales, stamps the English value intoContents/Info.plist, declares every locale inopenlogi_core::locale::SUPPORTEDinCFBundleLocalizations, and writesContents/Resources/<localization>.lproj/InfoPlist.stringsonly where a catalog's value differs from English.zh-CNandzh-TWmap to Apple'szh-Hansandzh-Hant; every other code is already Apple's name. It refuses an empty English value, since a camera request from a bundle without a usage description kills the app..lprojholding anything else is left alone.commands/macos/bundle.rsanddev_bundle.rscall it where the old stamp ran, before identity stamping, verification and signing.support/info_plist/tests.rs: every shipped locale maps to a distinct.lproj; the real catalogs carry every localized key; a missing key names the file and key; strings are written only for translated locales andCFBundleLocalizationsmatchesSUPPORTED; stale strings are removed without touching foreign files; an empty English value is refused.permissions.camera_usage_descriptionin all 23 catalogs, placed aftercamera_permission_description. The English value is byte-identical to the old literal; Spanish is translated; the rest carry the English fill-in until Crowdin covers them.bundle/desktop-dev/Info.plistdrops its copy of the English text, with a comment saying xtask stamps it, so the text has one owner.Nothing here touches identity:
identity::verifychecksCFBundleIdentifier, the bundle names andCFBundleIconFile, none of which change, and the helpers are untouched.Testing
No Rust toolchain on the machine I did this on, so please treat CI as the gate.
Not run:
cargo test -p xtask,cargo clippy -p xtask --all-targets -- -D warnings,cargo test -p openlogi-ui locale,cargo xtask macos bundle,cargo xtask macos dev-bundle.Formatting: all four changed Rust files are byte-identical to stable rustfmt's output with edition 2024 and max width 100, checked through the Rust Playground formatter, with
mod x;declarations stubbed so rustfmt would not try to open sibling files.External APIs, checked against the published source of the versions in
Cargo.lockrather than recalled: plist 1.10.0 (Dictionary: FromIterator<(K: Into<String>, V: Into<Value>)>,Value::from_file/to_file_xml/as_array/as_string), toml 0.8.23 (Table = Map<String, Value>,Map::get<Q>,Value::get<I: Index>withimpl<T> Index for &T,Value::as_str), andOption::is_none_or(stable since 1.82; MSRV is 1.98).Catalog parity: a Python port of
catalog_parity.rsusing the test's own line-based parser, calibrated against unmodifiedorigin/master. Result: 22 catalogs, 516 keys; key set, order and placeholders match, and every file parses as TOML.UI language is unaffected.
openlogi_core::localepicks the language through sys-locale 0.3.2, whose Apple backend callsCFLocaleCopyPreferredLanguages(the user's preference list), not the bundle-negotiatedCFLocaleCopyCurrent. Adding localizations does not change which catalog OpenLogi loads.The artifact format, on macOS 26. A throwaway bundle, not OpenLogi, with
CFBundleLocalizationsand anes.lproj/InfoPlist.stringswritten as a UTF-8 XML property list (the formatplist::Value::to_file_xmlproduces), queried through Foundation with-AppleLanguagesset per process:NSCameraUsageDescriptiones-ES,es-MXesInfoPlist.stringspt-BR(declared, no strings file)pt-BRzh-Hans-CNzh-Hanszh-Hant-TWzh-Hantzh-Hant-HKzh-HKThe same run showed that
pt-PTnegotiatespt-BRunlesspt-PTis declared too; it is, since it is inSUPPORTED.Not runtime-tested with a real OpenLogi build or camera. To check, with macOS set to Spanish:
cargo run -p openlogi-desktop, thentccutil reset Camera org.openlogi.openlogi-devand open a Logitech webcam's page, so the prompt appears with the Spanish reason. The Edit menu should also show AppKit's items in Spanish.Note
Declaring localizations also makes OpenLogi selectable under System Settings → General → Language & Region → Applications. Since sys-locale reads the preference list, that setting takes effect for the GUI. The agent and overlay are separate bundles with their own defaults domains, so they keep following the system language there. OpenLogi's own Language setting remains the way to switch all three processes together.