GetLegendGraphic i18n after 2.22.2

Hi,

We are having issues with using LANGUAGE parameter after geoserver upgrade from 2.22.2.

Example query:

http://localhost/geoserver/wms?LAYER=test%3Aice_object&VERSION=1.3.0&SERVICE=WMS&REQUEST=getLegendGraphic&FORMAT=image/png&LANGUAGE=eng

Example style:

<Title>This is the default title
  <Localized lang="en">English title</Localized>
  <Localized lang="it">Titolo in italiano</Localized>
</Title>

In 2.22.2 We are seeing <Localized lang="en> node value

After verison update to 2.25 We are seeing Title node value

Has anyone else encountered this issue or is there a way to bypass it?

Hi,

I see that your example contains .../png&LANGUAGE=eng, but I guess that it is a typo in your message and not in the real request. Can you confirm?

Hi Jukka,
the LANGUAGE parameter, from memory, comes from the INSPIRE specification,
not from the OGC ones,
and does not use ISO language codes, but some three letter abbreviations
instead, e.g., german is ger
and english is eng.

Suggestions for the original reporter:

Regards,

Andrea Aime

==
GeoServer Professional Services from the experts!

Visit GeoSolutions Enterprise Support Services for more information.

Ing. Andrea Aime
@geowolf
Technical Lead

GeoSolutions Group
phone: +39 0584 962313

fax: +39 0584 1660272

mob: +39 339 8844549

http://twitter.com/geosolutions_it


Con riferimento alla normativa sul trattamento dei dati personali (Reg. UE
2016/679 - Regolamento generale sulla protezione dei dati “GDPR”), si
precisa che ogni circostanza inerente alla presente email (il suo
contenuto, gli eventuali allegati, etc.) è un dato la cui conoscenza è
riservata al/i solo/i destinatario/i indicati dallo scrivente. Se il
messaggio Le è giunto per errore, è tenuta/o a cancellarlo, ogni altra
operazione è illecita. Le sarei comunque grato se potesse darmene notizia.

This email is intended only for the person or entity to which it is
addressed and may contain information that is privileged, confidential or
otherwise protected from disclosure. We remind that - as provided by
European Regulation 2016/679 “GDPR” - copying, dissemination or use of this
e-mail or the information herein by anyone other than the intended
recipient is prohibited. If you have received this email by mistake, please
notify us immediately by telephone or e-mail

On Sun, Sep 15, 2024 at 9:05 PM Jukka Rahkonen via OSGeo Discourse <
noreply@discourse.osgeo.org> wrote:

jratike80 https://discourse.osgeo.org/u/jratike80
September 15

Hi,

I see that your example contains …/png&LANGUAGE=eng, but I guess that
it is a typo in your message and not in the real request. Can you confirm?

Visit Topic
https://discourse.osgeo.org/t/getlegendgraphic-i18n-after-2-22-2/50926/2
or reply to this email to respond.

To unsubscribe from these emails, click here
https://discourse.osgeo.org/email/unsubscribe/93a67c4dc692da410b0576b7f57f7c2034833f81cda39af108315e906df1a7cb
.

the LANGUAGE parameter, from memory, comes from the INSPIRE specification,
not from the OGC ones,
and does not use ISO language codes, but some three letter abbreviations
instead, e.g., german is ger
and english is eng.

I was reading i18N in SLD — GeoServer 2.25.x User Manual

<Title>This is the default title
  <Localized lang="en">English title</Localized>
  <Localized lang="it">Titolo in italiano</Localized>
</Title>

and the text says later:

Each Localized section specifies the language (using a two letter abbreviation in the lang attribute) and the related text.

Currently, GeoServer supports localized text in SLD in WMS GetLegendGraphic requests (legends that contain labels are rendered using the requested language, if a LANGUAGE parameter is added to the request, e.g. LANGUAGE=it).

Do you really mean the what is en in the SLD should be requested as eng?

Hi all,
Possibly linked to this [GEOS-11249] - JIRA?
For us it works now with 2.25. My understanding is that the language parameter should be language=eng if you have the INSPIRE extension. If not, it should be en.
So with this in the SLD:

            <Title>
            Default label<Localized lang="en">English</Localized>
              <Localized lang="de">Deutsch</Localized>
              <Localized lang="fr">Français</Localized>
              <Localized lang="it">Italiano</Localized>
            </Title>

And language=en (without INSPIRE) or language=eng (with INSPIRE) in the request, it should work in 2.25

Hi,
just a note as the situation is a bit messy. Language support in GeoServer
has been
added to support INSPIRE, with a secondary goal of making it generally
available even without the INSPIRE plugin.

The LANGUAGE parameter is an INSPIRE specific parameter, it’s not part of
the OGC specifications.
If you look at specification like WMS 1.3 or SLD (that’s where
GetLegendGraphic comes from) there is
no mention of language support whatsoever.

Those specs are old enough that they are not really referencing any “Web
Services Common” base,
but even taking the latest WSC specification, 2.0 (dated back 2010) there
is only mention of a
“acceptlanguages” parameter, designed specifically for the GetCapabilities
(reminder, of all OGC protocols,
only WCS 2.0 is based on WSC 2.0).

In the regulatory void, I have the impression the current implementation
looks up “LANGUAGES” in GetMap/GetLegendGraphics,
and ACCEPTLANGUAGES only in GetCapabilities, and tries to use them as ISO
codes.
The INSPIRE plugin adds a translation layer, looks into LANGUAGES for 3
letter codes and
retrofits them into ISO codes
https://github.com/geoserver/geoserver/blob/62453b2267ea4f9a05775a54da128d93be1626ae/src/extension/inspire/src/main/java/org/geoserver/inspire/LanguagesDispatcherCallback.java#L13
before
the request parsers can look at them.

More work is likely needed to get a consistent behavior outside of the
INSPIRE scenario, for those
interested in getting it done, see the usual guide:

Regards,

Andrea Aime

==
GeoServer Professional Services from the experts!

Visit GeoSolutions Enterprise Support Services for more information.

Ing. Andrea Aime
@geowolf
Technical Lead

GeoSolutions Group
phone: +39 0584 962313

fax: +39 0584 1660272

mob: +39 339 8844549

http://twitter.com/geosolutions_it


Con riferimento alla normativa sul trattamento dei dati personali (Reg. UE
2016/679 - Regolamento generale sulla protezione dei dati “GDPR”), si
precisa che ogni circostanza inerente alla presente email (il suo
contenuto, gli eventuali allegati, etc.) è un dato la cui conoscenza è
riservata al/i solo/i destinatario/i indicati dallo scrivente. Se il
messaggio Le è giunto per errore, è tenuta/o a cancellarlo, ogni altra
operazione è illecita. Le sarei comunque grato se potesse darmene notizia.

This email is intended only for the person or entity to which it is
addressed and may contain information that is privileged, confidential or
otherwise protected from disclosure. We remind that - as provided by
European Regulation 2016/679 “GDPR” - copying, dissemination or use of this
e-mail or the information herein by anyone other than the intended
recipient is prohibited. If you have received this email by mistake, please
notify us immediately by telephone or e-mail

On Wed, Sep 18, 2024 at 4:31 PM Cécile Vuilleumier via OSGeo Discourse <
noreply@discourse.osgeo.org> wrote:

vuilleumierc https://discourse.osgeo.org/u/vuilleumierc
September 18

Hi all,
Possibly linked to this [GEOS-11249] - JIRA
https://osgeo-org.atlassian.net/browse/GEOS-11249?
For us it works now with 2.25. My understanding is that the language
parameter should be language=eng if you have the INSPIRE extension. If
not, it should be en.
So with this in the SLD:

        <Title>
        Default label<Localized lang="en">English</Localized>
          <Localized lang="de">Deutsch</Localized>
          <Localized lang="fr">Français</Localized>
          <Localized lang="it">Italiano</Localized>
        </Title>

And language=en (without INSPIRE) or language=eng (with INSPIRE) in the
request, it should work in 2.25

Visit Topic
https://discourse.osgeo.org/t/getlegendgraphic-i18n-after-2-22-2/50926/5
or reply to this email to respond.

To unsubscribe from these emails, click here
https://discourse.osgeo.org/email/unsubscribe/7e2109b419f2dad4d8ade95de3e61e3d0111072f6fee000b4e35e96be6de0e5f
.