[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
GNU: Problem avec le gettext
From: |
Jean-Louis Tang |
Subject: |
GNU: Problem avec le gettext |
Date: |
Fri, 05 Nov 2004 17:53:34 +0800 |
User-agent: |
Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7) Gecko/20040616 |
Bonjour,
Nous avons un probleme avec l'utilisation
de getText().
Veuillez trouver ci-joint et ci-dessous
ce que nous avons fait.
Merci d'avance
Cordialement
Jean-Louis
_Please find hereafter the steps that I have done to test the GNU
gettext API_:
1. create the sample program (/hello.c/)
2. create the template file (/hello.pot/) by:
xgettext -d hello -s -o hello.pot hello.c
3. create the PO file (/chi.po/) by:
msginit -l zh_CN.utf8 -o chi.po -i hello.pot
4. create the MO file (/hello.mo/) by:
msgfmt -c -v -o hello.mo chi.po
5. copy the MO file to the directory LC_MESSAGES under its locale
cp hello.mo ./zh_CN.utf8/LC_MESSAGES *OR*
cp hello.mo ./zh_CN/LC_MESSAGES
6. set the current locale to *Chinese*
export LANG=zh_CN.utf8
7. compile the sample program
cc -I/usr/local/share/gettext hello.c -o hello
8. execute /hello/
./hello
9. result -> *Hello* (NOT translated !)
Ci-joint les fichiers qu'on a utilises pour utiliser le getText().
_And, here below are my questions:_
1. Is there anything wrong in my steps ?
2. What are the possible reasons for message translation (gettext) not
working properly ?
3. What should be checked to ensure that the GNU gettext is installed
and configured properly under my unix machine ?
4. Any other advice ??
# List of files which contain translatable strings.
hello.c
# Chinese translations for PACKAGE package
# PACKAGE 软件å
çç®ä½ä¸æç¿»è¯.
# Copyright (C) 2004 THE PACKAGE'S COPYRIGHT HOLDER
# This file is distributed under the same license as the PACKAGE package.
# <address@hidden>, 2004.
#
msgid ""
msgstr ""
"Project-Id-Version: chi 0.1\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2004-11-05 17:04+0800\n"
"PO-Revision-Date: 2004-11-05 17:04+0800\n"
"Last-Translator: <address@hidden>\n"
"Language-Team: Chinese\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
#: hello.c:11
#, c-format
msgid "Hello"
msgstr "??"
hello
Description: Binary data
#include <gettext.h>
//#include <libintl.h>
#include <locale.h>
#include <stdio.h>
#include <stdlib.h>
int main(void)
{
setlocale( LC_ALL, "" );
bindtextdomain( "hello", "/nfshome/bleung/tmp/GetText" );
textdomain( "hello" );
printf( gettext( "Hello" ) );
exit(0);
}
hello.mo
Description: Binary data
# 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 <address@hidden>, YEAR.
#
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2004-11-05 17:04+0800\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <address@hidden>\n"
"Language-Team: LANGUAGE <address@hidden>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=CHARSET\n"
"Content-Transfer-Encoding: 8bit\n"
#: hello.c:11
#, c-format
msgid "Hello"
msgstr ""
# Set of available languages.
zh_CN
- GNU: Problem avec le gettext,
Jean-Louis Tang <=