How to localize a Plugin

Dear all

I want to make a Localization to my plugin, meaning to show texts in native system language, so far I have created a resources/locale folder in my maven project, inside I put two folders es (for spanish) and en (for english). The plugin compiles fine but it faults when trying to find the strings. How shall I put the structure of the folder??

I always get the error

Caused by: java.util.MissingResourceException: Can’t find bundle for base name NMQC.mo, locale es_419

Best Regards
Alex

Answering myself

dont create a locale folder, put the properties files as ProjectName_locale.properties inside the resources folder and they will be added automatically. for instance my project NMQC I create two files NMQC_en.properties and NMQC_es.properties inside resources folder and voilá. Now the question is how to handle non standard ascii characters

Answering myself again

the tool native2ascii do the job, by using it as

native2ascii -encoding utf8 source.txt output.txt

the tool is inside the bin folder in any jdk instalation

Everything is fine now, I have internationalized my plugin

Best regards and sorry for the annoyance, but this can be useful for somebody

2 Likes

Just a quick comment that support for internationalization was originally something we really wanted to do for ImageJ2, but we haven’t had the bandwidth. Still very interested in solving it for ImageJ in the future, in a general way within the framework, so that it is easier for plugin writers to provide localized versions.

See imagej/imagej#100