Questions tagged [xgettext]
104 questions
4
votes
1 answer
xgettext - How to extract strings split by nulls
There's an issue in extracting strings (with xgettext) from gst-plugins-base where a string has null delimiters -
static const gchar genres[] =
"Blues\000Classic…

Drxxd
- 1,860
- 14
- 34
4
votes
0 answers
xgettext does not find all translated strings
I have a bundle.js, output from a bigger react / typescript webpack project.
If i run: xgettext bundle.js --from-code=utf-8 --language=JavaScript it finds some of the translated strings, but not all of them.
I have tried to change --language to…

jakobdo
- 1,282
- 14
- 20
4
votes
2 answers
xgettext - extract translatable strings and update .pot
I have inherited a sample.pot file. Now, I have added new messages in a1.c and a2.cpp. Is it possible for me to use xgettext and output the contents to same sample.pot instead of creating a new one? Eg:-
xgettext -d sample -s -o sample.pot…

confused
- 147
- 3
- 15
4
votes
2 answers
Parsing translatable messages from JSON file
I have a project that I want to be localizable. While most strings are in the source code, where xgettext/Poedit can easily find them when wrapped with the localization function call, some are in pure JSON files, that I'm using for data storage.…

Mars
- 912
- 1
- 10
- 21
4
votes
5 answers
poedit and xml files
How to configure poedit to extract strings from xml file?
I have Zend Framework navigation items in .xml like this:
...
And I want poedit to read just…

takeshin
- 49,108
- 32
- 120
- 164
4
votes
2 answers
xgettext with keyword that contains special characters
How can keywords be escaped when passing the --keyword argument? We use static calls to fetch translations, i.e. in the form Language::getText('foo');

c0dem4gnetic
- 932
- 1
- 7
- 24
4
votes
2 answers
Inserting translator notes/comments in PHP files
I am working on translating an application I am developing. I have strings like:
echo _("Welcome to my site");
I can then use the command line to create a .po file from all the PHP files in a particular directory by doing:
find . -iname "*.php" |…

Mike
- 23,542
- 14
- 76
- 87
4
votes
2 answers
I18n Phonegap App / gettext?
i´m developing a Phonegap app.
I want the user to be able to choose a language when they launch the app.
So i want all strings in my html and javascript files to be translated into the chosen language.
Is there a "best practise" or a plugin I…

DehMotth
- 679
- 3
- 12
- 21
4
votes
1 answer
xgettext won't scan plural form
I use Poedit for my gettext i18n and that works fine. I use ZF2 where there are view helpers to integrate the translations. One is translate, the other translatePlural.
Usage:
translate('Welcome') ?>

Jurian Sluiman
- 13,498
- 3
- 67
- 99
3
votes
1 answer
generating plural forms into a .pot file
I'm internationalizing a python program and cant get plural forms into the .pot file. I have marked string that require plural translations with a _pl() eg.
self.write_info(_pl("%(num)d track checked", "%(num)d tracks checked",
…

wodemoneke
- 343
- 4
- 13
3
votes
2 answers
Need just the strings for translation to be generated by xgettext, not all the strings in the source files
really struggling with this one.
I've recently setup a bash shell script to extract, concat and deduplicate the strings to translate out of a whole webite's view pages (MVC framework in use), it looks something like this:
for x in *.php; do xgettext…

richhallstoke
- 1,519
- 2
- 16
- 29
3
votes
1 answer
How to generate *.pot file from static HTML file
Is there an easy and straight forward method to generate *.pot file from a static HTML page?

fabianegli
- 2,056
- 1
- 18
- 35
3
votes
2 answers
Django makemessages command generates error: "xgettext: Non-ASCII string"
I have a simple django project. I am attempting to translate the site into Russian. Here is my settings.py file:
import os
# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
BASE_DIR =…

Ali Abdallah
- 33
- 10
3
votes
3 answers
Can xgettext be used to extract specific domain strings only?
(Really surprised this isn't answered anywhere online; couple posts over the past few years with a similar question, but never answered. Let's hope the Stackoverflow crew can come to the rescue)
Situation:
When using gettext to support application…

mromaine
- 141
- 4
- 7
3
votes
0 answers
Can I use an array of domains with dgettext for a Multi-Locale application?
I have a multi-locale application where I would like to present the translations POT files, generated by xgettext, to a translator for each locale.
I can currently do this with the following code (note that this is just sample code, not the actual…

lexum
- 31
- 1