[Chameleon] Help - problem with Translation

Ines mleonsoft at yahoo.com.ar
Thu Aug 3 10:28:28 EDT 2006


Norm,

I can't translate that. I think I'm making something wrong.

I did just it:

In: \ms4w\apps\"myapp"\htdocs\widgets\PrintProduction 

I added this two files: Production.sp-CA.txt and Print.sp-CA.txt for
Spanish translation.

Then, I opened Production.sp-CA.txt and I have this values:

0)Map Production
1)Seleccione y posicone the cartographic elements that should appear on
the final map layout.
2)Element
3)Position
4)Value .... Etc

Then I traslated every value in spanish:

0)Preoduccion de Mapas
1)Seleccione y posicione
2)Elemento
3)Posicion
4)Valor .... Etc

Now, I execute the aplication but I don't see any change. The content of
"Print Production" Windows is still in english. 

So, I did it just to prove:

In: \ms4w\apps\"chameleon"\htdocs\widgets\PrintProduction 

I opened the  Production.fr-CA.txt file. I can see the content. I
changed the first value just to prove:

0)Production d'une carte   for:   0)Produccion de Mapas

I executed the aplication:
http://localhost/chameleon/samples/sample_bilingual.phtml

But I see that in the "Print Production" window the title is the same:
"Production d'une carte" (don't take the change)

I think Chameleon don't take my changes or I think I have to do some
another reference in some file/s for chameleon take my changes. I can't
find the way to do it.

Thank You Again.

Ines


 


Ines wrote:

>Norm,
> I looked the files into the PrintProduction folder but the text to 
>translate is in the "production.phtml" file. I don't undesrstand very
>well:
>  
>
I guess you are refering to the text in the get method like the
following:

<title><?php echo $oMLT->get( 'Production', '0', 'Map Production' ); 
?></title>

found in the "production.phtml".

The get method of the MLT object uses the resource file to return the 
translated text. The first parameter of the get method is the resource 
file name. Depending of what language is set either one of the following

file is used: Production.en-CA.txt, Production.fr-CA.txt and 
Production.language-COUNTRY.txt.  The second parameter is the index 
found in the resource file before the parenthesis.  The last parameter 
is the default value in case the resource file is not found.

>I have to do this:
>Print.fr-CA.txt, Print.en-CA.txt, Production.en-CA.txt and 
>Production.fr-CA.txt,  adding
>Print.language-COUNTRY.txt and Production.language-COUNTRY.txt
>
>and then? Do I have to duplicate the production.phtml file too?   or
>anything more?
>
>  
>
No you don't have to duplicate the "production.phtml" file.  Just add 
the appropriate resource file for your language and edit the file to 
translate all the text in this language.

Norm



More information about the Chameleon mailing list