poedit

Translation of database with poedit and zend translate

独自空忆成欢 提交于 2019-12-10 10:08:56
问题 Poedit does not automatically recognise the content of a table in a database. What is the best way to get the content of a table recognized by poedit for its translation in zend. I would like it to be done automatically....do I have to create an xml file from the database ? 回答1: You should not translate database contents with poedit. You would do that inside the database. The short answer: what you want cannot be achieved, unfortunately. You can translate "fixed" strings and if you want to

How to parse Timber (twig) templates with poedit and detect quoted strings to translate

强颜欢笑 提交于 2019-12-07 08:12:31
问题 I want to parse twig templates for Timber with poedit and I need to translate quoted contents. The problem is that I can't find a parser that does not skip quoted content. Example: <htmltag attribute="{{ __('value','textdomain') }}" /> Does someone know of a parser for poedit that detects quoted content, like html attribute content? 回答1: The workaround I found is to set a variable and use it as my attribute value. {% set attr_value = __('value', 'textdomain') %} <a href='{{ attr_value }}'

Translation of database with poedit and zend translate

你离开我真会死。 提交于 2019-12-06 01:33:57
Poedit does not automatically recognise the content of a table in a database. What is the best way to get the content of a table recognized by poedit for its translation in zend. I would like it to be done automatically....do I have to create an xml file from the database ? You should not translate database contents with poedit. You would do that inside the database. The short answer: what you want cannot be achieved, unfortunately. You can translate "fixed" strings and if you want to get variables, constant or database values translated, you have to do that via literal string translations, in

PHP Gettext - No translation

不羁岁月 提交于 2019-12-05 08:09:56
I am trying to use the PHP gettext extension in order to translate some strings. All functions appear to return the correct values but calling gettext() / _() returns the original string only. The PO/MO files seem correct and I believe I have set the directories up correctly. I am running WAMP Server with PHP 5.3.10 on Windows (also tried running 5.3.4 and 5.3.8 because I have the installations). Firstly, see /new2/www/index.php : $locale = 'esn'; # returns Spanish_Spain.1252 in var dump putenv("LC_ALL={$locale}"); // Returns TRUE setlocale(LC_ALL, $locale); // Returns 'Spanish_Spain.1252'

PoEdit keywords - plurals

孤人 提交于 2019-12-04 04:52:40
I incorporated a gettext-like localization system in my app, but my translation function looks like this: t($category, $string, [$plural_string, $number, $vprintf_arguments]) My PoEdit keywords: t:2 t:2,3 t:2 tells PoEdit to parse $string , and it works apparently t:2,3 should tell PoEdit to parse both $string and $plural_string - but it's not :( It only sees $string , so I don't get the plural forms parsed... How can I fix that? I don't want to switch my function to a different argument format because I like this one :( Also this function acts like a sprintf replacement: if 3rd argument (

poedit workaround for dynamic gettext

微笑、不失礼 提交于 2019-12-04 01:17:19
问题 I have started using gettext for translating text and messages i send to user. I am using poedit as an editor, but i am struggling with dynamic messages. For example i have things like the login where i have a variable that tells the type of error. $this->translate('page-error-' . $error); When i auto update from poedit this gets read like "page-error-". What i do is have a file where i place dummy calls to the translate method with all the possible keys to have them added in my poedit when

Yii and PHP Gettext

房东的猫 提交于 2019-12-02 17:47:25
问题 I want to make my yii app multilanguage. To do this I want to use gettext (because its much simpler than yii messages). To this I used this yii extension, I configured the PO files, I made the translations, etc. The big problem: nothing happened. Nothing was translated. 回答1: I can advice you this awesome multilanguage extension! http://www.yiiframework.com/extension/tstranslation/ 回答2: To use gettext without any extension follow those steps. In config/main.php set yout target language like

Yii and PHP Gettext

戏子无情 提交于 2019-12-02 09:55:48
I want to make my yii app multilanguage. To do this I want to use gettext (because its much simpler than yii messages). To this I used this yii extension , I configured the PO files, I made the translations, etc. The big problem: nothing happened. Nothing was translated. I can advice you this awesome multilanguage extension! http://www.yiiframework.com/extension/tstranslation/ To use gettext without any extension follow those steps. In config/main.php set yout target language like this: 'language' = 'ru', Set messages component to use CGettextMessageSource : 'messages' => array( 'class' =>

xgettext does not extract string in HTML attribute

扶醉桌前 提交于 2019-12-02 03:54:51
问题 I'm working on a Wordpress site using Timber as templating engine (twig for Wordpress). I want to translate the interface using the Wordpress gettext mechanism via PoEdit (uses xgettext). Template snippet: <form action="/{{ current_language }}/api/search/{{ viewModel.currentSuperCategory.key }}" method="post" class="search-results__search" id="search-form"> <input placeholder="{{ __('City, region, ZIP', text_domain) }}…" class="input search-results__search__input" name="search-query" type=

xgettext does not extract string in HTML attribute

纵饮孤独 提交于 2019-12-02 01:45:20
I'm working on a Wordpress site using Timber as templating engine (twig for Wordpress). I want to translate the interface using the Wordpress gettext mechanism via PoEdit (uses xgettext). Template snippet: <form action="/{{ current_language }}/api/search/{{ viewModel.currentSuperCategory.key }}" method="post" class="search-results__search" id="search-form"> <input placeholder="{{ __('City, region, ZIP', text_domain) }}…" class="input search-results__search__input" name="search-query" type="text" data-search-autocomplete /> I'm using PoEdit to extract the strings from the *.twig file. It is