Index: [Article Count Order] [Thread]

Date:  Wed, 31 Oct 2007 07:20:02 +0100
From:  Pascal Gasser <p.gasser (at mark) wapspirit.ch>
Subject:  [coba-e:11019] Re: Translate in French (Howto: translations)
To:  coba-e (at mark) bluequartz.org
Message-Id:  <47281E92.7070807 (at mark) wapspirit.ch>
In-Reply-To:  <200710302051.33333.bq (at mark) solarspeed.net>
References:  <47275EB3.5040209 (at mark) wapspirit.ch> <200710302051.33333.bq (at mark) solarspeed.net>
X-Mail-Count: 11019

Hi Michael,

Thanks for your "howto",  
I will try to translate all files in French and after I will share the 
files.

Pascal



Michael Stauber a 辿crit :
> Hi Pascal,
>
>   
>> Who as translate the bluequarzt in French ? and if  It's  done  where
>> can  we find the file.
>>     
>
> As far as I know nobody has taken up the translation to French yet, but if 
> you're willing to give it a try, then you're more than welcome.
>
> The language support uses regular I18n methods, so the language files reside 
> in the /usr/share/locale/<LANG>/LC_MESSAGES/ directories:
>
> English:
> /usr/share/locale/en/LC_MESSAGES/
>
> Japanese:
> /usr/share/locale/ja/LC_MESSAGES/
>
> Each software package for the GUI has its own language file:
>
> base-vsite.mo <- for base-vsite (deals with Site management)
> base-user.mo <- for base-user (deals with user management)
> ... and so on. Just check out the directory with the English language files 
> and you'll see there are quite a few.
>
> As you'll notice, the *.mo files can't be edited directly. You need the 
> program "gettext" to "decrypt" them back into plain text. 
>
> So how to do the translation?
>
> First of all, copy all the /usr/share/locale/en/LC_MESSAGES/*.mo files to a 
> new directory. Like this:
>
> mkdir /home/my-translation
> cp /usr/share/locale/en/LC_MESSAGES/*.mo /home/my-translation/
> rm /home/my-translation/_swupdate* 
>
> Then install "gettext":
>
> yum install gettext
>
> Next "decrypt" the textfiles one by one. For that you use the "msgunfmt" 
> command like this:
>
> msgunfmt base-user.mo -o base-user.po
>
> This takes base-user.mo, decrypts it and stores the plain text version of it 
> under the name base-user.po.
>
> Then you edit base-user.po and replace the English text with French. You will 
> have to do that for each and any of the *.po files to make it a full 
> translation. 
>
> When you look at a *.po file you'll see that the text is usually in this 
> format in there:
>
> msgid "ipAddr"
> msgstr "IP Address"
>
> msgid "ipAddr_help"
> msgstr "This is the IP address of the site."
>
> The prefix "msgid" defines an identifier and the prefix "msgstr" contains 
> which text is to be displayed when the code for the GUI uses the "msgid".
>
> msgid's with the suffix "_help" at the end usually denote the "Help" text that 
> is shown in the bottom frame in the GUI when you move the mouse over an item 
> in the GUI.
>
> For example if you move the mouse over "IP Address" in the GUI, it will show 
> the help text "ipAddr_help" in the helper frame at the bottom.
>
> Eventually when all files are translated, you can turn them back into *.mo 
> files this way:
>
> msgfmt base-user.po -o base-user.mo
>
> Once you've done that, you can copy all the translated *.mo files to the 
> correct language directory:
>
> cp /home/my-translation/*.mo /usr/share/locale/fr/LC_MESSAGES/
>
> As you can see, that command moves them to the "fr" directory, which will be 
> used for French.
>
> Now how do you make the new language available in the GUI? After all, 
> in "Personal Profile" / "Account" / "Language" you have only "Japanese" 
> and "English" as choices. Well, here is how to do that:
>
> Run this command:
>
> /usr/sausalito/bin/cceclient
>
> That starts "cceclient" which allows you to manipulate the CODB (Cobalt Object 
> Database), into which the GUI stores its configuration. We need to find which 
> Object ID the class "System" has. 
>
> It will respond with this:
>
> 100 CSCP/0.80
> 200 READY
>
> Now type:
>
> find System
>
> It will responds something like this:
>
> 104 OBJECT 1
> 201 OK
>
> Now we know that Class "System" has the Object ID 1. Let us take a look at 
> which data that Object contains:
>
> get 1
>
> This shows us what's stored inside:
>
> 102 DATA productBuild = "5102R"
> 102 DATA NAMESPACE = ""
> 102 DATA productIdentity = "20061012"
> 102 DATA CLASSVER = "1.2"
> 102 DATA isRegistered = "0"
> 102 DATA CLASS = "System"
> 102 DATA gateway = "192.168.0.1"
> 102 DATA serialNumber = ""
> 102 DATA domainname = "smd.net"
> 102 DATA productName = "BlueQuartz 5100R Series"
> 102 DATA productBuildString = "build 20061012 for a 5102R in en_US"
> 102 DATA isLicenseAccepted = "1"
> 102 DATA OID = "1"
> 102 DATA productLanguage = "en"
> 102 DATA productSerialNumber = ""
> 102 DATA console = "1"
> 102 DATA productVendor = ""
> 102 DATA dns = "&192.168.2.1&192.168.10.1&68.166.46.236&"
> 102 DATA hostname = "cbq"
> 102 DATA locales = "&ja&en&"
> 201 OK
>
> The line ...
>
> 102 DATA locales = "&ja&en&"
>
> ... contains what we're looking for. The Object "System" has the 
> entry "locales", which currently only holds the values "ja" for Japanese 
> and "en" for English. Let us add French to that:
>
> set 1 locales = "&ja&en&fr&"
>
> When you get the response ...
>
> 201 OK
>
> ... the change has been made just fine.
>
> Now let us restart CCEd and AdmServ for good measure (just to be sure):
>
> /etc/init.d/cced.init restart
> /etc/init.d/admserv restart
>
> Now login to the GUI and under "Personal Profile" / "Account" / "Language" you 
> should be able to choose "French" as your default language for the account 
> that you just logged in with.
>
> You could also change "productLanguage" from "en" to "fr", but this will 
> require additional tweaking on the command line to make French the default 
> language for the entire GUI. Which is a bit beyond the scope of this 
> documentation.
>
> Once you have the translation done and want to contribute it to the BlueQuartz 
> project, please let us know here. We'd really appreciate that!
>
>   


-- 
Meilleures Salutations
 
Pascal Gasser
 
www.wapspirit.com
 
informations :
info (at mark) wapspirit.com
T辿l. 021/921 76 74
Fax. 021/964.17.91 


	

11019_2.html (attatchment)(tag is disabled)