-
-
Notifications
You must be signed in to change notification settings - Fork 291
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
[iOS & tvOS] Unused Localization Cleanup #1362
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The next step in this process, I have a remove with all "Strings" that exist in Swiftin.
This should not be the end goal. Strings in logging statements and assertions shouldn't be localized as these are largely developer facing and are used for debugging. Only strings that face the user through official use/design should be localized.
I'm going to wait for some of the outstanding PRs then re-run this script but this time only remove unused localization. I jumped the gun a little adding new localizations in. It'll be easier to re-run the script that to try and dissect out my |
e77569e
to
d580e8d
Compare
@LePips Re-ran this on current Main. All this does is remove unused Strings from localization. Existing strings are alphabetized and the comment about them is the content of the string in English. The only freeform item I added to this is I've updated the list of removed localizations on the main section of this post. Below are 2 files output from the script.
For now, I'm happy with the 2 steps we've already taken. The first being localize strings that have existing localizations. The second because remove unused localizations. |
If we ever needs this again, here is the Python Script I used. It's not the best thing in the world but it works. You point it at the project folder, the en.lproj/translation.swift file, and you can provide a file containing file paths that you want it to ignore. I'm just providing this for documentation. If you need me to re-run this to clean up localizations, feel free to ping me!
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I do like the cleanup and removing all of these unused strings. My only concern is that in the future we may want to reintroduce strings, like Refresh
, but I think starting fresh and working from the ground up now is good.
Regarding the scripts, I think something written in Swift that sorts the main .strings
file prior to swiftgen
would be cool to have.
I think we'll be fine when it comes to the Weblate but we'll see and can revert if necessary.
That's a great idea! I moved this over the Swift and added it to the Build Phase before |
Summary
Removes Localizations with no usages in code. Alphabetizes localizations and cleans up comments. This is a must more intrusive part of #518. This may change our webplates but Swiftfin itself will be unchanged.
Some localizations may be worth retaining for future usage. An example of this is
WIP
is currently unused but if we ever need something to be tagged asWIP
in the future it will be good to keep this localized.I have validated that both tvOS and iOS still appropriately build with these removed. The next step in this process, I have a remove with all
"Strings"
that exist in Swiftin. Most of them are fine like" / "
but I'll submit another PR with the unlocalized strings localized.The following localizations will be removed by this PR. Let me know if any of these should be retained and I can place them back in: