Localizing with ICU recommends keeping localizable data in XLIFF format.
So I used GNU xgettext
to extract strings to gettext
format files, and then converted them to XLIFF files with po2xliff
.
Finally I tried to use XLIFF To ICU ResourceBundle Format Converter to turn them into ICU resource format, before I found it not work. It complains the error:
The XLIFF document is invalid, please check it first:
Line 2, Column 68
Error: cvc-elt.1: Cannot find the declaration of element 'xliff'.
Almost the same error was reported years ago and is yet to be fixed.
Line 2 of the poor XLIFF file was:
<xliff xmlns="urn:oasis:names:tc:xliff:document:1.1" version="1.1">
Well, I edited the line in accordiance with example.xlf
in Localizing with ICU page (there are lots of typos in example file), retried, and ended up with:
ERROR: java.lang.NullPointerException
So what's the best practice of localizing with ICU4C and XLIFF?