Plugin for automatic property file sorting

已回答

We are developing a plugin to sort property files by keys. Currently we can invoke the sorting manually, but the resource bundle editor will be used by non-tech guys as well.

Is there a way to get notified when a file was modified in order to perform the sorting?

Very happy to get a poke in the right direction :-)

0
正式评论

Hi, Andreas,

you can use simply use PsiTreeChangeListener (sure if a modification was made inside properties files editor).

BTW we already have an inspection AlphaUnsortedPropertiesFileInspection to detect such cases + Resource Bundle Editor preserves sorting order if it's possible while editing.

 

Avatar
Permanently deleted user

Hi Dmitry,

wow that was fast. Thanks for pointing us in the right direction.

I tried the inspection and it looks like this is exactly what we are after :-)

Thanks!

0
Avatar
Permanently deleted user

BTW is your plugin available for download? It sounds like something I could use!

0

Hubert, it's already available in IntelliJ IDEA installation when properties support plugin is enabled. 

0
Avatar
Permanently deleted user

I use Properties Support plugin already but it doesn't allow me to sort properties.

0

Hubert, search for "Properties File or Resource Bundle is Alphabetically Unsorted" inspection in inspection settings. It should be disabled by default.

1

Can you sort all resource files in a project in one go, instead of doing the sort per resource bundle?

0
Avatar
Permanently deleted user

We use lokalise.com as a service for translation of property files and integration with Github.

The problem with the this inspection is that is not possible to change the sort order (alphabetically, ascii)

In the following sample, the last line would be placed first by the inspection...

GenerateMissingDescriptionsSetting.LONGTEXT_DIMENSIONTEST = Aus Kombination von Langtext und Dimensionstext
GenerateMissingDescriptionsSetting.LONGTEXT_DIMENSIONTEST.started = Fehlende Artikelbeschreibungen werden aus der Kombination von Langtext und Dimensionstext der Artikel generiert.
GenerateMissingDescriptionsSetting.LONGTEXT.started = Fehlende Artikelbeschreibungen werden aus dem Langtext der Artikel generiert.
0

请先登录再写评论。