po

Benefits of compiling po files to mo

拜拜、爱过 提交于 2021-02-08 01:50:08
问题 What's the benefit and primary reason for compiling GNU gettext .po (Portable Object) files to .mo (Machine Object) ? I saw many programs reading/parsing .po directly. I'm not using wordpress but on their docs it says: https://codex.wordpress.org/I18n_for_WordPress_Developers PO files are compiled to binary MO files, which give faster access to the strings at run-time Is faster access true? PO can be read only once and cached in some hash table, the same probably goes for MO 回答1: There are

how to insert the table at the specified location with poi XWPF?

旧巷老猫 提交于 2020-08-26 10:10:07
问题 I made a mark in a .docx file like ${table} ,and now I want insert a table with apache poi xwpf in this marked place. In other words I want to replace this mark ${table} with a table. Here is my code List<XWPFParagraph> parasList = document.getParagraphs(); for(XWPFParagraph paragraph:parasList){ String paraText=paragraph.getText(); if(paraText.equals("${table}")) { System.out.println("find:"+paraText); int pos=document.getPosOfParagraph(paragraph); XWPFTable newT=document.createTable();

how to insert the table at the specified location with poi XWPF?

最后都变了- 提交于 2020-08-26 10:09:45
问题 I made a mark in a .docx file like ${table} ,and now I want insert a table with apache poi xwpf in this marked place. In other words I want to replace this mark ${table} with a table. Here is my code List<XWPFParagraph> parasList = document.getParagraphs(); for(XWPFParagraph paragraph:parasList){ String paraText=paragraph.getText(); if(paraText.equals("${table}")) { System.out.println("find:"+paraText); int pos=document.getPosOfParagraph(paragraph); XWPFTable newT=document.createTable();

CakePHP translations in one or multiple po files and performance

穿精又带淫゛_ 提交于 2020-01-17 04:20:09
问题 Does making the i18n tool of CakePHP making its po file in single one file better than multiple files. Here I meant by performance. Personally, I prefer single one file I regarded it easier to translate the application, but I mean the performance of the application on the server. 回答1: I think that one file is better than multiple files, due to the performance used when opening and closing multi files is greater than opening one file regarding-less its size. 来源: https://stackoverflow.com

CakePHP translations in one or multiple po files and performance

不羁岁月 提交于 2020-01-17 04:20:06
问题 Does making the i18n tool of CakePHP making its po file in single one file better than multiple files. Here I meant by performance. Personally, I prefer single one file I regarded it easier to translate the application, but I mean the performance of the application on the server. 回答1: I think that one file is better than multiple files, due to the performance used when opening and closing multi files is greater than opening one file regarding-less its size. 来源: https://stackoverflow.com

Is there a Java library for parsing gettext PO files? [closed]

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-31 17:59:17
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 6 years ago . 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. 回答1: According to Java gettext utilities Manual you may convert PO file to a ResourceBundle class using msgfmt --java2 program and read it using java.util

Is there a Java library for parsing gettext PO files? [closed]

爷,独闯天下 提交于 2019-12-31 17:59:12
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 6 years ago . 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. 回答1: According to Java gettext utilities Manual you may convert PO file to a ResourceBundle class using msgfmt --java2 program and read it using java.util

boost translate: po file not work

笑着哭i 提交于 2019-12-24 13:52:43
问题 I was used boost::locale to make a multilanguage exe, but it doesn't work. The exe always output "Hello World". How can it output "您好"? I used the example code from http://www.boost.org/doc/libs/1_53_0/libs/locale/doc/html/messages_formatting.html #include <boost/locale.hpp> #include <iostream> using namespace std; using namespace boost::locale; int main() { generator gen; // Specify location of dictionaries gen.add_messages_path("."); gen.add_messages_domain("hello"); // Generate locales and

Combining keys and full text when working with gettext and .po files

ε祈祈猫儿з 提交于 2019-12-23 07:46:31
问题 I am looking at gettext and .po files for creating a multilingual application. My understanding is that in the .po file msgid is the source and msgstr is the translation. Accordingly I see 2 ways of defining msgid : Using full text (e.g. "My name is %s.\n" ) with the following advantages: when calling gettext you can clearly see what is about to be translated it's easier to translate .po files because they contain the actual content to be translated Using a key (e.g. my-name %s ) with the

How to I mark an empty translation (msgstr) as translated in po gettext files?

限于喜欢 提交于 2019-12-20 20:30:14
问题 I found that is the translation for a string (msgid) is empty all gettext tools will consider the string as untranslated. Is there a workaround for this? I do want to have an empty string as the translation for this item. 回答1: As this seems to be a big design flaw in the gettext specification, I decided to use: Unicode Character 'ZERO WIDTH SPACE' (U+200B) inside these fields. 回答2: I realize this is an old question, but I wanted to point out an alternate approach: msgid "This is a string"