RV: [Chameleon] Add new language, template chameleon, please help

Ines mleonsoft at yahoo.com.ar
Tue Jul 18 20:58:57 EDT 2006


Normand,

Thank you very much for your help! I have my page multi-languaje Ok.
Now, I need to know wich is the correct way to translate the cw2c tags or
the rest.

I have 3 lenguajes, and 3 templates

I have to translate all text and all images, and I saw that I have to
translate:

* All images
* All the text:
1) Text of ReferenceLayer,

2) NavToolsLayer, TopTabsLayer,

2) I'm not sure if it is the Text of the file.map: can you help me with this
flie? where is located? The file/s that manage the Lengend and Tools Tab for
translate the text of Legend tab (grid, popplace, road...) and the images of
Tools tab like looks the page "sample_bilingual.phtml" at the left of the
page.


So, I need to know if I have to change the text in every CW2C tag  in every
template to translate the text, and if I have to duplicate the images with
the correct language and reference every new image in every CW2C tag in
every template.

I want to make the translation in the correct way.

Thanks again!

Ines






-----Mensaje original-----
De: Normand Savard [mailto:nsavard at mapgears.com]
Enviado el: jueves, 13 de julio de 2006 12:21
Para: Ines
CC: chameleon at lists.maptools.org
Asunto: [Bulk] Re: [Chameleon] Add new language, template chameleon,
please help


Ines wrote:

>Hello, I'm a new user of Chameleon. I have to make a web page with this map
>server in 3 languages: english, spanish, portuguese. I'm new in this type
of
>project, and I don't understand wery well how can I do to do it. I readed
>this link:
>http://chameleon-tiki.maptools.org/tiki-index.php?page=How+to+add+a+new+lan
g
>uage+file+to+a+widget&highlight=language
>
>I maked that, but I Don't know how to continue. Is in your page some
>tutorial "step by step" that can help me?
>
>
>
Ines,

I don't think there is any tutorial on this topic.  The best way is to
look to the sample_bilingual application.  The language files you made
are used for the translation of the widgets.   For example when you load
sample_bilingual.phtml in your browser and click on tools, then on
locate, the text is written in English.  If you switch language by
clicking the French link in the upper left corner of the application and
you repeat the steps above the text will appear in French.

In order to have a multilanguage application you need to add the
following line in the phtml file:

$oApp->CWCAddRegionalTemplate( 'en-CA',
dirname(__FILE__).'/yourapp_en.html',
dirname(__FILE__).'/sample_resource_en.php' );
$oApp->CWCAddRegionalTemplate( 'fr-CA',
dirname(__FILE__).'/yourapp_fr.html',
dirname(__FILE__).'/sample_resource_fr.php' );
$oApp->CWCAddRegionalTemplate( 'fr-CA',
dirname(__FILE__).'/yourapp_pt.html',
dirname(__FILE__).'/sample_resource_pg.php' );
$oApp->CWCInitialize( dirname(__FILE__).'/yourapp_pt.html', $szMapFile  );

Then in the html file you will need some links to switch from one
language to the other like for example in the yourapp_pt.html file:

<div id="LanguageLayer" name="LanguageLayer">
  <table border="0" cellspacing="0" cellpadding="1">
    <tr>
      <td><cwc2 type="Link" linktype="javascript"
jsfunction="setLanguage" jsparams="en-CA" styleresource="TextButtons"
Label="English" ImageTip="Click to set language to English"
ImageWidth="50" ImageHeight="20" LabelAlign="center">
              <image state="normal"/>
              <image state="hover"/>
              <image state="selected"/>
          </cwc2></td>
       <td><cwc2 type="Link" linktype="javascript"
jsfunction="setLanguage" jsparams="fr-CA" styleresource="TextButtons"
Label="French" ImageTip="Click to set language to French"
ImageWidth="50" ImageHeight="20" LabelAlign="center">
              <image state="normal"/>
              <image state="hover"/>
              <image state="selected"/>
          </cwc2></td>
   </tr>
  </table>
</div>


The default language can be set in chameleon.xml configuration file.


Regards,

Norm



More information about the Chameleon mailing list