[ghemical-devel] gettext() still not working...

Tommi Hassinen Tommi.Hassinen at uku.fi
Sun Nov 23 13:58:43 EST 2008


Hello,

I have tried to get gettext() under my control using a small test program
TEST_gettext which is now available here:

http://www.bioinformatics.org/ghemical/download/

I still haven't got any translations out of it:

$ LANG=fi_FI.UTF-8 TEST_gettext 
Translate this, please!

The program is here:

#include <iostream>
using namespace std;

#include <libintl.h>
#define _(String) gettext(String)

int main(int argc, char ** argv)
{
        setlocale(LC_ALL, "");
        bindtextdomain(GETTEXT_PACKAGE, LOCALE_DIR);
        bind_textdomain_codeset(GETTEXT_PACKAGE, "UTF-8");
        textdomain(GETTEXT_PACKAGE);

        cout << _("Translate this, please!") << endl;

        return 0;
}

// eof

And this is the po file:

$ cat po/fi.po 
# SOME DESCRIPTIVE TITLE.
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
# This file is distributed under the same license as the PACKAGE package.
# FIRST AUTHOR <EMAIL at ADDRESS>, YEAR.
#
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2008-11-23 20:39+0200\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL at ADDRESS>\n"
"Language-Team: LANGUAGE <LL at li.org>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=CHARSET\n"
"Content-Transfer-Encoding: 8bit\n"

#: ../src/main.cpp:14
msgid "Translate this, please!"
msgstr "Käännä tämä, kiitos!"

Any ideas what's wrong here?
Translated programs shipped with Debian
(gimp for example) seem to work fine.

Tommi



More information about the ghemical-devel mailing list