eclipse-rbe icon indicating copy to clipboard operation
eclipse-rbe copied to clipboard

Preserve order of keys when saving

Open achimmihca opened this issue 5 years ago • 2 comments

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)

achimmihca avatar Jan 26 '20 13:01 achimmihca

@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?

k0ner avatar Nov 30 '20 23:11 k0ner

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.

achimmihca avatar Dec 01 '20 06:12 achimmihca