marhali / easy-i18n

This is a IntelliJ IDE based plugin for internationalization. Supports the most common translation file types.
MIT License
78 stars 24 forks source link

YAML sorting is messed up #284

Open xurei opened 1 year ago

xurei commented 1 year ago

When I try to add/edit the translations in the Table View, the YAML files produced are not sorted anymore.

Here are two samples of one of my YAML files:

Before

aaa.bbb: AAA BBB
common.abort: Abort
common.battery: Battery
common.cancel: Cancel
common.change: Change
common.close: Close
common.connect: Connect
common.connected: Connected
common.no: 'No'
common.ok: OK
common.retry: Retry
common.status: Status
common.today: Today
common.unknown: Unknown
common.yes: 'Yes'
common.yesterday: Yesterday

After adding "common.test"

common.cancel: Cancel
common.status: Status
common.battery: Battery
common.connect: Connect
common.test: Test
common.change: Change
common.no: 'No'
common.yesterday: Yesterday
common.close: Close
common.retry: Retry
common.yes: 'Yes'
common.ok: OK
common.today: Today
common.unknown: Unknown
common.abort: Abort
aaa.bbb: AAA BBB
common.connected: Connected

My guess is a Map<> is reordering the keys somehow. This does not happen with JSON files.

uurshin commented 8 months ago

I have the same problem with my .yaml files. The "tree view" and "table view" tabs show the key in alphabetical order, but each time I edit a key, it changes the order of the keys in all locale files to something weird and not alphabetical.