-
-
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
Clean up Localizations #518
Comments
@LePips I can go through and do this. I was starting to work on this for the PR I was working on but it should be pretty straight forward for me to apply this to the other labels as well. I can make a PR for this, but does this layout make sense: At this time, my testing is that I do a search for the label before I organize it. If not found, I comment out labels and try a clean build for both tvOS and iOS to see if the label didn't show up in the original search on the project. |
As a note, the indentation does not interfere with the build. Let me know if this looks too busy with the indentation. This is what looked good to me but I'm game for whatever. |
Thank you for wanting to take a look at this. I like the comments for each string, but let's not indent anything. The main issue that has prevented me from working on this over the years is determining how this interacts with Weblate/other languages and whether it will either move all of the strings or just nuke them. If it does the latter, then we cannot do this. If we have to manually perform the same movements in all files, then we'll probably need a script. For determining which strings are unused, you can use one of the following which detects unused code and you can just see what it outputs for the |
Sounds good. I can throw together a version of this and try testing for weblate. I'm assuming you mean this would break from the user side not from the build side? Otherwise, I can test to see if these localization are still active when I build and switch languages? |
Yes, the issue isn't building, but that we just don't lose translated strings. |
I'd be happy to do the re-organization and then, if the translations wouldn't map, we can toss the PR. I'm just looking for things I can help with while I'm getting better at SwiftUI on the side. So no hard feelings from me if this doesn't work out |
I've scripted this out in Python. Well, ChatGPT and I scripted this out in Python... But, I am doing:
This makes it very easy whenever we're ready to look at localizations. My only question is do we like that Localizable.strings format where it's just the String and a count of usages?
|
Option 1 is best since not everything should necessarily be lowercased since proper nouns, like Jellyfin, should be capitalized. Like you've noted, for places where we would still need title case, like section or navigation headers, we would use the However we still have discretion over what counts as a proper noun (thing). For example, in that screenshot:
I do like the organization provided by that script but would not include the count of usages. My only consideration for usages would be whether to remove unused strings. |
Literally my only issue localizedCapitalized is TV. Since it turns I just committed #1362 which removed unused localizations and alphabetizes all used localizations. I think that's a decent starting point where I can manually go in and start putting everything in sentence case with proper nouns. Either that, or I have a list of Also, do we want to store the script anywhere if we need it later? I was not super hard to do so I don't feel supper attached to it and I don't know if we'll need to rerun this in the future. Lastly, can we just do a viewModifer that uses |
The base file
Translations/en.lproj/Localizable.strings
needs to be cleaned up as:1 - there are many unused strings
2 - strings have just always been appended to the end of the file. This has lead to merge conflicts and has no organization.
So we need to find the unused strings, remove them, and then sort the remaining strings by some organization format. I was thinking sections by purpose and strings are alphabetized within each section:
As far as I know, re-organizing the strings does not cause Weblate to break.
The text was updated successfully, but these errors were encountered: