Does anyone know of a Java library that will let me parse .PO files? I simply want to create a Map of IDs and Values so I can load them into a database.
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
According to Java gettext utilities Manual you may convert PO file to a ResourceBundle class using
msgfmt --java2program and read it using java.util.ResourceBundle or gnu.gettext.GettextResource – I suppose it to be a most efficient way. Gettext-commons do exactly the same including intermediate process creation to call msgfmt because it is positioned as following:If you still want exactly a Java library then the only way I see is to write your own library for parsing this format i.e. rewrite msgfmt source code from C to Java language. But I’m not sure it will be faster than create process + run C program.