-
-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Description
- macOS 13.4
- IINA develop branch 3980156
Expected behavior:
English localizations should match the values in "Base" localization exactly.
Actual behavior:
Entries in iina/en.lproj/Localizable.strings
are missing or incorrect relative to iina/Base.lproj/Localizable.strings
, but because the "en" translation is present, it will always be used instead of the "Base", resulting in incorrect US English text.
Some examples:
Correct text | Actual visible text |
---|---|
"Add overlays on videos" | "Add overlay on videos" |
"Error occurred during the installation:" | "Error occured during the installation:" |
"Cannot connect" | "osd.cannot_connect" |
"Timed Out" | "osd.timed_out" |
Steps to reproduce:
As @low-batt pointed out:
The somewhat confusing IINA rules on localization require both the base and english localization files be updated. The rest are updated through Crowdin. So
Localizable.strings
underen.lproj
also needs to be updated as a part of this PR.I've been confused as to why we have to duplicate strings like this. Seems wrong. This PR got me to look into that. From Enabling Base Internationalization:
Xcode modifies your project folder according to the selections you make in this dialog. Xcode creates a Base.lproj folder in your project folder and adds to it the resource files you select. Xcode creates a language folder for the development language but only adds resources that need translation to the folder. For example, if you select English as the development language, Xcode inserts the resource file in the Base.lproj project folder but not the en.lproj folder because the resource is already in English.
Checking
info.plist
confirms the development language is set to English:
<key>CFBundleDevelopmentRegion</key>
<string>en</string>
From the Apple documentation it sounds like
en.lproj
is not needed.
I was able to confirm this by (1) selecting Localizable.strings
in XCode's Navigator, and (2) deselecting English
. When the confirmation dialog comes up, check the box to also delete the file on disk.
At this point I was able to confirm that the iina/en.lproj/Localizable.strings
was deleted, but IINA was still able to run in US English and it used the Base localization.
I set "English (US)" as the Primary language in the MacOS settings by moving it to the first line, like this:
Note: when changing Primary language, it asks you if you want to restart. You do not need to restart for it to take effect. You only need to restart IINA.
By toggling between English
and English (UK)
in the MacOS Settings after making alterations to the iina/en-gb.lproj/Localizable.strings
, I was able to confirm that "Base" localization was indeed being used as the US English localization, and only that localization.
I went back to XCode's File Inspector, and re-enabled the English localization:
At this point XCode created a new iina/en.lproj/Localizable.strings
which was clearly copied from iina/Base.lproj/Localizable.strings
, and staged the changes in Git.
By viewing the staged changes, it's apparent which entries are missing/incorrect.
Note that I did not test the bad entries directly, because they're somewhat hard to get to naturally. Instead I tried deleting / changing the entries for some of the menu items because they're much more visible, then running IINA and viewing their behavior. From that it's easy to infer the behavior of the actual bad items.