-
-
Notifications
You must be signed in to change notification settings - Fork 121
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
Add option to sort translations by keys in resulting Strings files #26
Comments
I would also consider time sort option - it means that new strings will be added at the end. Because I often find myself searching through the localizable file to find a new key I've just added. |
@kafejo That should be the current behavior though, are you sure it's not the case for you? |
Actually I've examined it and current behaviour sorts it by key! Strange 😅
We use Bartycrouch run script in aggregated target
|
I'm sorry, I still don't get it. What's sorted about those keys in your example? As far as I can see If those keys were sorted then the order would need to be: C-A-B. But if the quoted file is the result of BartyCrouch then it's clearly not sorting by anything, instead it's just adding new ones as it should. Btw: I think the best way to explain any odd behavior you wouldn't expect is to fork BartyCrouch, add a new test case that reproduces the unexpected behavior and send it in as a pull request marked as |
I just happened to come across this same issue in a project where PhraseApp is used. Gonna investigate this and report once I have results. |
@kafejo I have just added a simple test in fa9739d to reproduce the issue we both have come across but without success. I expected the test to fail as we have both seen such a thing happen but it didn't – the new key was added at the end of the file. I also copied the entire |
Nice. I will take a look at it. |
@kafejo I just found the issue with the reordering of existing keys and fixed it – just update to version 3.3.5 to see for yourself. I hope that fixes your issue! :) |
Cool! Thanks! 🎉 |
I just implemented this feature and released a new version with it – use the |
Please note that I just released version 3.5.1 which changes the behavior of the sort-by-keys option slightly: It sorts entries with empty translations to the end so untranslated keys can be easily found as expected. Another run of BartyCrouch after translating the keys will sort them correctly. I think this is gonna make this option much more useful in practice! :) |
Currently when a Strings file is saved the order of the translations isn't changed, new translations are simply added at the end of the list. There should be an option to sort them by keys which is especially useful for the
code
sub command when using structured keys like 'SETTINGS.USER_SECTION.LOGOUT'.The text was updated successfully, but these errors were encountered: