fix: make clarification for Info.plist CFBundleLocalizations
This commit is contained in:
@@ -44,6 +44,7 @@ Additionally, we check [the document about localization file path](https://learn
|
||||
macOS `.plist` and its localization mechanism involve multiple file formats. All formats of them can be browsed from their official documents:
|
||||
|
||||
- `Info.plist` file: https://developer.apple.com/library/archive/documentation/Cocoa/Conceptual/PropertyLists/UnderstandXMLPlist/UnderstandXMLPlist.html
|
||||
- Available keys and values in `Info.plist` file: https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Introduction/Introduction.html
|
||||
- `InfoPlist.strings` and other string resource files: https://developer.apple.com/library/archive/documentation/Cocoa/Conceptual/LoadingResources/Strings/Strings.html
|
||||
- UTI string: https://developer.apple.com/library/archive/documentation/FileManagement/Conceptual/understanding_utis/understand_utis_conc/understand_utis_conc.html
|
||||
|
||||
|
||||
@@ -61,6 +61,8 @@ The `--plist-template` and `--strings-template` arguments point to template file
|
||||
</array>
|
||||
```
|
||||
|
||||
Note that `CFBundleLocalizations` declares the localizations handled by the application itself rather than those discovered through the bundle localization mechanism — think of a Qt application localizing through its embedded translations. MetaGlot only knows the metadata languages (the languages receiving an `InfoPlist.strings` file), so rendering `langs` into this key assumes the application's self-handled UI languages and its metadata languages are the same set — the common case when the project translates both in lockstep. When the two differ, maintain the list in the template yourself instead of iterating `langs`. An application localizing entirely through the bundle mechanism usually does not need this key at all.
|
||||
|
||||
The source language always leads `langs` and always gets an InfoPlist.strings file: it comes from a PO file when one provides it, and is otherwise synthesized from the manifest's source strings. Every language listed in `langs` is guaranteed a complete `.lproj` folder.
|
||||
|
||||
### `--strings-template`
|
||||
|
||||
@@ -26,6 +26,13 @@
|
||||
<true/>
|
||||
<key>NSHumanReadableCopyright</key>
|
||||
<string>{{ default.strings.copyright | xml_escape }}</string>
|
||||
{% comment %}
|
||||
CFBundleLocalizations declares the localizations the application handles by itself,
|
||||
not those discovered through the bundle localization mechanism.
|
||||
This example assumes the application's UI languages (e.g. Qt-embedded translations) match its metadata languages,
|
||||
so it renders the metadata language list directly;
|
||||
maintain your own list here if the two ever differ.
|
||||
{% endcomment %}
|
||||
<key>CFBundleLocalizations</key>
|
||||
<array>
|
||||
{% for lang in langs %}
|
||||
|
||||
Reference in New Issue
Block a user