Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix subtitles override level not localized, #4892 #4893

Merged
merged 1 commit into from May 22, 2024
Merged

Conversation

low-batt
Copy link
Contributor

This commit will:

  • Add key-value pairs for the yes, force and strip override levels to the base and en Localizable.strings files
  • Change the transformedValue method in the ASSOverrideLevelTransformer class to return a localized string instead of the enum value string

This localizes the value displayed for the Override level setting found in the ASS Subtitles section on the Subtitle tab in IINA's settings.


Description:

This commit will:
- Add key-value pairs for the yes, force and strip override levels to
  the base and en Localizable.strings files
- Change the transformedValue method in the ASSOverrideLevelTransformer
  class to return a localized string instead of the enum value string

This localizes the value displayed for the Override level setting found
in the ASS Subtitles section on the Subtitle tab in IINA's settings.
@low-batt low-batt linked an issue Apr 26, 2024 that may be closed by this pull request
1 task
@low-batt
Copy link
Contributor Author

One issue I did not address is that the text field holding the label is being sent to translators even though that value will never be used. Run this command to see the translations:

grep -inr --include \*.strings 3H8-Ei-cTm *

I did not find a way in Xcode to exclude this text field from localization. Did I miss something?

Because Crowdin is not able to read an XIB file as discussed in #4468 we have to use the English strings file. Would deleting the entry for the object ID 3H8-Ei-cTm from the English translations remove this translation from Crowdin?

Searching the net I found people using various methods, for example a reply to the stack overflow post Marking some XIB/Storyboard strings as not localizable suggests using as special phrase in the Localizer Hint XIB field and then using XMLStarlet to detect and delete elements from the XLIFF.

We might want to have some sort of Localizer Hint convention even when relying upon not putting the object ID into the English strings file to make it clear that a particular object should not be localized.

@low-batt low-batt requested a review from uiryuu April 26, 2024 03:54
@uiryuu uiryuu merged commit e739250 into develop May 22, 2024
1 check passed
@uiryuu uiryuu deleted the sub-level branch May 22, 2024 06:07
@low-batt
Copy link
Contributor Author

@uiryuu Don't forget about my question as to how we should deal with objects that should not be sent to translators.

@uiryuu
Copy link
Member

uiryuu commented May 23, 2024

@low-batt Sorry, I didn't read the thread.

I did not find a way in Xcode to exclude this text field from localization. Did I miss something?

I don't think there's a way to do so. I believe I have also did some research on this without success.

Would deleting the entry for the object ID 3H8-Ei-cTm from the English translations remove this translation from Crowdin?

I'll test this, and try to find a way to do this semiautomatically with the Localizer Hint.

uiryuu added a commit that referenced this pull request May 23, 2024
- Remove strings like "Box", "Text Cell" which will not displayed in the UI
- Remove Chrome and Firefox in the localization
- Remove "strip" in `PrefSubViewController`, which will be replaced in
  in UI in runtime (#4893)
- Added `NSHumanReadableCopyright` in `InfoPlist.strings`
lhc70000 pushed a commit that referenced this pull request May 24, 2024
* Remove unused strings (don't translate)

- Remove strings like "Box", "Text Cell" which will not displayed in the UI
- Remove Chrome and Firefox in the localization
- Remove "strip" in `PrefSubViewController`, which will be replaced in
  in UI in runtime (#4893)
- Added `NSHumanReadableCopyright` in `InfoPlist.strings`

* Added back Chrome and Firefox for localization
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.

Subtitles override level not localized
2 participants