[Chameleon] Help - Translation problem - WMS Layers

Ines mleonsoft at yahoo.com.ar
Wed Aug 9 12:18:19 EDT 2006


Hello, I have a problem with adding WMS Layers.

I have traslated the "file.map" with the variables: LAYER_EN, LAYER_ES,
LAYER_PT. And I changed some lines and triplicated the file
legend_template.html. The thanslations look very well!

But my problem now is this: when I add a WMS Layer (home page / buttom
WMS Layers / Window Map Browser / select layer / buttom "add layer") The
layer is added to the map, but at the top of the left menu in the home
page, it don't show me the name of the new added layer, it shows:
"metadata name=LAYER_EN" (the name of the variable). I don't know how
traslate the WMS layers, but I don't need to translate the WMS Layers. I
don't know where are the the files that manage WMS Layers. And I think
that the application use file legend_layer.html for the WMS Layers.

I need to know if is possible add a layer (home page / buttom WMS Layers
/ Window Map Browser / select layer / buttom "add layer")and it show me
at the top of the left menu in the home page, the name of the added
layer (not the name of the variable).


This is the way I taked for translate the "file.map":

<div id="LegendLayer" name="LegendLayer">
<table>
  <cwc2 type="LegendTemplate" visible="true" embedded="true" 
template="[$legend_template$]" popupstyleresource="TextButtons" 
popupwidth="500" popupheight="400" status="false" menubar="false"/>
  <tr>
    <td colspan="4"><cwc2 type="UpdateMap" styleresource="TextButtons" 
visible="true" image="icons/icon_update.png" imagetip="update map" 
label="Update">
        <image state="normal"/>
        <image state="selected"/>
        <image state="hover"/>
    </cwc2>
</table>
</div>
 
Then add the following resource in sample_resource_en.php:
 
$aRes['legend_template'] = 'legend_template_en.html';
 
 
and in sample_resource_es.php:
 
$aRes['legend_template'] = 'legend_template_es.html';

and in sample_resource_pt.php:
 
$aRes['legend_template'] = 'legend_template_pt.html';
 
You have to copy legend_template.html under legend_template_en.html and 
under legend_template_fr.html.  You have to modify one line in 
legend_template_en.html:
 
    <td><a href="#" 
onclick="javascript:LegendTemplateLayerInfo('[leg_layer_name]');"><span 
class="label">[leg_layer_name]</span></a></td>
for:
    <td><a href="#" 
onclick="javascript:LegendTemplateLayerInfo('[leg_layer_name]');"><span 
class="label">[metadata name=LAYER_EN]</span></a></td>
 
 
and in legend_template_fr.html you have to change the same line for:
 
    <td><a href="#" 
onclick="javascript:LegendTemplateLayerInfo('[leg_layer_name]');"><span 
class="label">[metadata name=LAYER_FR]</span></a></td>
 
Finally in your mapfile (here we are talking about chameleon.map) you 
have to add two metadata in each layer, one for each language.  Here is 
an example for one of the layer:
 
   METADATA
    "DESCRIPTION"   "Parks"
    "RESULT_FIELDS" "NAME_E YEAR_EST AREA_KMSQ"
    "GROUP" "Polygon"
    "LAYER_EN" "park"
    "LAYER_FR" "parc"
  END



Thank You very much
Ines



More information about the Chameleon mailing list