First, my issue is similar to those two :
error reading .po file in java
I want to use GNU Gettext utility for internationnalizing my app. I managed to get it working by creating a
translations.properties
file with the proper key-value pair but it wont get mytranslations_fr_CA.properties
even if I explicitly set the locale to fr_CA or Locale.CANADA_FRENCH. This was my first issue.Second and most important issue : I can't get rid of the .properties file which is crap as I can't use the nice gettext complete msgid . I managed to compile my .po file to a .class with
msgfmt --java2 [...]
but theResourceBundle
won't load without a .properties file.
Here is a zip of my current testing project : java_gettext_testing.zip
I included gnu.gettext.GettextResource in the zip to make it simpler. You can compile with javac test/*.java
and run with java test.test
Thanks for any help!