Author Topic: SOLVED: Help with locales on PCLOS  (Read 1615 times)

Offline kizito

  • Full Member
  • ***
  • Posts: 202
SOLVED: Help with locales on PCLOS
« on: November 16, 2009, 04:54:10 PM »
Hello,

I have translated coreutils, which is at 5.97 on PCLOS. The language into which I have translated it has locales on the system, they are:
lg
lg_UG
lg_UG.UTF.8

I translated the package using kwrite and KBabel (tried poedit but it did my head in). All the syntax checks were OK. I then used the command

Code: [Select]
msgfmt -v -o coreutils.mo coreutils-5.97.lg.po
which resulted in a message saying '1138 message translated' and a binary file called coreutils.mo

I placed the .mo file into the /usr/share/locale/lg_UG/LC_MESSAGES and /usr/share/locale/lg/LC_MESSAGES directories and ran the commands

Code: [Select]
export LC_ALL=lg_UG

 and
Code: [Select]
export LANG=lg_UG

However the coreutils programs all fail to start working in the new language. This procedure has worked for me before, using Linuxfromscratch. I have also tried repeating the procedure with the resulting file as coreutils-5.97.mo, still with no joy.

Is there some glaring omission that I have made? Could you please advise me?
« Last Edit: November 17, 2009, 04:20:58 PM by kizito »
PCLinuxOS... Tough on Windows, tough on the causes of Windows

Offline pinoc

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2840
    • other projects...
Re: Help with locales on PCLOS
« Reply #1 on: November 17, 2009, 12:24:04 AM »
Hi kizito,

the following works for bash-scripts but maybe also in general.
The resulting mo-file should be called <program>.mo, so in your case: coreutils.mo
In addition, the program should include definitions for the following two variables so the system knows about them and their location (again for your program: coreutils):     
Code: [Select]
export TEXTDOMAIN=coreutils
export TEXTDOMAINDIR="/usr/share/locale"

These TEXTDOMAIN definitions should be included in the source of program, but it may also work if you add them in a terminal from which you then execute the program.

hope this helps,
-p.

Offline kizito

  • Full Member
  • ***
  • Posts: 202
Re: Help with locales on PCLOS
« Reply #2 on: November 17, 2009, 06:08:52 AM »
Thanks for the advice Pinoc, I'll try that tonight when I get back from work.

Wouldn't the coreutils (provides things like cp, mv, dd and who) that comes with PCLOS already have those variables taken care of though?

Regards
PCLinuxOS... Tough on Windows, tough on the causes of Windows

Offline pinoc

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2840
    • other projects...
Re: Help with locales on PCLOS
« Reply #3 on: November 17, 2009, 06:50:20 AM »
Wouldn't the coreutils (provides things like cp, mv, dd and who) that comes with PCLOS already have those variables taken care of though?

hmm, yes, probably. Only know how to do this for bash-scripts but maybe setting the TEXTDOMAIN will do the trick, let us know.
-p.

Offline kizito

  • Full Member
  • ***
  • Posts: 202
SOLVED Re: Help with locales on PCLOS
« Reply #4 on: November 17, 2009, 12:48:18 PM »
OK, sorted here  Pinoc ;D

The TEXTDOMAIN and TEXTDOMAINDIR variables did not change the behavior, but this  command that I picked up from a web search over lunch break did:

Code: [Select]
export LANGUAGE=lg
PCLinuxOS... Tough on Windows, tough on the causes of Windows

Offline pinoc

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2840
    • other projects...
Re: Help with locales on PCLOS
« Reply #5 on: November 17, 2009, 02:10:02 PM »
Hi kizito,

good to hear you found a solution! And you have installed locales-lg for Luganda? A rather rare language I guess...
-p.

Offline kizito

  • Full Member
  • ***
  • Posts: 202
Re: Help with locales on PCLOS
« Reply #6 on: November 17, 2009, 04:04:22 PM »
The locale was already there in PCLOS, but not the translations for any programs.
Yes you could call it rare, unless you live in Uganda  ;D

I have just been studying the configuration files in /etc. PCLOS does things differently to how I first learned them.
It sets up the locale environment via scripts in the /etc/profile.d directory. To change the locale system-wide (not just the KDE one) you use the file /etc/sysconfig/i18n. To control just your local settings you create $HOME/.i18n. I have done this and now the desired behavior.

I am working on getting the basic elements of the base system translated prior the graphical interfaces, so coreutils is getting the first attention.

Regards,

Kizito
PCLinuxOS... Tough on Windows, tough on the causes of Windows