gettext() does not work on aarch64
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
gettext (Ubuntu) |
New
|
Undecided
|
Unassigned |
Bug Description
Code to reproduce the bug
I was not able to get the proper translation from gettext() on an aarch64
Ubuntu Xenial machine. The same code however works fine on x86_64.
To reproduce the issue one can use the following instructions:
1) Create the following directory structure:
mkdir -p fi/LC_MESSAGES
2) Create the file fi/LC_MESSAGES/
msgid ""
msgstr ""
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=
"Content-
msgid "Basic test"
msgstr "Perustesti"
3) Compile a mo:
msgfmt -o fi/LC_MESSAGES/
4) Compile the attached file and run it (no special compiler flags used).
The code essentially does:
a. setlocale(LC_ALL, "fi_FI");
b. bindtextdomain(
c. textdomain(
d. gettext("Basic test")
On aarch64 this results in "Basic test".
On x86_64 this results in "Perustesti".
FWIW, I was able to reproduce this bug on the following aarch64 Linux distributions as well:
* Fedora 25 (see [1])
* CentOS 7
* OpenSUSE Leap 42.2