Good Java property files editor

13,785

Solution 1

At this point, I guess the answer is that there is no good property files editor in Java that matches the listed criteria. prbeditor sounded promising but it's gone, IntelliJ IDEA looks good on paper but is suffering a critical bug, and then the Eclipse plugins are all somewhat primitive.

Solution 2

I used plugin for eclipse. I think this one: http://sourceforge.net/projects/eclipse-rbe/

It is OK, allows adding and renaming properties, shows warnings if property is not translated to all supported languages etc.

Its disadvantage is that it always uses `\uXXXX' notation for unicode characters. So, you must use this plugin to read created files. It makes search very hard. And I do not know whether it is possible to configure it to create UTF-8 encoded bundles.

Solution 3

Check out Multiproperties, if you are still looking for such a plugin:see here

Only #6 requirement is missing.

Solution 4

Take a look at the online tool POEditor https://poeditor.com. Its project based.

Solution 5

I have been using prbeditor for some time now and I think it can handle the requirements you have:

  1. Can be done by changing the key column in the table view.
  2. Can be done by copying the key column which will actually copy the key and all the values in the different languages and then pasting it into a different table view, which will insert the key and values into the different columns of the table view.
  3. Characters can be escaped using \uXXXX, not sure if it does it only for non ISO-8591-1 characters or even for all non US-ASCII characters.
  4. \uXXXX is decoded for the editor and written back to the file as \uXXXX.
  5. The order of properties is not changed, not sure about how it handles comments.
  6. You can enter multiline text and it will correctly write to the properties file.
Share:
13,785
Kohsuke Kawaguchi
Author by

Kohsuke Kawaguchi

Updated on June 16, 2022

Comments

  • Kohsuke Kawaguchi
    Kohsuke Kawaguchi almost 2 years

    I work on an open-source Java project, and we have a lot of resource property files that contains localizable message resources. Those files are translated by volunteers to 20+ languages, and I'm a developer who primarily edits code.

    In Java, resource files for different locales are grouped together by a naming convention. For example, if the default (normally English) resource is "foo.properties", Japanese resource is in "foo_ja.properties", French one is "foo_fr.properties", etc. For the sake of this question, let's call this group a "resource group."

    Now, every so often, I need to refactor those resource files. In addition, I need the tool to support the basics of the property files. All in all, my list of requirements are something like:

    1. Renaming property key name, and I want a tool to rename all the keys in all the files in the same group, without me individually going through them.
    2. Move a property from one resource group to another, and I want a tool to do so for each resource file in the group.
    3. In Java, resource files are in the ISO-8859-1 encoding and not in the platform default encoding.
    4. I don't want to see \uXXXX when editing/browsing property files, but I do expect the tool to preserve them.
    5. I don't want the tool to rearrange the order of properties in the resource file, nor mess with the comments. I expect the tool to preserve them.
    6. I want the tool to handle other syntax details of resource files, such as multiline text.

    Unfortunately, I'm not finding any good tool that fits these criteria. I'm primarily an IntelliJ IDEA user, but it doesn't do #2 and #3. Eclipse built-in property file editor is even worse, and AFAICT it doesn't do #1, #2, #4. In fact it lacks the view that cuts across resource files in the same group. NetBeans is similarly primitive. The same goes for NetBeans, although it does #4.

    Does anyone know of a good tool that fits the bill?

  • Kohsuke Kawaguchi
    Kohsuke Kawaguchi about 13 years
    Thanks, but this one doesn't seem to support any refactoring that cuts across all the files in a resource group. Or does it? It still seems considerably worse than IntelliJ.
  • Kohsuke Kawaguchi
    Kohsuke Kawaguchi about 13 years
    Thanks for the pointer. I need to try this. The screen shot indicates this is in the right direction, but it's not clear if it supports any refactoring.
  • Kohsuke Kawaguchi
    Kohsuke Kawaguchi about 13 years
    Thanks. From your description, it sounds like it's the right tool. I happen to know a bit about java.net changes, and I'm afraid the project is deleted. Java.net decided on some pretty scary migration approach where projects had to opt-in, or else all their hardwork is permanently deleted. I suspect prbeditor didn't opt-in.
  • Gregor
    Gregor almost 10 years
    good one, and still actively developed. Only wish it had better navigation features from property to source, but I did not fully try it out yet.
  • Pascal Essiembre
    Pascal Essiembre over 9 years
    You can configure eclipse-rbe plugin NOT to convert unicode values. Look into: "Windows/Preferences/ResourceBundle Editor/Formating/Convert unicode values to \uXXXX." Also note the plugin is now on github and has a new site: essiembre.github.io/eclipse-rbe
  • Delfic
    Delfic over 6 years
    IDEA is best atm. Can't find a good standalone, though. Have you found one?