gettext() does not work on aarch64

Bug #1663689 reported by Christoph Müllner on 2017-02-10
This bug affects 1 person
Affects Status Importance Assigned to Milestone
gettext (Ubuntu)

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/messages.po with the following content:
msgid ""
msgstr ""
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=ISO-8859-1\n"
"Content-Transfer-Encoding: 8bit\n"
msgid "Basic test"
msgstr "Perustesti"

3) Compile a mo:
   msgfmt -o fi/LC_MESSAGES/ fi/LC_MESSAGES/messages.po

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("messages", "./locale");
   c. textdomain("messages");
   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


Christoph Müllner (cmuellner) wrote :
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers