Author Topic: howto: french translation  (Read 29675 times)

domotiqa.com

  • Guru
  • ****
  • Posts: 206
    • View Profile
    • home automation
Re: howto: french translation
« Reply #30 on: January 28, 2008, 03:33:33 pm »
hy guys,
I created a SF project called linuxmce-fr:

https://sourceforge.net/projects/linuxmce-fr

People who want to invest are welcome !
http://www.domotiqa.com - home automation

domotiqa.com

  • Guru
  • ****
  • Posts: 206
    • View Profile
    • home automation
Re: howto: french translation
« Reply #31 on: January 28, 2008, 03:44:50 pm »
I'll do in couple days a new sql file from scratch for the 0710 version!
I'll put:
- sql file from "Text_LS"
- sql file from ""Text_Category"
- images from /usr/pluto/orbiter/skins/Basic/ ...

I guess if people are interresting to help, we can cut thes sql file in several part and each person can make contribution !
http://www.domotiqa.com - home automation

domotiqa.com

  • Guru
  • ****
  • Posts: 206
    • View Profile
    • home automation
Re: howto: french translation
« Reply #32 on: February 05, 2008, 06:16:34 pm »
ok,
my gui is a v2 blend... so in fact the pictures in the /usr/pluto/orbiter are not for me, it s only for the flat UI !

So I have to figure out why some word are still not traducted !
http://www.domotiqa.com - home automation

rafik24

  • Guru
  • ****
  • Posts: 158
    • View Profile
Re: howto: french translation
« Reply #33 on: February 11, 2008, 11:17:21 pm »
  Hi domotiqa.com,

 Please let me know if you need some help translating / testing, je suis dispo  (i`m available)

 Regards,

Rafik

LadislavH

  • Newbie
  • *
  • Posts: 4
    • View Profile
Re: howto: french translation
« Reply #34 on: March 07, 2008, 03:12:58 pm »
Will have a look to it !! However, look strange not to be in the main database !!
For example, in the security menu, on the top there is a "security" label !!
I success translating the security menu label but the label security, on top of the menu, is still security ! Look very strange !

Do you mean on the main screen of the Orbiter? There are pictures I guess not text labels. So, you have to replace them with French captions. BTW, nice work. I'm going to make Russian translation and your experience is very useful!

Also, I cannot find the language column in the table Text. If I understand clearly my translation will be replace English one?

hi, the untranslated stuff on the main screen are indeed pictures, but created by OrbiterGen from strings out of CommandGroup table.
this table is rewritten/updated by UpdateEntArea in (every? - I think) OrbiterGen run, so I guess by monday I'll have a patch ready for OrbiterGen and UpdateEntArea, after which you will be able to translate this normally in Text_LS table :)

actually I have it already working here, but the code needs a litlle ;) cleanup

Zaerc

  • Alumni
  • LinuxMCE God
  • *
  • Posts: 2256
  • Department of Redundancy Department.
    • View Profile
Re: howto: french translation
« Reply #35 on: March 07, 2008, 04:20:34 pm »
Nice work figuring that out LadislavH.
"Change is inevitable. Progress is optional."
-- Anonymous


nite_man

  • NEEDS to work for LinuxMCE
  • ***
  • Posts: 1019
  • Want to work with LinuxMCE
    • View Profile
    • Smart Home Blog
Re: howto: french translation
« Reply #36 on: March 07, 2008, 04:45:30 pm »
Good work, LadislavH! So, we'll have a fully translated interface!
Michael Stepanov,
My setup: http://wiki.linuxmce.org/index.php/User:Nite_man#New_setup
Russian LinuxMCE community: http://linuxmce.ru

LadislavH

  • Newbie
  • *
  • Posts: 4
    • View Profile
Re: howto: french translation
« Reply #37 on: March 18, 2008, 08:08:08 pm »
sorry guys, some unexpected stuff came up.

but i guess better late than never ;)
http://mantis.linuxmce.org/view.php?id=4092

domotiqa.com

  • Guru
  • ****
  • Posts: 206
    • View Profile
    • home automation
Re: howto: french translation
« Reply #38 on: March 20, 2008, 10:46:40 am »
thank for your help, greatly appreciated !
but I didn't really understand the aim of this process (lmce table for text not independant of the code)!
http://www.domotiqa.com - home automation

LadislavH

  • Newbie
  • *
  • Posts: 4
    • View Profile
Re: howto: french translation
« Reply #39 on: March 20, 2008, 01:37:42 pm »
but I didn't really understand the aim of this process (lmce table for text not independant of the code)!

sorry, I don't quite understand what you meant with the "not independant of the code". Because tables Text/Text_LS still are independant. If you meant those <%=Txxx%> anchors in CommandGroup table - these are standard lmce variable substitution codes and AFAIK even some variation to these can be found in Text_LS allready.

but if I'm missing the point completely, please let me know :)


domotiqa.com

  • Guru
  • ****
  • Posts: 206
    • View Profile
    • home automation
Re: howto: french translation
« Reply #40 on: March 29, 2008, 11:39:07 pm »
hy,

you said

Quote
but created by OrbiterGen from strings out of CommandGroup table
all strings are not from text table ! no luck, would have been bettrer before your patch !

for your patch, the only way is to compile the program, I'm right ? Don't you have pre-compiled files ?
http://www.domotiqa.com - home automation

domotiqa.com

  • Guru
  • ****
  • Posts: 206
    • View Profile
    • home automation
Re: howto: french translation
« Reply #41 on: August 06, 2008, 10:03:52 pm »
ok, so continue the thread:

from the great and nice translate script under:
http://forum.linuxmce.org/index.php?topic=4907.0

I change some parameters for french then get the WWW-Babelfish perl script:
Code: [Select]
http://www.cpan.org/authors/id/D/DU/DURIST/WWW-Babelfish-0.16.readme
Code: [Select]
wget http://cpan.uwinnipeg.ca/cpan/authors/id/G/GA/GAAS/libwww-perl-5.814.tar.gz
wget http://search.cpan.org/CPAN/authors/id/G/GA/GAAS/IO-String-1.08.tar.gz
wget http://www.cpan.org/authors/id/D/DU/DURIST/WWW-Babelfish-0.16.tar.gz
http://search.cpan.org/CPAN/authors/id/S/SA/SAMV/Lingua-Translate-0.09.tar.gz

then

Code: [Select]
After unpacking the tar file, do the usual in each downloaded tar:

        perl Makefile.PL
        make
make test
        sudo make install

here are the scripts (with chmod +x):

translationFr.sh
Code: [Select]

#### Global variables
lang_id=2;#french in db
base_lang_id=1;
lang_desc='Francais';
char_set='utf8';
###char_set='koi8r';
###char_set='cp1251';
###char_set='cp866';

dbuser='root';
dbip='localhost'

#### End Global variables


### create language entry
mysql -u$dbuser -h$dbip -e "insert into  \`pluto_main\`.\`Language\` (PK_Language, Description , psc_id) values ($lang_id ,\"$lang_desc\",$lang_id );"

### clean the xisting language from DB
mysql -u$dbuser -h$dbip -e "delete from pluto_main.Text_LS where FK_Language =$lang_id;"

### Read the first string id for english language
fk_text_=`mysql -u $dbuser -h $dbip -e "SELECT FK_Text FROM pluto_main.Text_LS where FK_Text > 0 and FK_Language=$base_lang_id and Description not like '%<\%%' order by FK_Text Limit 1"`;
### clean field name
fk_text=`echo $fk_text_ | cut -f 2 -d " "`

#### do this operation for each record in DB
while [ "$fk_text" != "" ] ; do
### Read the text for string id which stored in fk_text
   description_=`mysql -u$dbuser -h$dbip -e "select Description from pluto_main.Text_LS where FK_Text=$fk_text and FK_Language =$base_lang_id;"`
### clean field name
   description=`echo $description_ | sed  's/Description //' | sed 's/\\\n//'`;


### tralsation of the string
   description_rus=`echo $description |./trans e2f `;

### print for debug purpose
   echo -----------------------
   echo fk_text ::$fk_text::
   echo description::$description::
   echo description_rus::$description_rus::
   echo -----------------------

#### insert the translated string back to DB
   mysql -u$dbuser -h$dbip -e "insert into  \`pluto_main\`.\`Text_LS\` (FK_Text,FK_Language,Description) values($fk_text,$lang_id,\"$description_rus\");" --default-character-set=$char_set

### Read the next string id for english language
   fk_text_=`mysql -u$dbuser -h$dbip -e "SELECT FK_Text FROM pluto_main.Text_LS where FK_Text > $fk_text and FK_Language=$base_lang_id and Description not like '%<\%%' order by FK_Text Limit 1"`;

### clean field name
   fk_text=`echo $fk_text_ | cut -f 2 -d " "`

done;


trans
Code: [Select]
#!/usr/bin/perl -w

 use WWW::Babelfish;
     # Dummy UserAgent
 use constant AGENT =>
             'Mozilla/4.73 [en] (X11; U; Linux)';
     # Supported Languages
 my @languages = qw(English French German Italian
                  Portuguese Russian Spanish);
     # Build hash that assigns language abbreviations
     # to languages (e=>English, g=>German, ...)
 foreach my $language (@languages) {
     my $initial = substr($language, 0, 1);
     $i2full{lc($initial)} = $language;
}
     # All abbreviations in one string (efgpirs)
 my $chars = join '', keys %i2full;
     # Conversion direction from the
     # command line (g2e, e2f, ...)
 my $way = shift;
 usage() unless defined $way;
 usage("Scheme $way not supported") unless
 ($from, $to) = $way =~ /^([$chars])2([$chars])$/;
     # Read in text to be translated
my $data = join '', <>;
    # Contact Babelfish
my $babel = new WWW::Babelfish( service => 'Yahoo', agent => 'Mozilla/8.0');
usage("Cannot connect to Babelfish") unless
    defined $babel;
    # Perform translation
my $transtext = $babel->translate(
    source      => $i2full{$from},
    destination => $i2full{$to},
    text        => $data
);
die("Error: " . $babel->error) unless
    defined($transtext);
print $transtext, "\n";
##################################################
sub usage {
##################################################
    my $msg = shift;
    my $prog = $0;
    print "usage: $prog ",
          "[${chars}]2[${chars}] file ...\n";
    foreach $c (sort split //, $chars) {
        print " $c: $i2full{$c}\n";
    }
    exit(1);
}

« Last Edit: August 15, 2008, 05:32:41 pm by domotiqa.com »
http://www.domotiqa.com - home automation

domotiqa.com

  • Guru
  • ****
  • Posts: 206
    • View Profile
    • home automation
Re: howto: french translation
« Reply #42 on: September 13, 2008, 09:40:17 pm »
ok, I make the first release of french "pack" !
It includes 90% of the text_ls table changed from english to french ! It's a major part of google translation however I manually change some main used terms!

Still some terms that can not be translate from this table !!! I'll have a look with the fix made by LadislavH (for all word in text_ls table)

Here are the files:

https://sourceforge.net/projects/linuxmce-fr/


create_fr_file.sh: script for creating english snapshot of the db (only fk_text,description of english text_ls table record)
text_ls.csv: text_ls word "translated in french"
insertdb.sh: script for inserting the new french translated record with the french langage id



PS:   if people know how to translate the still remaining terms (are the patch still working - i will investigate)
PPS:  if people make some improvmnet on my personnal translation publish it , thanks
PPS:  these script (taken from brsisr and modified) can be easyli modify
http://www.domotiqa.com - home automation

domotiqa.com

  • Guru
  • ****
  • Posts: 206
    • View Profile
    • home automation
Re: howto: french translation
« Reply #43 on: September 13, 2008, 09:53:43 pm »
NB: to install, just put script in a dir, assign
Code: [Select]
chmod +xto the script, then run
Code: [Select]
./insertdb.sh
then reload/regen all orbiter, and reboot !!
http://www.domotiqa.com - home automation

pga57

  • Veteran
  • ***
  • Posts: 145
    • View Profile
Re: howto: french translation
« Reply #44 on: September 14, 2008, 09:50:59 am »
I have those errors:

linuxmce@dcerouter:~$ ./insertdb.sh
: command not found 2:
: command not found 3:
: command not found 4:
: command not found 8:
: command not found 9:
: command not found 12:
: command not found 13:
' (1) 2005 (HY000): Unknown MySQL server host 'localhost
: command not found 16:
' (1) 2005 (HY000): Unknown MySQL server host 'localhost
: command not found 18:
: command not found 20:
: command not found 22:
./insertdb.sh: line 29: syntax error near unexpected token `done'
./insertdb.sh: line 29: `done < text_ls.csv'

Is there something missing ?

Philippe