Add option for sorting in case-sensitive order to add-on "Format the Java properties file"
HaaiHenkie opened this issue · comments
Describe the problem
In my repository I sort the strings in the Java properties files by their key in a case-sensitive order. I noticed that newly translated strings are appended to the end of the properties file. That is why I tried the add-on "Format the Java properties file" which sorts the strings. However it is doing that in a case-insensitive order. This is giving a lot of difference to process when merging the new translations into my repository. So for the moment I am better of not using the add-on "Format the Java properties file".
Describe the solution you would like
I would like the add-on "Format the Java properties file" to have a configuration option to sort the entries in a case-sensitive order.
Describe alternatives you have considered
Maybe the properties files for the translations could stick to the key order of the monolingual base properties file. I think that is more difficult to implement.
Screenshots
No response
Additional context
Not relevant to me, but you could add other common format options like "Align properties in columns" and "Insert space around key-value delimiter"
This issue seems to be a good fit for newbie contributors. You are welcome to contribute to Weblate! Don't hesitate to ask any questions you would have while implementing this.
You can learn about how to get started in our contributors documentation.
Indeed, the current implementation is case-insensitive, adding an option to make it case-sensitive should be pretty easy. Related code is here: https://github.com/WeblateOrg/weblate/blob/main/weblate/addons/properties.py
Hi guys, check my PR #11933 for this issue.
Thank you for your report; the issue you have reported has just been fixed.
- In case you see a problem with the fix, please comment on this issue.
- In case you see a similar problem, please open a separate issue.
- If you are happy with the outcome, don’t hesitate to support Weblate by making a donation.