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

dagsljos

  • Guest
Re: 2009.1 International, or how to change to a non-English locale
« Reply #45 on: March 24, 2009, 04:08:45 AM »
dude... I see em eyes a rolling ... ;D now get back to work... lazy bum  ;D ;D ;D ;D ;D ;D

Offline Uggla

  • Full Member
  • ***
  • Posts: 206
Re: 2009.1 International, or how to change to a non-English locale
« Reply #46 on: March 24, 2009, 04:15:37 AM »
Scoundrel & Uggla,

just figured out how to do and apply all missing mo-files to get Synaptic, k9copy, etc into Swedish or other languages. Now I need to think about a smart solution to provide all these files  ::)
this is fun...

-pinoc

Sounds great! Keep up the good work!  ;D

/Uggla

Offline melodie

  • Hero Member
  • *****
  • Posts: 5945
  • Internet Relay Chat sur Freenode
    • PCLinuxOS Fr
Re: 2009.1 International, or how to change to a non-English locale
« Reply #47 on: March 24, 2009, 05:03:20 AM »
Hi,

I've got one more question (and will try to find out what in a virtual machine in the meanwhile). What if addlocale is used before updating anything ?

I wonder if it would not be more profitable in words of bandwidth : I only have a 1 Mo large adsl connexion, which is the most common in France when not living in a city. (Happy I don't have a RTC anymore).

The question is there. :)

Thanks for your previous answers too, I got good use of them too.

/Edit : it looks like it's not useful to upgrade all before lounching addlocale. addlocale upgrades what's necessary:

http://pastebin.com/m247114db

:)


« Last Edit: March 24, 2009, 05:31:25 AM by melodie »
melodie at #lpic-fr on irc.freenode.net

Online pinoc

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2880
    • other projects...
Re: 2009.1 International, or how to change to a non-English locale
« Reply #48 on: March 24, 2009, 05:32:48 AM »
Hi melodie,

before doing anything else addlocale will automatically update the system.  This initial update is required to ensure a stable system and having all dependencies in order and for this reason you should not forcefully disable this step in the script.

To save bandwidth and achieve a maximum conversion of the system you should follow these steps:
- install the latest PCLOS in English, well, you have to  ;)
- remove anything you do not want and do not install anything new!
- reload the package information and update all
- search for and install addlocale from Synaptic
- quit Synaptic and run addlocale from the menu: Start -> System -> Configuration -> Add Locale

AFTER these steps any newly added applications will automatically appear in the new system locale but only if a translation for these newly added applications exist.

good luck,
-pinoc
 

icecruncher

  • Guest
Re: 2009.1 International, or how to change to a non-English locale
« Reply #49 on: March 24, 2009, 09:33:32 AM »
pinoc,
is everything that is you need to know in the first thread?
are there fixes or more instructions?
would you please edit the first post if so?
thanks in advance.
~ice

Online pinoc

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2880
    • other projects...
Re: 2009.1 International, or how to change to a non-English locale
« Reply #50 on: March 24, 2009, 11:57:13 AM »
Hi icecruncher,

re-wrote the OP and hope to have all included now.

best,
-pinoc

icecruncher

  • Guest
Re: 2009.1 International, or how to change to a non-English locale
« Reply #51 on: March 24, 2009, 03:06:27 PM »
thanks pinoc,
check out http://docs.pclinuxos.com/Quick_Start:Localize and tell me what you think.

have a nice day
~ice

Offline melodie

  • Hero Member
  • *****
  • Posts: 5945
  • Internet Relay Chat sur Freenode
    • PCLinuxOS Fr
Re: 2009.1 International, or how to change to a non-English locale
« Reply #52 on: March 24, 2009, 05:42:48 PM »
Hello,

After using addlocale on one additional new install, I found that part of the menus in Gparted not yet translated became french after I reinstalled gtk2. Wasn't gtk-2 forgotten in the addlocale script ?

Otherwise, I confirm what I was supposing previously : I still believe that just running addlocale takes care by itself of all the upgrades that need being done, so it's not useful to upgrade system before, and can be the first installed and launched.

melodie at #lpic-fr on irc.freenode.net

dagsljos

  • Guest
Re: 2009.1 International, or how to change to a non-English locale
« Reply #53 on: March 25, 2009, 02:08:38 AM »
Hello,

After using addlocale on one additional new install, I found that part of the menus in Gparted not yet translated became french after I reinstalled gtk2. Wasn't gtk-2 forgotten in the addlocale script ?

Otherwise, I confirm what I was supposing previously : I still believe that just running addlocale takes care by itself of all the upgrades that need being done, so it's not useful to upgrade system before, and can be the first installed and launched.



noticed on a fresh install that it does update ..but it is a selective update.. after doing the addlocale I checked in synaptic and there were a few packages not installed ......hence pinoc's advice of updating first

Offline melodie

  • Hero Member
  • *****
  • Posts: 5945
  • Internet Relay Chat sur Freenode
    • PCLinuxOS Fr
Re: 2009.1 International, or how to change to a non-English locale
« Reply #54 on: March 25, 2009, 02:23:02 AM »

noticed on a fresh install that it does update ..but it is a selective update.. after doing the addlocale I checked in synaptic and there were a few packages not installed ......hence pinoc's advice of updating first

But if you get updades for all the packages that will be reinstalled for the localization, you don't gain time and  bandwidth : you may as well do a final update in Synaptics after addlocale finishes the job. Which is indeed what I have done for mine.

And yes, you use it on a fresh install : otherwise, what is the point ?  ;)

I think this script would do well for other desktops too, such as the Pclos Gnome Edition, (if it was adapted for Gnome desktops). :P


melodie at #lpic-fr on irc.freenode.net

Online pinoc

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2880
    • other projects...
Re: 2009.1 International, or how to change to a non-English locale
« Reply #55 on: March 25, 2009, 02:59:40 AM »
@icecruncher: thanks a lot for this and also for leaving the old page in there, this is still an interesting read! Depending on future developments I may need to update the OP but I will keep you posted on this. Thanks again!

@melodie: addlocale does a system upgrade before doing anything else. The reason I suggest to do a full system upgrade before running addlocale is the following:
1. The initial aim of addlocale was to check for and apply the new locale to the default applications of a fresh 2009 installation because anything you add on top of this after having changed the locale will then be in the new locale without the need to reinstall the new application. 
2. Yet, addlocale can also be applied to a 2007 or MiniME installation. But if you start with one of these, or have one of these running, you first have to do the Big Update which requires a reboot etc until you are uptodate. This can not be accomplished from within addlocale.  If you try to do that nevertheless, then addlocale would start changing things while the Big Update interrupts this process with a reboot, not a good idea... And if the BU has been applied already then another reason is that future updates may require a reboot or any other actions by the user or the update, who knows.  Hence, a full update is suggested just to ensure
- the Big Update has been applied successfully and we are not at risk of having to do a reboot or something else interrupting the conversion
- the system is uptodate and running stable because this is the safest base for successfully adding a new localization.
- addlocale will pull in the latest version of any localized programs
Finally, if you are concerned about bandwidth then please set Synaptic -> Settings -> Preferences -> Files -> Leave all downloaded packages in the cache, then the downloaded packages during the update phase will remain available for reinstallation by addlocale.

Thanks for mentioning the gtk reinstall changed gparted. That may not have been necessary if addlocale had been applied earlier, or just to understand: you applied addlocale on a fresh 2009 install without any additional packages, then you added gparted (which appeared in English), then you reinstalled gtk+2.0, and after that gparted appeared in French? In this case I have to add gtk+2.0 to addlocale.

A rule of thumb:
the later you run addlocale the more applications have to be reinstalled, the more tricky it is to check which application can be localized and on what it depends, the more you will have to download for the reinstallation, the slower and potentially less efficient will be the conversion. For all these reasons, the advice: run addlocale as early as possible.
 
(In fact, personally, I would even go that far to suggest a fresh 2009 install. It is totally unclear to me why people go through the hassle of downloading 1GB or more of updates, wait for an hour until that completes, and then another hour or even more until all these updates are installed, risking to run into whatever issues, reboot, update again... ??? ??? ??? They can start with a clean, well tested setup only 5 minutes after starting the installer from the 2009 LiveCD  ::), well, just my 2 cents... )

regards,
-pinoc
« Last Edit: March 25, 2009, 03:07:27 AM by pinoc »

Offline melodie

  • Hero Member
  • *****
  • Posts: 5945
  • Internet Relay Chat sur Freenode
    • PCLinuxOS Fr
Re: 2009.1 International, or how to change to a non-English locale
« Reply #56 on: March 25, 2009, 04:47:58 AM »
@melodie: addlocale does a system upgrade before doing anything else. The reason I suggest to do a full system upgrade before running addlocale is the following:
(...)
Thanks for mentioning the gtk reinstall changed gparted. That may not have been necessary if addlocale had been applied earlier, or just to understand: you applied addlocale on a fresh 2009 install without any additional packages, then you added gparted (which appeared in English), then you reinstalled gtk+2.0, and after that gparted appeared in French? In this case I have to add gtk+2.0 to addlocale.

A rule of thumb:
the later you run addlocale the more applications have to be reinstalled, the more tricky it is to check which application can be localized and on what it depends, the more you will have to download for the reinstallation, the slower and potentially less efficient will be the conversion. For all these reasons, the advice: run addlocale as early as possible.
 
(In fact, personally, I would even go that far to suggest a fresh 2009 install. It is totally unclear to me why people go through the hassle of downloading 1GB or more of updates, wait for an hour until that completes, and then another hour or even more until all these updates are installed, risking to run into whatever issues, reboot, update again... ??? ??? ??? They can start with a clean, well tested setup only 5 minutes after starting the installer from the 2009 LiveCD  ::), well, just my 2 cents... )

+1 on all this.

That's precisely what I do : I saw a few people's examples on the forum, not even advanced users, who click directly on "upgrade all" when the new stable release was almost there and what happened ? Only miseries.

Instead of this I keep my MiniMe 2008 running with old componants, when there is a new Firefox or a new version for my mail client I upgrade juste theses, and I start installing a brand new PCLOS 2009 on another partition. When it will be all ready and fit to work and have fun with it, all applications I'm used to installed and tweaked to my taste, I'll suppress the old MiniMe install, unless I finally decide I prefer a new MiniMe 2009 fresh install when it will be ready.

In the meanwhile when I need Minime for some tasks it's there for me, as strong as ever.*   :D

(I've done that with Archlinux too, and the old will soon be changed into free disk space ! )

In one case as well as in another I obviously did the localization to french at the very beginning !

In MiniMe I had done it the old way, following the instructions in the documentation and reinstall all componants of the system + a few applications because I didn't know the special Pclos way for localization at this time, in PCLinuxOS I started the same way, but then saw your post in the french section. After that I had again a new install : after the laptop I installed it on the desktop, directly with addlocale this time.

All this to say that if people do the things this way : localize always on fresh installs, imo there is no point in upgrading all before running addlocale.  ;)

About Gparted : I had installed it after running addlocale, the thing is that some of the menus stay in english, not all of them. One was "menu > Fichier > Quit". After reinstalling gtk 2, it became "menu > Fichier > Quitter", which is better. Some of the menus are still in english thought, as well as in other applications. Xchat has mostly context menus in english, and so are many others.

I read someone was suggesting to go get the mo and po files from Ubuntu packages, that's a good idea I think.

It may be that the french localisation is in progress : it seems that the texts in the Center Control are much better localised than thoses in my MiniMe 2008.

I will see how french newbies react at next opportunity I will have. I'm trying to make a localised remaster in french (with guest and root as users, and install unfinished option). :)

« Last Edit: March 25, 2009, 04:50:25 AM by melodie »
melodie at #lpic-fr on irc.freenode.net

Online pinoc

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2880
    • other projects...
Re: 2009.1 International, or how to change to a non-English locale
« Reply #57 on: March 25, 2009, 07:28:18 AM »
in a Swedish install a reinstall of 'gtk+2.0' changed some more menu entries to Swedish, so I will add gtk+2.0 to the next version of addlocale.

The following is only for those guys who want to get more than addlocale can achieve...
Another useful information to get even more applications showing in the new locale: any application-specific language file containing most of the translation for that application is located under: /usr/share/locale/XX/LC_MESSAGES/application.mo
The following should work for any application and any locale, let's take the example of Synaptic in Swedish:
addlocale will reinstall Synaptic to make Synaptic show up in German, French, Italian, etc. This works fine for these languages but it does not work for Swedish simply because there is no Swedish translation in the PCLOS Synaptic package, e.g., do a:
Code: [Select]
rpm -qlp /var/cache/apt/archives/synaptic-0.57.2-17pclos2007.i586.rpm | grep synaptic.mo
Yet, we can still get Synaptic into Swedish. You can either
- go to a PC where you know that Synaptic is in Swedish (Ubuntu), then copy the file  /usr/share/locale/sv/LC_MESSAGES/synaptic.mo from that PC to your PCLOS installation in the right place (/usr/share/locale/sv/LC_MESSAGES/), start Synaptic and it will be now be in Swedish
- go to https://translations.launchpad.net/ubuntu/jaunty/+translations, click your locale, search for and click on the application you need, then on the new page click the button Download, on the new page choose mo-format, and let Launchpad email the file to you (you need to be registered with launchpad for this to work). For this example, the file will be called 'sv_LC_MESSAGES_synaptic.mo', rename that to 'synaptic.mo' and copy it in the right place
- do a Google search for the required file (don't forget to include the country code): sv/LC_MESSAGES/synaptic.mo
* If you find the file directly, just copy it to the right place: /usr/share/locale/sv/LC_MESSAGES/
* If it is inside of a rpm package, then download the rpm, place the rpm into a new empty directory, and extract the files of the rpm in this directory using the command
Code: [Select]
rpm2cpio mynewrpm.rpm | cpio -idmv, then find and copy the Swedish synaptic.mo file to the right place
* if it is inside a deb-package, do the same as with the rpm and extract the deb using the command
Code: [Select]
ar xv mynewdeb.deb, then find and copy the Swedish synaptic.mo file to the right place
* if it is in a source tar ball, download and extract it into an empty directory, then find and copy the Swedish synaptic.mo file to the right place.
* if you do not find the synaptic.mo file but instead a file called 'synaptic.po' or in the extracted application directory a file 'sv.po' then this file can be converted into a required mo-file using:
Code: [Select]
msgfmt synaptic.po -o synaptic.mo, then copy the new synaptic.mo to the right place.

I checked Mandriva, Fedora, and others but it seems that only Ubuntu provides an archive of po-files for download. Then I wrote a script which converts all po-files into mo-files, resulting in a mo-files database of ~ 800MB. So, instead of downloading individual mo-files you could browse this database for missing language specific application mo-files on your system. Let me know if this could be of interest.

-pinoc

Offline Uggla

  • Full Member
  • ***
  • Posts: 206
Re: 2009.1 International, or how to change to a non-English locale
« Reply #58 on: March 25, 2009, 01:52:55 PM »
I checked Mandriva, Fedora, and others but it seems that only Ubuntu provides an archive of po-files for download. Then I wrote a script which converts all po-files into mo-files, resulting in a mo-files database of ~ 800MB. So, instead of downloading individual mo-files you could browse this database for missing language specific application mo-files on your system. Let me know if this could be of interest.

Is 800MB the size of all locales together? Whats the average locale size?

Would it be possible to do a match between installed apps, installed mo-files, and available mo-files in the database?

/Uggla

Offline melodie

  • Hero Member
  • *****
  • Posts: 5945
  • Internet Relay Chat sur Freenode
    • PCLinuxOS Fr
Re: 2009.1 International, or how to change to a non-English locale
« Reply #59 on: March 25, 2009, 03:17:41 PM »
Same as Uggla, I'm interested in both the bunch of files and the possibility to do an intelligent search in the database (sort of a local repository ?)

melodie at #lpic-fr on irc.freenode.net