Author Topic: Localization Manager (addlocale)  (Read 148608 times)

Offline pinoc

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2847
    • other projects...
Re: Localization Manager (addlocale)
« Reply #390 on: September 11, 2011, 12:27:25 PM »
Hi pinoc,

Could you say what is this process, in non KDE DE ?

Quote
$ ps ax | grep addlocale
14331 pts/0    S      0:00 /bin/bash /tmp/xsuaddlocale
14333 pts/0    R      0:00 /bin/bash -l /usr/bin/addlocale
14347 pts/1    S+     0:00 grep --color addlocale

Thanks,
Mélodie

xsuaddlocale is setup by addlocale, see addlocale lines 77-93. It will relaunch addlocale with root-permissions in order to conduct the necessary changes. Same is done with lomanager. Nothing to worry about.
-p.

Offline AdamR

  • Jr. Member
  • **
  • Posts: 34
Re: Localization Manager (addlocale)
« Reply #391 on: September 12, 2011, 09:07:25 AM »
Pinoc, thank you for the helpful commands.
Day three: I can't localize my PCLOS:
Quote
[adam@localhost ~]$
Internet connection working

/var/cache/apt/archives/partial found
/usr/bin/firefox
--2011-09-12 16:59:17--  http://distro.ibiblio.org/pclinuxos/addlocale/pl.txt
Resolving distro.ibiblio.org (distro.ibiblio.org)... 152.19.134.43
Connecting to distro.ibiblio.org (distro.ibiblio.org)|152.19.134.43|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 8302 (8.1K) [text/plain]
Saving to: “/tmp/AL_REINSTALLLIST”

100%[======================================>] 8,302       28.8K/s   in 0.3s    

2011-09-12 16:59:18 (28.8 KB/s) - “/tmp/AL_REINSTALLLIST” saved [8302/8302]

Reading Package Lists...
Building Dependency Tree...
The following extra packages will be installed:
   gimp-help (2.6.1-1pclos2011)
The following NEW packages will be installed:
   aspell-manual (0.60.6-10pclos2009)
   aspell-pl (0.60.5-10.20090830.6pclos2009)
   coreutils-doc (8.7-2pclos2010)
   docbook-dtd44-xml (1.0-3pclos2010)
   docbook-dtd45-xml (1.0-2pclos2010)
   docbook-style-xsl (1.75.2-1pclos2010)
   enca (1.12-1pclos2010)
   firefox-pl (6.0.2-1pclos2011)
   gimp-help (2.6.1-1pclos2011)
   gimp-help-pl (2.6.1-1pclos2011)
   glibc-i18ndata (2.13-4pclos2011)
   intltool (0.41.1-1pclos2011)
   kde4-l10n-pl (4.6.5-1pclos2011)
   libgdata-i18n (0.6.6-1pclos2010)
   locales-pl (2.13-1pclos2011)
   man-pages-pl (0.6-10pclos2009)
   mozilla-thunderbird-pl (6.0.2-1pclos2011)
   myspell-pl_PL (1.0.2-12pclos2009)
   perl-Text-CharWidth (0.04-10pclos2009)
   perl-Text-WrapI18N (0.06-10pclos2009)
   php-translit (0.6.0-3pclos2010)
0 upgraded, 21 newly installed, 4 reinstalled, 0 removed and 0 not upgraded.
Need to get 102MB of archives.
After unpacking 147MB of additional disk space will be used.
Get:1 http://debian.ethz.ch pclinuxos/2010/main aspell-manual 0.60.6-10pclos2009 [477kB]
/usr/bin/addlocale: line 1804: [: Need: integer expression expected

I'm unsure that "/var/cache/apt/archives/partial found" is a normal output.
I know, I can manually install these packages, but I don't know how to exactly localize my system :(

Offline DeBaas

  • Hero Member
  • *****
  • Posts: 1521
    • PCLinuxOS.nl
Re: Localization Manager (addlocale)
« Reply #392 on: September 12, 2011, 09:26:51 AM »
To add info of a stalling addlocale on ZEN,
updated to the latest 4.0-3pclinuxos2011
Code: [Select]
[user@localhost ~]$ addlocale
[user@localhost ~]$
Internet connection working

/var/cache/apt/archives/partial found

[user@localhost ~]$ cls
bash: cls: command not found
[user@localhost ~]$ addlocale
[user@localhost ~]$
Internet connection working

/var/cache/apt/archives/partial found
/usr/bin/firefox
--2011-09-12 17:07:30--  http://distro.ibiblio.org/pclinuxos/addlocale/nl.txt
Resolving distro.ibiblio.org (distro.ibiblio.org)... 152.19.134.43
Connecting to distro.ibiblio.org (distro.ibiblio.org)|152.19.134.43|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 8007 (7.8K) [text/plain]
Saving to: “/tmp/AL_REINSTALLLIST”

100%[======================================>] 8,007       --.-K/s   in 0.1s   

2011-09-12 17:07:31 (58.2 KB/s) - “/tmp/AL_REINSTALLLIST” saved [8007/8007]

[user@localhost ~]$ failed to create drawable
Reading Package Lists...
Building Dependency Tree...
The following NEW packages will be installed:
   enca (1.12-1pclos2010)
0 upgraded, 1 newly installed, 14 reinstalled, 0 removed and 0 not upgraded.
Need to get 9497kB of archives.
After unpacking 162kB of additional disk space will be used.
Get:1 http://ftp.nluug.nl pclinuxos/2010/main aspell-manual 0.60.6-10pclos2009 [477kB]
Get:2 http://ftp.nluug.nl pclinuxos/2010/main aspell-nl 0.50.2-10pclos2009 [1795kB]
/usr/bin/addlocale: line 1804: [: Need: integer expression expected
Need more info ?

Offline melodie

  • Hero Member
  • *****
  • Posts: 5942
  • XMMP=Jabber, free instant messaging protocol !
    • PCLinuxOS Fr
Re: Localization Manager (addlocale)
« Reply #393 on: September 12, 2011, 09:50:17 AM »
Hi,

For now, it seems to work:

http://img4.hostingpics.net/pics/139987Screenshot1.png

Haven't rebooted yet. :)

« Last Edit: September 12, 2011, 09:52:54 AM by melodie »
melodie at swissjabber dot ch - IRC #pclinuxos-fr sur freenode

Offline pinoc

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2847
    • other projects...
Re: Localization Manager (addlocale)
« Reply #394 on: September 12, 2011, 10:46:43 AM »
Hi Adam,

I found the error now and will fix it tomorrow with addlocale 4.0-4.
thanks for your patience,
-p.

quick fix if you are in a hurry and can't wait: as root open /usr/bin/addlocale and change line 1800 from this:
Code: [Select]
MBdl=`echo $a | sed 's/.* \([0-9]\{1,\}\)[.,].*/\1/'`to read exactly like this:
Code: [Select]
MBdl=`echo $a | sed 's/.* \([0-9]\{1,\}\).*/\1/'`
meaning delete the part: [.,]
then save the file and rerun addlocale.
good luck,
-p.
« Last Edit: September 12, 2011, 10:59:26 AM by pinoc »

Offline AdamR

  • Jr. Member
  • **
  • Posts: 34
Re: Localization Manager (addlocale)
« Reply #395 on: September 12, 2011, 11:58:42 AM »
Success!!
http://i.imgur.com/iBZD2.png
Thank you, Pinoc :), you're great :D

Offline DeBaas

  • Hero Member
  • *****
  • Posts: 1521
    • PCLinuxOS.nl
Re: Localization Manager (addlocale)
« Reply #396 on: September 12, 2011, 12:08:29 PM »
Quote
[.,]
Is the trick ;)
How to explain my gratitude ? Bacon ?

Offline pinoc

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2847
    • other projects...
Re: Localization Manager (addlocale)
« Reply #397 on: September 12, 2011, 01:52:58 PM »
Quote
[.,]

Is the trick ;)
How to explain my gratitude ? Bacon ?


Adam,
thanks for the confirmation, I knew it would work now  ;)

DeBaas, maybe a short explanation for the curious:
starting with version 4 I added custom code to get these flipping progress bars for all kind of things showing up. Also here where this error occurred, so what is happening here and what went wrong? At this point in the script we download the full set of packages required for adding the new language. This list depends on the chosen language and the packages currently installed in the system. To get a progress bar for downloading these packages we need to know the total MBs to be downloaded (MBdl), then, while the download is progressing, we monitor the constantly growing additional disk space in /var/cache/apt/archives/, calculate the percentage wrt MBdl, and then pipe this percentage into the constantly updated Zenity-dialog until we reach 100%. The total size to be downloaded is provided in the second line above the one where the first package is retrieved (marked in green below). The we use sed to extract this number. And here the error occurred: The old command always worked because this number was always a decimal specified with (depending on the language) either a comma or a dot. Now in Adam's case for some coincidence this number was not a decimal as I expected it (102.0MB) but an integer (102MB). Because the old sed command looked for a number followed by a comma/dot it did not extract the number but the entire string. Then when you compare a string to a number you get the crash
Quote
/usr/bin/addlocale: line 1804: [: Need: integer expression expected
Changing the sed-command to look for a number without the comma or dot made it work again, and the script can continue.

.....
0 upgraded, 21 newly installed, 4 reinstalled, 0 removed and 0 not upgraded.
Need to get 102MB of archives.
After unpacking 147MB of additional disk space will be used.
Get:1 http://debian.ethz.ch pclinuxos/2010/main aspell-manual 0.60.6-10pclos2009 [477kB]


Hope to have explained this in a understandable way.
regards,
-p.

Tomorrow I will work on 4.0-4 which will also get the new automatic update routine from the new lomanager. 

Offline DeBaas

  • Hero Member
  • *****
  • Posts: 1521
    • PCLinuxOS.nl
Re: Localization Manager (addlocale)
« Reply #398 on: September 12, 2011, 04:01:33 PM »
Even if you made the best scipt in the world..........
Thanks for the excelent and understandable explanation.

Ed
« Last Edit: September 13, 2011, 01:00:31 PM by DeBaas »

Offline pinoc

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2847
    • other projects...
Re: Localization Manager (addlocale)
« Reply #399 on: September 12, 2011, 05:01:30 PM »
Even if you made the best scipt in the world..........
Thanks for the excelent and understandable expanation.

Ed

thanks Ed, addlocale is a rather simple script but with many nice features. Doing it has taught me many things about bash, KDE, and how to search the web. Now it does its job for PCLinuxOS bringing in more users from the non-English speaking world, and this is yet another nice feature  ;)
Great to hear the explanation was clear enough. Just check the code, there are many comments explaining what is done why so others can copy/paste anything they may find useful for their tasks (and I can remember what I did there... ;D )
have a good one,
-p.

Offline pinoc

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2847
    • other projects...
Re: Localization Manager (addlocale)
« Reply #400 on: September 13, 2011, 04:18:11 AM »
coming up: addlocale 4.0-4, a bugfix version with new features:
- fixed missing addlocale environment variable
- fixed package download size detection (thanks to AdamR and DeBaas)
- added test for system updates
- added automatic installation of uptodate addlocale
- updated all translations

from this version onwards, and before applying any changes with addlocale, the script will check if your system is fully updated and/or has broken dependencies. If so, it will stop and show the website explaining how to properly update the system. If the system is fully updated it will then check for, and automatically update to, any brand-new addlocale version which may not even be mirrored to your local repo. These steps ensure that you will use the latest version on an updated system (which you should have done anyway but now it is enforced, ha!)

have fun,
-p.

Offline melodie

  • Hero Member
  • *****
  • Posts: 5942
  • XMMP=Jabber, free instant messaging protocol !
    • PCLinuxOS Fr
Re: Localization Manager (addlocale)
« Reply #401 on: September 13, 2011, 02:07:38 PM »
pinoc,

4 words to say "Thank You Very Much" !

and more... "gracie molto !" :)




melodie at swissjabber dot ch - IRC #pclinuxos-fr sur freenode

Offline pinoc

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2847
    • other projects...
Re: Localization Manager (addlocale)
« Reply #402 on: October 08, 2011, 06:03:34 AM »
addlocale 4.0-5 coming to your repo soon, change:
- updated to work with new FF and TB locale packages
- added error message output if repo-packages were not found
- fixed addlocale autoupdate installation

enjoy,
-p.

Offline melodie

  • Hero Member
  • *****
  • Posts: 5942
  • XMMP=Jabber, free instant messaging protocol !
    • PCLinuxOS Fr
Re: Localization Manager (addlocale)
« Reply #403 on: October 08, 2011, 12:02:39 PM »
addlocale 4.0-5 coming to your repo soon, change:
- updated to work with new FF and TB locale packages
- added error message output if repo-packages were not found
- fixed addlocale autoupdate installation

enjoy,
-p.

You hou !!! Thank you pinoc !

melodie at swissjabber dot ch - IRC #pclinuxos-fr sur freenode

Offline tschommer

  • PCLinuxOS Tester
  • Hero Member
  • *******
  • Posts: 1890
  • MLU and BLU (Bacon lovin' user)
Re: Localization Manager (addlocale)
« Reply #404 on: October 09, 2011, 08:33:51 AM »
Wow, thanks pinoc!

Its people like you that make PCLOS what it is  :D
Our defense is in the preservation of the spirit which prizes liberty as the heritage of all men, in all lands, everywhere."
Abraham Lincoln --September 11, 1858 Speech at Edwardsville, Illinois