Public bug reported:

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/messages.mo 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

[1] https://bugzilla.redhat.com/show_bug.cgi?id=1418635

** Affects: gettext (Ubuntu)
     Importance: Undecided
         Status: New

** Attachment added: "Testcase to trigger the bug"
   
https://bugs.launchpad.net/bugs/1663689/+attachment/4816662/+files/gettext_bug.c

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/1663689

Title:
  gettext() does not work on aarch64

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/gettext/+bug/1663689/+subscriptions

-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to