po

Gettext automatic comments generation

浪尽此生 提交于 2019-12-20 19:42:19
问题 I'm doing i18n for a php project using gettext. I'd like to use the automatic comment feature to give hints to translators when translating long phrases replaced by id. What I want to obtain is the following po file #: full-path-to-file/index.phtml:3 #. a very long text which should replaced by _('foobar') msgid "foobar" msgstr "" In this way the translator can see what he should translate when he see the key foobar using POEdit or some analogue tool in the programmer comment box. I've tried

PO file localization not working as expected for data annotation

断了今生、忘了曾经 提交于 2019-12-14 02:19:03
问题 I have used Orchard Localization in my asp.net core application. Startup.cs services.AddPortableObjectLocalization(options => options.ResourcesPath = "Resources"); services .AddMvc() .AddViewLocalization(LanguageViewLocationExpanderFormat.Suffix) .AddDataAnnotationsLocalization(); model.cs [Display(Name = "First Name")] [Required(ErrorMessage = "Customer first name required")] public string CustomerFirstName { get; set; } en.po (contains English translations) msgid "Customer first name

.po file for default cakephp libs translations

本小妞迷上赌 提交于 2019-12-12 18:26:21
问题 How to add the translations for cakephp libs files to by default.po file for example - months name - day's name - timeAgoInWords i try to add strings to default.po manually but everytime i update it from default.pot (using poedit) the strings are gone. please help me to solve it it will fine to find solution by using separate .po file 回答1: i solve it - create /app/views/dummy.ctp - duplicate by coping the translation from cake\libs\view\helpers\time.ctp to dummy.ctp - and cake i18n will add

error reading .po file in java

南笙酒味 提交于 2019-12-11 08:06:39
问题 i read a bit about reading from .po files and i still have some questions. Does anyone know if you can directly read from a .po file just like reading from a .properties file in java, or does it need to be transformed from .po to .properties? I imported the class GettextResource and : ResourceBundle rb = ResourceBundle.getBundle("stuff.po.I18n"); System.out.println(GettextResource.gettext(rb, "name_test")); Where msgid "name_test" msgstr "test" (from .po file) This does return only the string

How to convert .po to PHP array (Zend Framework) with Translate Toolkit?

ε祈祈猫儿з 提交于 2019-12-07 11:19:33
问题 I am trying to use po2php to convert my .po file to Zend php translations array. I am simply trying this: $ po2php translations.po translations.php , but this results in an error that I do not understand: po2php: warning: Couldn't handle input file translations.po: don't know what to do with input format .po, no template file . I do not know what a template file is an why should I provide it? UPDATE: I also tried $ po2php translations.po translations.php -t messages.pot , but this does not

How to convert .po to PHP array (Zend Framework) with Translate Toolkit?

我的梦境 提交于 2019-12-05 15:47:45
I am trying to use po2php to convert my .po file to Zend php translations array. I am simply trying this: $ po2php translations.po translations.php , but this results in an error that I do not understand: po2php: warning: Couldn't handle input file translations.po: don't know what to do with input format .po, no template file . I do not know what a template file is an why should I provide it? UPDATE: I also tried $ po2php translations.po translations.php -t messages.pot , but this does not help me, it shows pretty much the same error: po2php: warning: Couldn't handle input file translations.po

Removing all fuzzy entries of a PO file

让人想犯罪 __ 提交于 2019-12-04 18:10:41
问题 Does anyone know a method to mass delete all fuzzy translations from a PO file. Something like: if #, fuzzy == TRUE Then SET msgstr="" AND REMOVE #, fuzzy 回答1: You can remove fuzzy strings with polib, which is THE library in Python for working with gettext po files: import os, polib for dirname, dirnames, filenames in os.walk('/path/to/your/project/'): for filename in filenames: try: ext = filename.rsplit('.', 1)[1] except: ext = '' if ext == 'po': po = polib.pofile(os.path.join(dirname,

PO BO VO DTO POJO DAO 概念及其作用

让人想犯罪 __ 提交于 2019-12-04 00:06:27
PO(bean,entity等命名) : persistant object持久对象,数据库表中的记录在java对象中的显示状态 最形象的理解就是一个PO就是数据库中的一条记录。 好处是可以把一条记录作为一个对象处理,可以方便的转为其它对象。 BO(service,manager,business等命名): business object 业务对象 主要作用是把业务逻辑封装为一个对象。这个对象可以包括一个或多个其它的对象。 形象描述为一个对象的形为和动作,当然也有涉及到基它对象的一些形为和动作。比如处理 一个人的业务逻辑,有睡觉,吃饭,工作,上班等等形为还有可能和别人发关系的形为。 这样处理业务逻辑时,我们就可以针对BO去处理。 VO(from也有此写法) : value object值对象 主要体现在视图的对象, 对于一个WEB页面 将整个页面的属性封装成一个对象。然后 用一个VO对象 在控制层与视图层进行传输交换。 DTO (经过处理后的PO,可能增加或者减少PO的属性): Data Transfer Object数据传输对象 主要用于远程调用等需要大量传输对象的地方。 比如我们一张表有100个字段,那么对应的PO就有100个属性。 但是我们界面上只要显示10个字段, 客户端用WEB service来获取数据,没有必要把整个PO对象传递到客户端,

Removing all fuzzy entries of a PO file

时间秒杀一切 提交于 2019-12-03 11:37:10
Does anyone know a method to mass delete all fuzzy translations from a PO file. Something like: if #, fuzzy == TRUE Then SET msgstr="" AND REMOVE #, fuzzy You can remove fuzzy strings with polib , which is THE library in Python for working with gettext po files: import os, polib for dirname, dirnames, filenames in os.walk('/path/to/your/project/'): for filename in filenames: try: ext = filename.rsplit('.', 1)[1] except: ext = '' if ext == 'po': po = polib.pofile(os.path.join(dirname, filename)) for entry in po.fuzzy_entries(): entry.msgstr = '' if entry.msgid_plural: entry.msgstr_plural['0'] =

Gettext automatic comments generation

笑着哭i 提交于 2019-12-03 06:13:53
I'm doing i18n for a php project using gettext. I'd like to use the automatic comment feature to give hints to translators when translating long phrases replaced by id. What I want to obtain is the following po file #: full-path-to-file/index.phtml:3 #. a very long text which should replaced by _('foobar') msgid "foobar" msgstr "" In this way the translator can see what he should translate when he see the key foobar using POEdit or some analogue tool in the programmer comment box. I've tried with this code but it doesn't work <?php /// TRANSLATORS: a very long text which should replaced by _(