1
我讀了一些關於從.po文件讀取數據的內容,但仍然有一些問題。有誰知道你是否可以直接從.po文件讀取數據,就像從java中的.properties文件中讀取數據一樣,還是需要從.po轉換爲.properties?在java中讀取.po文件時出錯
我進口類GettextResource和:
ResourceBundle rb = ResourceBundle.getBundle("stuff.po.I18n");
System.out.println(GettextResource.gettext(rb, "name_test"));
凡 MSGID 「name_test」 msgstr 「測試」(從.po文件)
但這僅返回字符串 「name_test」。 我顯然不知道我在這裏做什麼... 任何想法將不勝感激。謝謝。
類似於http://stackoverflow.com/questions/4635721/is-there-a-java-library-for-parsing-gettext-po-files – MeBigFatGuy