[Geoserver-devel] Internationalizing GeoServer OWS services

Hi,
recently we started thinking on how to support internationalized OWS services
in GeoServer, and I wanted to share some considerations with the community
and gather some feedback (btw, no, don’t hold your breath on it just yet, this is just preliminary
research).

The first bit would be to make the capabilities documents generated by GeoServer
respect the lang parameter and return caps documents in a specific language.
While the layer/feature type names would not change, this would require metadata
like title and abstract, as well as some parts of
the service description to be available not as simple strings, but as list of values
in different languages (maps).
Keywords already seem to support the language concept, and I’m wondering if
metadata links may need internationalization support too.

Configuration wise I’d see this as a change from using String to use GeoTool’s
own InternationalString interface, XML storage wise the change would be similar,
e.g. from:

buildings

to:

buildings edifici batiments

The XStream reading code would be backwards compatible and associate
the eventual single string to the default language.

And oh, there would be some place in GeoServer (global settings I guess)
where the list of supported languages would be made configurable.

GUI wise I’m picturing a situation in which multilanguage fields would appear
in all the different supported languages at the same time.
The idea of having some sort of combo, either local to the text field or the
page, allowing to switch the current language, has been taken into consideration
as well, but there are downsides:

  • the field local one is a bit tedious, as one would have to switch it for every field
  • the page global one makes it difficult/impossible to locate the few fields that need to be
    internationalized
  • either case would make it difficult to see if all the languages have been filled in.

A setup where the field is repeated for all the configured languages, each version clearly
labelled with the language, is better in all the above respects, even if it would eat quite
a bit of space.
Maybe we could have only the configured languages appear, with a button to add a
field for any of the missing languages… but I mean, the point of having a internationalize
server is really to fill all the metadata in the various languages anyways, so one would
have to expand all the languages anyways.

Internationalizing the other requests presents greater difficulties: GetMap should
report labels in the requested language, GetFeatureInfo and GetFeature should
return strings in the proper language.
Now, I imagine a database structure having columns such as name_en,
name_fr, name_it, and GeoServer needs to expose those as “name” picking
the right column from the data source based on the currently requested language.
And we’d need to make this “attribute grouping” configurable too from the UI.

I believe this could be doable using the TransformFeatureStore I’ve been working
on last year, now available as a community module in GeoTools,
by creating a filter function that is language aware… special optimizations for
this one would be nice too, so that the code only ends up reading the string
we need from the database.
The GUI for the name field would then associate it with a CQL expression like:
“internationalize(env(‘lang’), ‘en’, name_en, ‘fr’, name_fr, ‘it’, name_it)”
(maybe for this one a custom GUI could be made to simplify the setup…).

Making sure that also all filters work fine against these fields, and be efficient
too, might prove to be “loads of fun” ™ :-p

Anyways, what do you think? Opinions welcomed

Cheers
Andrea

==
Our support, Your Success! Visit http://opensdi.geo-solutions.it for more information.

Ing. Andrea Aime
@geowolf
Technical Lead

GeoSolutions S.A.S.
Via Poggio alle Viti 1187
55054 Massarosa (LU)
Italy
phone: +39 0584 962313
fax: +39 0584 1660272
mob: +39 339 8844549

http://www.geo-solutions.it
http://twitter.com/geosolutions_it


When I explored this issue previously (Canada always wants French and English) an inline approach was recommended to provide all the translations at the same time … cannot quite figure out how this works for a GetCapabilieis document (they may of just been having me on):

Hello WorldCiao Mondo

I assume just encoding something like the above does not do it for you?

GUI wise I can think of a compromise between your two suggestions:

Next to each translatable field indicate which translations are filled in:

Title: Hello World
fr DE [EN] es it

(So in the above we have english and german text for Hello World, and english is currently displayed)

Clicking on a language can switch the whole page over to that language, including the current field, leave the field empty, or offer “the default” which will otherwise be used if a translation is not proved (as shown below).

Title: Hello World
fr DE EN es [it]

(In the above we still have english and german text for hello world)

The translation can be typed in to replace the default:

Title: Ciao Mondo
fr DE EN es [IT]

(We have now filled in Italian)

When editing it may be feasible to show all the translations for that field as a tooltip style overlay.


Jody Garnett

On Friday, 22 February 2013 at 5:11 AM, Andrea Aime wrote:

Hi,
recently we started thinking on how to support internationalized OWS services
in GeoServer, and I wanted to share some considerations with the community
and gather some feedback (btw, no, don’t hold your breath on it just yet, this is just preliminary
research).

The first bit would be to make the capabilities documents generated by GeoServer
respect the lang parameter and return caps documents in a specific language.
While the layer/feature type names would not change, this would require metadata
like title and abstract, as well as some parts of
the service description to be available not as simple strings, but as list of values
in different languages (maps).
Keywords already seem to support the language concept, and I’m wondering if
metadata links may need internationalization support too.

Configuration wise I’d see this as a change from using String to use GeoTool’s
own InternationalString interface, XML storage wise the change would be similar,
e.g. from:

buildings

to:

buildings edifici batiments

The XStream reading code would be backwards compatible and associate
the eventual single string to the default language.

And oh, there would be some place in GeoServer (global settings I guess)
where the list of supported languages would be made configurable.

GUI wise I’m picturing a situation in which multilanguage fields would appear
in all the different supported languages at the same time.
The idea of having some sort of combo, either local to the text field or the
page, allowing to switch the current language, has been taken into consideration
as well, but there are downsides:

  • the field local one is a bit tedious, as one would have to switch it for every field
  • the page global one makes it difficult/impossible to locate the few fields that need to be
    internationalized
  • either case would make it difficult to see if all the languages have been filled in.

A setup where the field is repeated for all the configured languages, each version clearly
labelled with the language, is better in all the above respects, even if it would eat quite
a bit of space.
Maybe we could have only the configured languages appear, with a button to add a
field for any of the missing languages… but I mean, the point of having a internationalize
server is really to fill all the metadata in the various languages anyways, so one would
have to expand all the languages anyways.

Internationalizing the other requests presents greater difficulties: GetMap should
report labels in the requested language, GetFeatureInfo and GetFeature should
return strings in the proper language.
Now, I imagine a database structure having columns such as name_en,
name_fr, name_it, and GeoServer needs to expose those as “name” picking
the right column from the data source based on the currently requested language.
And we’d need to make this “attribute grouping” configurable too from the UI.

I believe this could be doable using the TransformFeatureStore I’ve been working
on last year, now available as a community module in GeoTools,
by creating a filter function that is language aware… special optimizations for
this one would be nice too, so that the code only ends up reading the string
we need from the database.
The GUI for the name field would then associate it with a CQL expression like:
“internationalize(env(‘lang’), ‘en’, name_en, ‘fr’, name_fr, ‘it’, name_it)”
(maybe for this one a custom GUI could be made to simplify the setup…).

Making sure that also all filters work fine against these fields, and be efficient
too, might prove to be “loads of fun” ™ :-p

Anyways, what do you think? Opinions welcomed

Cheers
Andrea

==
Our support, Your Success! Visit http://opensdi.geo-solutions.it for more information.

Ing. Andrea Aime
@geowolf
Technical Lead

GeoSolutions S.A.S.
Via Poggio alle Viti 1187
55054 Massarosa (LU)
Italy
phone: +39 0584 962313
fax: +39 0584 1660272
mob: +39 339 8844549

http://www.geo-solutions.it
http://twitter.com/geosolutions_it



Everyone hates slow websites. So do we.
Make your web apps faster with AppDynamics
Download AppDynamics Lite for free today:
http://p.sf.net/sfu/appdyn_d2d_feb


Geoserver-devel mailing list
Geoserver-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-devel

2013/2/21 Andrea Aime <andrea.aime@anonymised.com>

Internationalizing the other requests presents greater difficulties:
GetMap should
report labels in the requested language, GetFeatureInfo

Hi Andrea. For this 2 specific cases, I was thinking of a simple approach
that could be implemented as a first step to add some form of
internationalization.
For GetFeatureInfo, it would be useful to have different templates (with a
prefix or suffix in the name) depending on a request parameter.
For GetMap the env variable substitution in SLD could be used to build a
different PropertyName for labeling (currently this doesn't seem to be
feasible, I think because env variable substitution can only produce a
Literal and not a PropertyName). I was thinking of something like this:

            <Label>
               <ogc:PropertyName>
                 <ogc:Function name="Concatenate">
                   <ogc:Literal>STATE_</ogc:Literal>
                   <ogc:Function name="env">
                     <ogc:Literal>lang</ogc:Literal>
                     <ogc:Literal>EN</ogc:Literal>
                   </ogc:Function>
                </ogc:Function>
              </ogc:PropertyName>
            </Label>

Do you think this could be useful in the intended direction and easy to
implement?
Thanks.
Mauro Bartolomeoli

--

Our support, Your Success! Visit http://opensdi.geo-solutions.it for more
information.

Dott. Mauro Bartolomeoli
@mauro_bart
Senior Software Engineer

GeoSolutions S.A.S.
Via Poggio alle Viti 1187
55054 Massarosa (LU)
Italy
phone: +39 0584 962313
fax: +39 0584 1660272

http://www.geo-solutions.it
http://twitter.com/geosolutions_it

-------------------------------------------------------

We do have the “property” function that can be used for the purpose, and that would work for GetMap.
For GetFeatureInfo in HTML format we could roll out FTL templates and inject the language in the HTML
template.

However, for any other GetFeatureInfo output format (text, gml, json) we’re toast, there is no templating,
and for GetFeature it’s the same.
Now that I think about it, we might also have problems with GetLegendGraphics, the titles are coming from
the rule titles right? But afaik there is no way to specify multiple titles in different languages in an SLD.

Cheers
Andrea

···

Hi Andrea. For this 2 specific cases, I was thinking of a simple approach that could be implemented as a first step to add some form of internationalization.
For GetFeatureInfo, it would be useful to have different templates (with a prefix or suffix in the name) depending on a request parameter.
For GetMap the env variable substitution in SLD could be used to build a different PropertyName for labeling (currently this doesn’t seem to be feasible, I think because env variable substitution can only produce a Literal and not a PropertyName). I was thinking of something like this:

STATE_ lang EN

Idea (and warning probably not a good one) regarding the UI for i18n. What about if we had a single page, or maybe even a separate app that was devoted to doing i18n of all configuration strings. It could be designed to make it easy to batch updates, etc… .perhaps we can even utilize existing apps that already do this for code.

Then in the existing ui we wouldn’t add much expect for some global dropdown that selects the language. And perhaps if we wanted to provide a nicer integration for those text fields that correspond to i18nized fields we could add a little link titled “translate” that would forward to the i18n page with that field selected.

Just a random thought.

···

On Fri, Feb 22, 2013 at 2:36 AM, Andrea Aime <andrea.aime@anonymised.com> wrote:

On Fri, Feb 22, 2013 at 10:32 AM, Mauro Bartolomeoli <mauro.bartolomeoli@anonymised.com> wrote:

We do have the “property” function that can be used for the purpose, and that would work for GetMap.
For GetFeatureInfo in HTML format we could roll out FTL templates and inject the language in the HTML
template.

However, for any other GetFeatureInfo output format (text, gml, json) we’re toast, there is no templating,
and for GetFeature it’s the same.
Now that I think about it, we might also have problems with GetLegendGraphics, the titles are coming from
the rule titles right? But afaik there is no way to specify multiple titles in different languages in an SLD.

Cheers
Andrea

==
Our support, Your Success! Visit http://opensdi.geo-solutions.it for more information.

Ing. Andrea Aime
@geowolf
Technical Lead

GeoSolutions S.A.S.
Via Poggio alle Viti 1187
55054 Massarosa (LU)
Italy
phone: +39 0584 962313
fax: +39 0584 1660272

mob: +39 339 8844549

http://www.geo-solutions.it
http://twitter.com/geosolutions_it



Everyone hates slow websites. So do we.
Make your web apps faster with AppDynamics
Download AppDynamics Lite for free today:
http://p.sf.net/sfu/appdyn_d2d_feb


Geoserver-devel mailing list
Geoserver-devel@anonymised.comsts.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-devel


Justin Deoliveira
OpenGeo - http://opengeo.org
Enterprise support for open source geospatial.

Hi Andrea. For this 2 specific cases, I was thinking of a simple approach that could be implemented as a first step to add some form of internationalization.
For GetFeatureInfo, it would be useful to have different templates (with a prefix or suffix in the name) depending on a request parameter.
For GetMap the env variable substitution in SLD could be used to build a different PropertyName for labeling (currently this doesn’t seem to be feasible, I think because env variable substitution can only produce a Literal and not a PropertyName). I was thinking of something like this:

STATE_ lang EN