Hello Mauro,
thank you very much for the quick reply. This helped me use the built-in
way rather than writing my own solution via an extension, though the
extension was pretty much ready to go at that point.
I noticed one rather big issue for some applications though:
"lang" really only specifies the lang, not the country. If I try to use
the locale instead, e.g. es_ES, it will simply not work. Or maybe I just
tried it the wrong way, who knows. But if not, wouldn't it be an easy fix
to allow for any kind of string as input to lang instead of the current
solution? Luckily for my purposes this isn't an issue.
A few other things that came up with my test cases:
Localized doesn't seem to accept a namespace. In my example the following
wouldn't work whereas the 2nd snipped worked:
<?xml version="1.0"
encoding="UTF-8"?><sld:StyledLayerDescriptor xmlns="
http://www.opengis.net/sld" xmlns:sld="http://www.opengis.net/sld" ....
<sld:Title>Design
<sld:Localized lang="es">Diseño</Localized>
<sld:Localized lang="pt">Design</Localized>
<sld:Localized lang="ru">Точность
сетки</Localized>
</sld:Title>
working:
<sld:Title>Design
<Localized lang="es">Diseño</Localized>
<Localized lang="pt">Design</Localized>
<Localized lang="ru">Точность сетки</Localized>
</sld:Title>
When uploading a style through the GUI it is not encoded as UTF8 and the
internationalised values are mangled. I had to upload them manually into
the styles directory instead.
Thank you once again and have a good day :)
Cheers,
Michael
From: Mauro Bartolomeoli <[email protected]>
To: Michael Colin <[email protected]>
Cc: GeoServer Mailing List List
<[email protected]>
Date: 11/09/2015 05:40 PM
Subject: Re: [Geoserver-users] WMS GetLegendGraphic i18n
Hi Michael,
indeed there is some support for it, but it's not well documented (I will
try to add some documentation ASAP).
You can use the parameter LANGUAGE to choose a particular locale, then you
can use the following syntax in SLD to specify some of the metadata in
several languages:
<Title>Basso-Basso
<Localized lang="it">Basso-Basso</Localized>
<Localized lang="en">Low-Low</Localized>
<Localized lang="fr">Faible-Faible</Localized>
<Localized lang="de">Niedriges-Niedriges</Localized>
</Title>
The text directly inside Title is the default (when no language parameter
is specified). The text in a Localized tag is used when LANGUAGE is equal
to the lang attribute value.
This syntax can be used for the following SLD Title and Abstract tags.
Regards,
Mauro
2015-09-11 0:50 GMT+02:00 Michael Colin <[email protected]>:
Hello :)
I recently started using GeoServer and am currently trying to learn the
ropes. My new project has been using GeoServer for some time now. They
currently are on version 2.5. Now I received the task to add
internationalization to the legend drawn from the style of a layer. I
could do it with custom functions but I would prefer a native way over
building my own mechanism. I found this mailing list entry:
http://osgeo-org.1560.x6.nabble.com/SLD-and-Internationalization-td5054597.html
which seems to address my issue exactly. But as I can find no mention of
this in the documentation I am not sure if this made it into the
application as of yet.
Does anyone know if the SLD i18n was implemented? And if so, which
parameter do I have to set to define the locale for the getLegendGraphic (
http://docs.geoserver.org/stable/en/user/services/wms/get_legend_graphic/legendgraphic.html#get-legend-graphic
) request?
Cheers,
Michael
------------------------------------------------------------------------------
_______________________________________________
Geoserver-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geoserver-users
------------------------------------------------------------------------------
_______________________________________________
Geoserver-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geoserver-users