Skip to content

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Challenges with internationalization of text-field #3102

Closed
markconnellypro opened this issue Sep 19, 2023 · 2 comments
Closed

Challenges with internationalization of text-field #3102

markconnellypro opened this issue Sep 19, 2023 · 2 comments

Comments

@markconnellypro
Copy link

I'm not sure if this should go here or under maplibre-style-spec, but I am having some difficulty with getting labels to appear when switching to non-English languages using the text-field value. Part of the issue is that the delimiter between name and the language code is not consistent -- for example, even in the examples, it is sometimes a colon and sometimes an underscore (and in the data I am using, it is similarly unpredictable):

https://maplibre.org/maplibre-gl-js/docs/examples/display-and-style-rich-text-labels/
https://maplibre.org/maplibre-gl-js/docs/examples/language-switch/

Is there any way to establish a failover order to ensure a label is always present on the map (either as part of the style or transparently through MapLibre GL JS)? For example, if the text-field in the style is name:fr, it first tries that exact value, then name_fr, then name.

Thank you.

@HarelM
Copy link
Collaborator

HarelM commented Sep 19, 2023

you can use for example:

"text-field": [
          "coalesce",
          ["get", "name:he"],
          ["get", "name_en"],
          ["get", "name"]
        ],

I'm not sure there's an issue here.
Can I transfer this into a discussion?

@markconnellypro
Copy link
Author

Yes, please feel free to transfer to a discussion. Thank you!

@maplibre maplibre locked and limited conversation to collaborators Sep 19, 2023
@HarelM HarelM converted this issue into discussion #3104 Sep 19, 2023

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants