Re: General localization question



I had been playing around with a program using the setup described in the
message below for an "uninstalled" translation for a fake language I made
and had it working successfully for some time and recently went back to it
after installing RedHat 7.2 from 6.2  and was unable to have locale
changes affect my program.  Is this a known issue or have I probably done
something else to break it.  I'd be very surprised if locale changes were
made between the dists as this would be very bad for a lot of
people.  Also what variables need to be set to make the changes take
effect?  LC_ALL or LANG or both?  If I only have an .mo file for
LC_MESSAGES do I only need to set LC_MESSAGES or is still best to set
LC_ALL?  Also in general I can place my package anywhere I want as long
pass the proper parameter to bindtextdomain... right?  ie the following is
allowed...

#define PACKAGE		"test-prog"
#define LOCALEDIR	"/home/joeuser/progs/locale"
...
bindtextdomain(PACKAGE, LOCALEDIR);

[where the following is true]

my locale is "fake-Lang" and
"/home/joeuser/progs/locale/fake-Lang/LC_MESSAGES/test-prog.mo" exists

Thanks.

On Wed, 6 Feb 2002, Pablo Saratxaga wrote:

> Kaixo!
> 
> On Wed, Feb 06, 2002 at 08:16:35AM +0530, Joshua N Pritikin wrote:
> 
> > If i want to try *uninstalled* translations then what do i have to do?
> > 
> >   gtk_init (...);
> >   bindtextdomain("redael", "/home/joshua/redael/locale");
> >   textdomain("redael");
> > 
> >   cp po/mr.gmo /home/joshua/redael/locale/mr/LC_MESSAGES/redael.mo
> >   cp po/mr.gmo /home/joshua/redael/locale/mr_MR/LC_MESSAGES/redael.mo
> > 
> >   LANG=mr_MR ./redael
> > 
> > It seems like this should work but it doesn't.
> 
> Have you a locale "mr_MR" installed ?
> Otherwise it would backfall to "C".
> 
> Try using LANGUAGE=mr, it should work:
> 
> chanae:~$ LC_ALL=mr_MR strace mc 2> A
> chanae:~$ grep LC_ A
> open("/usr/share/locale/mr_MR/LC_IDENTIFICATION", O_RDONLY) = -1 ENOENT (No
> such file or directory)
> open("/usr/share/locale/mr/LC_IDENTIFICATION", O_RDONLY) = -1 ENOENT (No such
> file or directory)
> chanae:~$ LC_ALL=en LANGUAGE=mr strace mc 2> A
> chanae:~$ grep LC_ A
> open("/usr/share/locale/en/LC_IDENTIFICATION", O_RDONLY) = 3
> open("/usr/share/locale/en/LC_MEASUREMENT", O_RDONLY) = 3
> open("/usr/share/locale/en/LC_TELEPHONE", O_RDONLY) = 3
> open("/usr/share/locale/en/LC_ADDRESS", O_RDONLY) = 3
> open("/usr/share/locale/en/LC_NAME", O_RDONLY) = 3
> open("/usr/share/locale/en/LC_PAPER", O_RDONLY) = 3
> open("/usr/share/locale/en/LC_MESSAGES", O_RDONLY) = 3
> open("/usr/share/locale/en/LC_MESSAGES/SYS_LC_MESSAGES", O_RDONLY) = 3
> open("/usr/share/locale/en/LC_MONETARY", O_RDONLY) = 3
> open("/usr/share/locale/en/LC_COLLATE", O_RDONLY) = 3
> open("/usr/share/locale/en/LC_TIME", O_RDONLY) = 3
> open("/usr/share/locale/en/LC_NUMERIC", O_RDONLY) = 3
> open("/usr/share/locale/en/LC_CTYPE", O_RDONLY) = 3
> open("/usr/share/locale//mr/LC_MESSAGES/mc.mo", O_RDONLY) = -1 ENOENT (No such
> file or directory)
> 
> As you can see, when a non-exisiting locale is used, translations are not
> even looked for.
> However if I use an existing locale (one with all the LC_* files present)
> then I can use a translation in another language (here it isn't there
> either, but it is looked).
> 
> 

-- 
Samir A. Singh | Junior Engineer
ELC Technologies
1532 State Street Suite C
Santa Barbara, Ca 93101
ssingh elctech com

(805) 884.8300 phn
(805) 884.8339 fax

http://www.elctech.com

-------------------------------------------------------------------------------
Privacy and Confidentiality Notice:
The information contained in this electronic mail message is intended for the 
recipients(s) only.  It may contained priviledged and confidential information.
If you are not an intended recipient, you must not copy, forward, distribute or
take any action in reliance on it.  If you have received this electronic mail 
message in error, please notify the sender immediately. 




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