Questions tagged [xgettext]
104 questions
3
votes
2 answers
xgettext --join-existing resulting multiple comments in my pot file
I've a build script that scan source dir (PHP) and execute the xgettext --join-existing ... for updated translation and save into a pot file, e.g.
find . -type f -name '*.php' -not -path './vendor/*' |
xargs xgettext --join-existing --keyword=_e…

Ryan
- 10,041
- 27
- 91
- 156
3
votes
1 answer
Localization with django and xgettext
I am working on translation of my site, but when I try to run command:
manage.py makemessages --locale=bs
I constantly get error like:
CommandError: errors happened while running xgettext on rjsmin.py
xgettext: Non-ASCII string at…

Haris Bašić
- 1,383
- 2
- 12
- 21
3
votes
2 answers
Getting translation strings for jinja2 templates integrated with django 1.x?
I can use jinj2 templates with django via render_to_response defined as below
from django.conf import settings
from django.core.exceptions import ImproperlyConfigured
from django.http import HttpResponse
from django.template import…

altunyurt
- 2,821
- 3
- 38
- 53
3
votes
0 answers
creating translations - painless
The current way I create translation catalogs and manage translations is:
generate headers from all non source code file types (glade, .desktop, ...) via intltool
use xgettext to gather all strings from all *.[ch] files and generata a .pot
do…

drahnr
- 6,782
- 5
- 48
- 75
3
votes
0 answers
Merge process for gettext - how to remove old strings
I want to improve my gettext translation file process, so I only have one .po file for the application, to avoid duplicated translation work when I send my files to translation agencies and reducing onload merging.
The challenges is that the initial…

stadskle
- 31
- 1
3
votes
2 answers
PoEdit doesn't recognize _n() plurals
I've got this set in source keywords of POEdit:
_
__
_e
_ex
_n
esc_attr_e
_x
_nc
It works but I gets only first string when I use _n() function (Twenty Eleven theme):

Atadj
- 7,050
- 19
- 69
- 94
2
votes
3 answers
xgettext in OSX to create .po file from PHP code
I'm on Mac OSX, and I'm unable to find a good solution to parse PHP Code and extract the translatable strings.
I've tried PoEdit, but it fail with an anti-verbose trunkated error:
I've also tried Virtaal, but the app crash when I click "Open",…

FMaz008
- 11,161
- 19
- 68
- 100
2
votes
1 answer
Let xgettext find keywords in comments
As default, xgettext ignores any keyword found within a comment block.

ANisus
- 74,460
- 29
- 162
- 158
2
votes
1 answer
xgettext incorrectly infers 'c-format' in cpp files
I have a bunch of .cpp files which contain text including a literal percent sign. Those files don't use printf at all, they use iostream stuff:
std::cout << _( "50 % of 10 is 5" ) << std::endl;
However, strings containing % are still marked as…

Dmitry Grigoryev
- 3,156
- 1
- 25
- 53
2
votes
1 answer
xgettext does not extract string in HTML attribute
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:
2
votes
1 answer
gettext under windows 7 for java project returns 'Bad file descriptor'
I'm trying to use gettext in java project to provide translations for different languages.
My workstation runs Windows 7 and so I'd like to be able to go through whole build process on it (including keys generation and translations update - all from…

alwi
- 431
- 6
- 21
2
votes
1 answer
Zend Framework 2 translate using gettext a text with variables
How I have to do for translate a string as this, where $user contains the user name?
$message = 'Hello ' . $user . ', how are you';
If I translate using the follow code, it don't works.
$message = $translator->translate('Hello ' . $user .…

josepmra
- 617
- 9
- 25
2
votes
1 answer
I get no output from xgettext
I will try to use gnu-gettext for localization of a semi-big software project, so now I'm trying to learn the basics. Problem is that I got stuck on a pretty fundamental function. When I try to extract the strings from the sourcecode using xgettext…

RobertM
- 61
- 6
1
vote
2 answers
Poedit regex based parser?
In our JS files we use the following format for Gettext translation:
var str1 = '!t[The text that should be translated]';
var str2 = '!t[Some more text]';
This JS files will be parsed using PHP and the parsed strings get translated via Zend…

Marius Burz
- 4,555
- 2
- 18
- 28
1
vote
1 answer
How do I extract translatable strings from a glade (Builder) file?
In command prompt I wrote:
C:\Users\Waqar Ali Khan\Documents\NetBeansProjects\MedicalEmergency>xgettext -d
MedicalEmergency -o LocaleStrings.pot main.cpp MedicalEmergency.glade
xgettext: Language "glade" is not supported. xgettext relies on…

Waqar Ali Khan
- 11
- 7