xgettext

bug in “django-admin.py makemessages” or xgettext call? -> “warning: unterminated string”

Deadly 提交于 2019-12-04 06:11:09
问题 django-admin.py makemessages dies with errors "warning: unterminated string" on cases where really long strings are wrapped: string = "some text \ more text\ and even more" These strings don't even need to be translated - e.g. sql query strings. The problem goes away when I concatenate the string, but the result looks ugly and it takes time to join them... Does anyone have a problem like this? Have you found a way to fix it? I have the following versions of the tools involved: xgettext-0.17,

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 (

Django MakeMessages missing xgettext in Windows

元气小坏坏 提交于 2019-12-03 12:00:43
问题 Running Django on Windows 7. I'm currently trying to translate a couple of Django templates using the instructions found in the django book chapter 19. I've added a translation tag to the template, loaded I18N, and modified django settings. Then I run django-admin.py makemessages -l en to create the po files. All folders are created but then django terminates with the following error: Error: errors happened while running xgettext on init .py 'xgettext' is not recognized as an internal or

Django MakeMessages missing xgettext in Windows

老子叫甜甜 提交于 2019-12-03 02:28:22
Running Django on Windows 7. I'm currently trying to translate a couple of Django templates using the instructions found in the django book chapter 19. I've added a translation tag to the template, loaded I18N, and modified django settings. Then I run django-admin.py makemessages -l en to create the po files. All folders are created but then django terminates with the following error: Error: errors happened while running xgettext on init .py 'xgettext' is not recognized as an internal or external command, operable program or batch file. Reading up on the problem, I've discovered that django

Recusive xgettext?

喜欢而已 提交于 2019-12-02 19:43:34
How can I compile a .po file using xgettext with PHP files with a single command recursively? My PHP files exist in a hierarchy, and the straight xgettext command doesn't seem to dig down recursively. Got it: find . -iname "*.php" | xargs xgettext I was trying to use -exec before, but that would only run one file at a time. This runs them on the bunch. Yay Google! For WINDOWS command line a simpe solution is: @echo off echo Generating file list.. dir html\wp-content\themes\wpt\*.php /L /B /S > %TEMP%\listfile.txt echo Generating .POT file... xgettext -k_e -k__ --from-code utf-8 -o html\wp

bug in “django-admin.py makemessages” or xgettext call? -> “warning: unterminated string”

落花浮王杯 提交于 2019-12-02 10:08:52
django-admin.py makemessages dies with errors "warning: unterminated string" on cases where really long strings are wrapped: string = "some text \ more text\ and even more" These strings don't even need to be translated - e.g. sql query strings. The problem goes away when I concatenate the string, but the result looks ugly and it takes time to join them... Does anyone have a problem like this? Have you found a way to fix it? I have the following versions of the tools involved: xgettext-0.17, gettext-0.17, django-1.0.2, python-2.6.2 There was a ticket on this issue, but it was closed probably

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

poedit and xml files

女生的网名这么多〃 提交于 2019-11-27 02:27:30
问题 How to configure poedit to extract strings from xml file? I have Zend Framework navigation items in .xml like this: <entry-i> <label>Text to translate</label> <params> ... <params> <entry-i> And I want poedit to read just messages from <label> s. 回答1: I have been searching for a solution as well, and I have just gotten it to work! In Poedit (I have 1.4.2), add a new parser ( Edit > Preferences ) with the following properties: Language: XML List of extensions separated by semicolons (e.g. .cpp