Skip to content
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

Preserve order of keys when saving #77

Open
achimmihca opened this issue Jan 26, 2020 · 2 comments
Open

Preserve order of keys when saving #77

achimmihca opened this issue Jan 26, 2020 · 2 comments

Comments

@achimmihca
Copy link

At the moment when saving, the keys are saved in alphabetical order.
This can introduce unwanted changes to the file. For example when doing a diff to see the changed translations. Unchanged translations might show up as well because of the new order.

Thus, I suggest to make the saving in alphabetical order configurable.

If I open a file with the following content

foo.bar=foo
bla=bla
hello=hello

And change the translation of foo.bar, then I want this change to be the only thing that differs in the newly saved file. This includes also that no newlines are added (which is the case at the moment)

After editing it should be:

foo.bar=fooBAR
bla=bla
hello=hello

At the moment it becomes:

bla=bla

foo.bar=fooBAR

hello=hello

So instead of a single translation, all lines have been changed, which makes diffs impossible. Furthermore, the newlines are annoying when editing files manually because it adds useless space. The newlines are also problematic when doing block editing (i.e. editing certain columns of multiple adjacent lines)

@k0ner
Copy link
Collaborator

k0ner commented Nov 30, 2020

@achimmihca this is a common usage of this plugin - when you have multiple languages it is easier to have keys sorted so that you can compare values in plain text file. Is there a reason why you cannot reformat your files and keep the keys in alphabetical order?

@achimmihca
Copy link
Author

We also sort our properties files. However I consider it independent from the task of this plugin (can be done with other plugin that can sort selected lines).
Altgough, sorting lines using a different plugin is not possible in combination with this because of the empty lines...

Anyway, we do not use Eclipse anymore. So from my point of view this issue can be closed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants