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

musonio

  • Guest
Re: 2009.1 International, or how to change to a non-English locale
« Reply #120 on: May 01, 2009, 11:24:16 AM »
Extremely thankful for your help and your wonderful script.

Offline pinoc

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2849
    • other projects...
Re: 2009.1 International, or how to change to a non-English locale
« Reply #121 on: May 01, 2009, 11:27:39 AM »
Thanks!  ;)
Just great to hear it worked in the end!

have fun
-p.

Offline pinoc

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2849
    • other projects...
Re: 2009.1 International, or how to change to a non-English locale
« Reply #122 on: May 21, 2009, 08:10:59 AM »
Introducing addlocale v.2.0, smaller, faster, the next generation...
As before, addlocale works in 2 steps:
Step 1: Installing essential packages for the new locale
Step 2: adding language specific files for existing applications

Changes in version 2.0:
- some code cleanup of no longer needed additional tests.
- some minor changes (added language support for abiword, new languages for gcompris)
- Step 2: the previous versions 1.x included locale-specific lists of language-relevant applications to be reinstalled.  Starting with version 2.0 these lists are no longer inside addlcoale but will be downloaded from a webserver.  Advantage:
* the list can be updated without having to update the addlocale package itself,
* the user has access to the latest definitions,
* the script is much smaller and easier to maintain
- Step 2: the previous versions 1.x added the language-specific information by downloading and reinstalling applications found on the system, a time consuming task. This methodology is still available and now called 'Reinstall-mode'.  The new alternative, default method is called 'Fast-mode'. Using Fast-mode addlocale 2.0 will only download and extract a small archive having all language-relevant information for the chosen locale.  Advantage to the previous 'Reinstall-mode' for a typical localization:
* required file-size to download: 8MB instead of more than 300MB
* installation time: 10 secs instead of 20 mins
* in contrast to Reinstall-mode, Fast-mode does not require a fully updated system
* impact: Fast-mode contains available PCLinuxOS translations as well as translations not available in PCLinuxOS. This allows applying translations for which even PCLinuxOS has no translations available (for example, the attached screenshot shows abiword in Romanian and k9copy & Synaptic in Swedish. This could not be achieved with PCLinuxOS alone but takes advantage of Ubuntu translations from the external language-database accessed by addlocale in Fast-mode).


Remarks:
The language-relevant information is provided in so-called mo-files included in the rpm packages. Using the previous way, Reinstall-mode, the mo-files for the new locale were extracted by downloading and reinstalling a rpm-package.  Now with Fast-mode, downloading and reinstalling is obsolete as the mo-files are already included in the language-archives, which are the result of a separate script I run on my local machine. This script does the following:
1) setting up a mo-file database by scanning a local copy of the entire PCLinuxOS archive and extracting the mo-files from language relevant rpms
2) building a second mo-file database using Ubuntu and other distributions
3) combining the two databases: using PCLinuxOS mo-files wherever possible and complementing the merged database with mo-files from other distros for applications for which we do not have translations in PCLinuxOS. Providing non-PCLinuxOS mo-files allows applying translations to applications which are English only in PCLinuxOS.
4) Building the Reinstall-list (for Reinstall-mode) and the locale-specific language-archives (for Fast-mode) and uploading them to the webserver so they can be accessed by addlocale.

The idea is to run this script once a month, or whenever major changes happen in the repo, and then upload the new lists and language-archives to the server from where they will then be available for download via addlocale. This allows me to provide updates without touching addlocale itself.
In general, Fast-mode provides the same or even better results than Reinstall-mode. Since Fast-mode is very new and not yet well tested I keep the previous Reinstall-mode as an alternative for now. So, in case Fast-mode should not work as expected you can re-run addlocale and use Reinstall-mode. If you are happy with the results of addlocale 1.8 then there is no real need to run addlocale 2.0.

best regards and good luck!
-pinoc

[attachment deleted by admin]

Offline Was_Just19

  • Hero Member
  • *****
  • Posts: 6852
  • MLU
Re: 2009.1 International, or how to change to a non-English locale
« Reply #123 on: May 21, 2009, 10:09:29 AM »
Nice work, yet again!   ;D

Offline pinoc

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2849
    • other projects...
Re: 2009.1 International, or how to change to a non-English locale
« Reply #124 on: May 23, 2009, 06:21:57 AM »
short animation of some localizations.

have fun,
-pinoc

Offline Texstar

  • Administrator
  • Super Villain
  • *****
  • Posts: 12539
Re: 2009.1 International, or how to change to a non-English locale
« Reply #125 on: May 23, 2009, 08:20:46 AM »
Cool! Thanks for sharing.

Thanks to everyone who donates. You keep the servers running.

Offline rogaven

  • PCLinuxOS Tester
  • Hero Member
  • *******
  • Posts: 558
  • be patient, I'm German
Re: 2009.1 International, or how to change to a non-English locale
« Reply #126 on: May 23, 2009, 10:08:48 AM »
涼爽的!謝謝分享。 :D
Nothing is perfect, not even my english
3.4.25-pclos1.pae.bfs - KDE: 4.10.1 Intel(R) Core(TM)2 Quad CPU Q8400 @ 2.66GHz - RAM: 8 GB - GeForce 8400 GS

Offline pinoc

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2849
    • other projects...
Re: 2009.1 International, or how to change to a non-English locale
« Reply #127 on: May 26, 2009, 07:46:05 AM »
Hi,

quick update, now working on version 2.1  ;)  finally having what I wanted in addlocale from the very beginning: From 2.1, and thanks to the new 'Fast-Mode', addlocale can be run from the LiveCD before installing to hard-disk. Meaning you start a live session using the latest PCLinuxOS iso, start Synaptic, reload and install only addlocale 2.1 (nothing else!), then run addlocale 2.1 to change the locale to your needs, and then click on the 'Install PCLinuxOS' desktop icon to install a localized version to your PC. Just need to do some more tests but 2.1 should be in the repos next week.

regards,
-pinoc

PS: due to a major power supply upgrade the server hosting the addlocale files must be off-line from May, 30 (starting at 7.30 AM CEST) until the morning of June, 3. In contrast to addlocale version 1.x, addlocale 2.x can not be used in that time.

Offline melodie

  • Hero Member
  • *****
  • Posts: 5942
  • XMMP=Jabber, free instant messaging protocol !
    • PCLinuxOS Fr
Re: 2009.1 International, or how to change to a non-English locale
« Reply #128 on: May 26, 2009, 11:34:57 AM »
Hi,

quick update, now working on version 2.1  ;)  finally having what I wanted in addlocale from the very beginning: From 2.1, and thanks to the new 'Fast-Mode', addlocale can be run from the LiveCD before installing to hard-disk.

Hi,

Do not forget *not to let it restart the system* once the new locale added, otherwise all the changes will be lost !  :'(

 ;D

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

Offline pinoc

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2849
    • other projects...
Re: 2009.1 International, or how to change to a non-English locale
« Reply #129 on: June 03, 2009, 10:30:58 AM »
announcing addlocale 2.1 (check for it in the repos in the next days):
new features in version 2.1:
* logout has been reworked to function better
* translation definitions (mo-file database) updated to June, 3
* REINSTALL mode has been completely removed and is now replaced by FAST-mode alone.
* Reload package information will only be done if it never happened or longer than 1 hour before running addlocale.
and the big news:
* addlocale can now be run from a live-session, instructions for a live session:
 - start the 2009.1 liveCD (will not work with the 2007 or MiniME in live-session, they need to be installed AND updated first!) and login to the guest or root account.
 - ensure to have a working Internet connection, then start Synaptic, Reload, search for and install only addlocale (must be version 2.1 or later). Then close Synaptic.
 - run addlocale: Start -> System -> Configuration -> Add Locale  or from a root shell: /usr/sbin/addlocale
 - choose your locale and once addlocale has finished it should log out, if not you do it yourself but do not reboot of course...
 - login to the guest or root account and continue using your localized live-session or install the already localized system to your hard disk by clicking the desktop icon 'Install PCLinuxOS'


that's it  ;D The new live-session feature is something I wanted to have in addlocale from the very beginning and I'm very happy that it works finally. This also means that addlocale is now feature complete unless someone suggests something which should be included. The next version is foreseen once we have the new OO3.1 in our repos. Until then, have fun with the new addlocale 2.1!
I will update the original post when 2.1 is in the repos.

best,
-pinoc

Offline rogaven

  • PCLinuxOS Tester
  • Hero Member
  • *******
  • Posts: 558
  • be patient, I'm German
Re: 2009.1 International, or how to change to a non-English locale
« Reply #130 on: June 03, 2009, 11:16:46 AM »
great news
Nothing is perfect, not even my english
3.4.25-pclos1.pae.bfs - KDE: 4.10.1 Intel(R) Core(TM)2 Quad CPU Q8400 @ 2.66GHz - RAM: 8 GB - GeForce 8400 GS

Offline melodie

  • Hero Member
  • *****
  • Posts: 5942
  • XMMP=Jabber, free instant messaging protocol !
    • PCLinuxOS Fr
Re: 2009.1 International, or how to change to a non-English locale
« Reply #131 on: June 03, 2009, 11:42:21 AM »
Hi,

I did a try with fast feature this morning in a MiniMe 2008 upgraded to 2009. It worked perfectly, as sayd here, and I also asked if you could sit addlocale download part on wget, with a -c option.  8)

That would be cool !

Thanks a lot for this great work, that makes localisation in PCLinuxOS enter in a new era !

/btw, can we start to translate the english texts within addlocale zenity dialogs to the locale of our choice now ? :P



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

Offline pinoc

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2849
    • other projects...
Re: 2009.1 International, or how to change to a non-English locale
« Reply #132 on: June 03, 2009, 12:50:19 PM »
Hi melodie,

wget is already used and I will add a progress window in the next version so people see how the download proceeds. Yet, typically there are only 6-8MB to download which is a vast improvement over the 500MB which had to be downloaded before Fast-mode was available.

The zenity dialogs can now be translated though I can't guarantee to keep all dialogs identical for the next version 2.2. 2.2 should be out relatively soon after we have the new OO3.1 (Go-OO is already at RC7) and then you can call it a day and go ahead with the translations for sure.

best,
-p.

Offline melodie

  • Hero Member
  • *****
  • Posts: 5942
  • XMMP=Jabber, free instant messaging protocol !
    • PCLinuxOS Fr
Re: 2009.1 International, or how to change to a non-English locale
« Reply #133 on: June 03, 2009, 01:39:54 PM »
and then you can call it a day and go ahead with the translations for sure.

Cool for wget ! In the preceeding 2.x version (just this morning) I had to start it again (does your script use the "resume" function brought by the -c option of wget incase the connection gets interrupted ?)

+1 to wait for a more definitive version to start translating it. Would we have to translate it directly in the code, or would it be a patch, sort of "addlocale-fr ; addlocale-es ..." etc ? packages ?

If so how would we have to proceed ? Would we have to extract all the parts related to zenity ?



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

Offline pinoc

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2849
    • other projects...
Re: 2009.1 International, or how to change to a non-English locale
« Reply #134 on: June 04, 2009, 01:10:04 AM »
melodie,
at present you can not yet derive a pot-file from addlocale. For this to work, I need to add some things to the script. Just tested that and it works fine, so it will be included in the next version 2.2. Then you will only have to follow the steps outlined at the end of this post to setup localized mo-files for addlocale.
-p.