Questions tagged [msgfmt]
21 questions
100
votes
11 answers
Compiler error - msgfmt command not found
I'm trying to update Git from my shared hosting. For that I'm following these steps:
Download latest Git version
Unpack and place it on the server
Configure and create the Makefile -> ./configure --prefix=$HOME/dev/git/src --without-tcltk
Build the…

John
- 3,529
- 14
- 42
- 48
32
votes
3 answers
Is it possible to combine two .po translation files together?
We have two .po files, each from different branches of a piece of software.
We need to combine these into a single .po file.
There are duplicates between the two files, and the ideal handling would be for one file's strings to be favoured…

fooquency
- 1,575
- 3
- 16
- 29
8
votes
3 answers
How do I keep whitespace between {% blocktrans %} and {% plural %} tags without causing msgfmt errors?
I'm rendering some pluralization using the blocktrans tag; here's the relevant snippet in the template file:
{% blocktrans count choice_count=choice_count %}
You have {{ choice_count }} choice:
{% plural %}
You have {{ choice_count }}…

3cheesewheel
- 9,133
- 9
- 39
- 59
7
votes
1 answer
How to Compile .po file to .mo file , msgfmt not working
I have to compile a file .po to .mo with msgfmt, so I installed gettext (newest version) and do chmod 777 to my entire folder.
When I compile the file:
msgfmt /home/myuser/file.po -o /home/myuser/file.mo
there are no errors, no life signal,…

israel
- 350
- 1
- 2
- 9
6
votes
4 answers
Compile Git without gettext
I'm trying to compile a static Git 2.17.1 on Debian (Windows Subsystem for Linux):
$ mkdir _git
$ make configure
$ ./configure --prefix=$PWD/_git NO_TCLTK=true NO_GETTEXT=true CFLAGS="${CFLAGS} -static"
$ make all
but I'm getting the error
...
…

Thomas S.
- 5,804
- 5
- 37
- 72
6
votes
1 answer
How to tell bash to get gettext .mo file from custom location?
I am creating a bash script for a very specific project, and the strings must be translatable.
I have successfully followed the following tutorial: gettext support for bash scripts:
http://mywiki.wooledge.org/BashFAQ/098
However, part of the…

augustin
- 14,373
- 13
- 66
- 79
4
votes
1 answer
How to validate positional notation placeholders in format strings with msgfmt?
When using printf-like format strings in a translated text msgfmt --check checks that the translation still contains the placeholders. For example, running xgettext on the following code
printf( gettext( "string: %s, int: %d" ), str, i )
produces a…

Julien
- 2,139
- 1
- 19
- 32
1
vote
1 answer
Is there a command to generate all .mo files from multiple .po files?
I have multiple .po files in a standard directory structure of GNU gettext:
locales/
├── en_US
│ └── LC_MESSAGES
│ └── myapp.po
└── zh_TW
└── LC_MESSAGES
└── myapp.po
I knew that I could write a script that uses msgfmt to…

johnlinp
- 853
- 6
- 22
1
vote
2 answers
PO file header missing or invalid
I'm trying to add en_SG translations to an R package, but I'm met with a gettext error and I haven't seen any source on what's the issue:
list.files('po')
# [1] "R-myPkg.pot"
# [2] "R-en_SG.po"
tools::update_pkg_po('.')
has output:
R-en_SG:.…

MichaelChirico
- 33,841
- 14
- 113
- 198
1
vote
0 answers
PO file to XML with msgfmt: ITS rules not found
I try to convert a PO file, which I created out of a XML file with an its rule over the command xgettext, back to the XML file with translation. But it seems msgfmt doesn't have an option to tell it where to find the its rule file (in xgettext there…

Daniel Richter
- 166
- 6
1
vote
2 answers
msgfmt returns the wrong line with an error
today I'm having a problem.
I deliberately created a .po file in which there is an error.
I expect that the backtrace error appears on the 39 string.
Instead, the validator shows
test.po:1: missing 'msgstr' section - means that validator found…

Yaroslav Andriychuk
- 33
- 6
1
vote
1 answer
Building iPhone for WindowsXP with Cygwin
"Write native iPhone applications using Eclipse
CDT
How Windows and Linux developers can bypass the iPhone
SDK and write iPhone apps using open source tools"
by PJ Cabrera (pjcabrera@pobox.com)
I was following the instructions from this document and…

Berlin Brown
- 11,504
- 37
- 135
- 203
0
votes
0 answers
What is the error "msgfmt: cannot locate ITS rules for data/org.freedesktop.NetworkManager.policy.in" while building yocto wpa repo
I am trying to build the meta layer https://github.com/LairdCP/meta-laird-cp
I am using the layer meta-summit-radio-pre-3.4/ for my build. Most of the components build with the exception of 'summit-networkmanager-lwb'. This component creates the…

preetam
- 1,451
- 1
- 17
- 43
0
votes
0 answers
msgfmt: cannot locate ITS rules when building gnome desktop
Here is the output of jhbuild build:
*** Building accountsservice *** [36/246]
ninja -j24
[2/7] Generating data/org.freedesktop.accounts.policy with a custom command
FAILED: data/org.freedesktop.accounts.policy…

saberlion
- 11
- 2
0
votes
1 answer
msgfmt error when generating .po file with xgettext and msginit
When using the following commands to generate a .po file:
xgettext test.js -o test.pot -L JavaScript --from-code=UTF-8
msginit -i test.pot -o de.po --locale=de
I get the following header:
# Copyright (C) 2021 THE PACKAGE'S COPYRIGHT HOLDER
# This…

Florat
- 119
- 1
- 7