From: Gaston G. <gas...@we...> - 2010-08-14 16:49:13
|
I am trying to test the resource bundles of ICU for localization. I have read a lot so far as well as found some examples, but still do not manage to get it work. What I have: Resources source files: root.txt de.txt fr.txt Example content: root.txt: root { shot { "shot" } woods { "woods" } sentence { "I heard a {0} in the {1}." } } de.txt: de { shot { "Schu" } woods { "Wäldern" } sentence { "In den {1} hörte ich einen {0}." } } I compile those into .res files by the following command #genrb root.txt de.txt fr.txt en.txt en_US.txt Then # echo de.res en.res en_US.res fr.res root.res >packagelist.txt # pkgdata --name icures --mode common -v -T tmp -d . packagelist.txt BTW, opposed to the examples I saw, I was required to have a tempdir specified with T else I get an error: Unable to move dat file (./icures.dat) to target location (./icures.dat). All these files are in the subdirectory icures/ as seen fomr the test program, after I read about the changes in processing since V2 of ICU In C++ I have the following: UErrorCode status = U_ZERO_ERROR; ResourceBundle resourceBundle("icures/icures", "de", status); if(U_FAILURE(status)) { std::cerr<<"Can't open resource bundle. Error is "<<u_errorName(status)<<std::endl; return; } Which I have also tries to use with no locale () and always get: Can't open resource bundle. Error is U_MISSING_RESOURCE_ERROR I have done many steps in trying to get this to work, but unfortunately with no success. Looking at the source code suggests that the code is not able to even find the root. Any clues would be greatly appreciated :-) Gaston. |