-
Notifications
You must be signed in to change notification settings - Fork 765
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
Export for Localization generates unwanted translation units #252
Comments
Any news on this issue ? Thanks |
@tomlokhorst would it be possible to cherry-pick that commit that fixed this? |
This was never properly fixed. The workaround of excluding files that are named after nibs works, but that might also exclude perfectly valid user-defined translations. The correct solution would be:
I think this issue is purely cosmetic. The currently generated code is not needed, but isn't harmful either. Therefor we should go for the proper solution instead of a quick workaround that is potentially harmful. |
I don't know why I closed this issue before, it wasn't fixed in 7.0.0. What R.swift 7 did is collect all ids that look like generated ids, for storyboards and nibs. And then did nothing with them. So that didn't change anything. This issue is fixed with #921, that finds the .strings files in *.lproj directories, that are siblings of a storyboard or nib (or intentdefinition), and then exclude those files from strings generation. |
For example when I localize launchScreen.storyboard which has a label whose ID is "cZB-if-HYR", R.generated.swift will has the following code:
This line
NSLocalizedString("cZB-if-HYR.text", tableName: "LaunchScreen", comment: "")
will cause XCode "export for localization" to generate unwanted translation unit in the xliff file:And the real translation unit for this label is already generated. And also the function
cZBIfHYRText
inR.genrated.swift
is not human-readable, I think it should be removed.The text was updated successfully, but these errors were encountered: