More information on localisation issue



Hi Chris,

   Thanks for reply. But still i have same problem. I am giving more
information on what i have done so far down against your statement.

On Thu, Dec 30, 2010 at 5:30 PM, <gtk-app-devel-list-request gnome org>wrote:

Send gtk-app-devel-list mailing list submissions to
       gtk-app-devel-list gnome org

To subscribe or unsubscribe via the World Wide Web, visit
       http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
or, via email, send a message with subject or body 'help' to
       gtk-app-devel-list-request gnome org

You can reach the person managing the list at
       gtk-app-devel-list-owner gnome org

When replying, please edit your Subject line so it is more specific
than "Re: Contents of gtk-app-devel-list digest..."


Today's Topics:

  1. Re: Localization issues (Chris Vine)
  2. Re: Localization issues (Chris Vine)


----------------------------------------------------------------------

Message: 1
Date: Thu, 30 Dec 2010 10:53:15 +0000
From: Chris Vine <chris cvine freeserve co uk>
To: Lourembam Lenin <leninlou gmail com>
Cc: gtk-app-devel-list gnome org
Subject: Re: Localization issues
Message-ID: <20101230105315 27dafc62 laptop homenet>
Content-Type: text/plain; charset=US-ASCII

On Wed, 29 Dec 2010 17:11:47 +0530
Lourembam Lenin <leninlou gmail com> wrote:
I have a text in English which i want to convert it into French.

The sequence that i followed are as under:

   1. generate all the text using xgettext command in terminal,
creating .pot file
   2. creating .po file from .pot file
   3. creating .mo file from .po file

I have copy the .mo file in "/usr/share/locale/fr/LC_MESSAGES"

here is my code for main.c file:

int main()

{

    setlocale(LC_ALL,"");
    bindtextdomain("main","/usr/share/locale");
    textdomain("main");
    printf( gettext("Hello world\n"));
    return (0);
}

But when i execute the program, french version is not printed on
terminal after changing the language to french.

You shouldn't copy your po file by hand: if your program is
gettextize'd then 'make install' will do it for you, with the correct
name.  In your case, if you were to copy it by hand you would need to
name it main.po, which is a very odd name.  Bind to a more sensible name
instead.

You might also want to call bind_textdomain_codeset() depending on what
codeset you are using.


@Chris: I had done calling bind_textdomain_codeset() as

 bind_textdomain_codeset ("main", "UTF-8");


For managing your translation files, I should use intltools.


I am including the following headers here:

#include <stdio.h>
#include <libintl.h>
#include <locale.h>
#include <stdlib.h>
#include <config.h>


Chris


------------------------------

Message: 2
Date: Thu, 30 Dec 2010 10:58:18 +0000
From: Chris Vine <chris cvine freeserve co uk>
To: Lourembam Lenin <leninlou gmail com>
Cc: gtk-app-devel-list gnome org
Subject: Re: Localization issues
Message-ID: <20101230105818 2ebdf04a laptop homenet>
Content-Type: text/plain; charset=US-ASCII

On Thu, 30 Dec 2010 10:53:15 +0000
Chris Vine <chris cvine freeserve co uk> wrote:

On Wed, 29 Dec 2010 17:11:47 +0530
Lourembam Lenin <leninlou gmail com> wrote:
I have a text in English which i want to convert it into French.

The sequence that i followed are as under:

   1. generate all the text using xgettext command in terminal,
creating .pot file
   2. creating .po file from .pot file
   3. creating .mo file from .po file

I have copy the .mo file in "/usr/share/locale/fr/LC_MESSAGES"

here is my code for main.c file:

int main()

{

    setlocale(LC_ALL,"");
    bindtextdomain("main","/usr/share/locale");
    textdomain("main");
    printf( gettext("Hello world\n"));
    return (0);
}

But when i execute the program, french version is not printed on
terminal after changing the language to french.

You shouldn't copy your po file by hand: if your program is
gettextize'd then 'make install' will do it for you, with the correct
name.  In your case, if you were to copy it by hand you would need to
name it main.po, which is a very odd name.


I am using sudo cp command for copying to '/usr/share/locale/fr/LC_MESSAGES'
location


Correction: that is main.mo of course, copied from your gmo file.

Chris


------------------------------

_______________________________________________
gtk-app-devel-list mailing list
gtk-app-devel-list gnome org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list

End of gtk-app-devel-list Digest, Vol 80, Issue 23
**************************************************




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]