Skip to content
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

Underscore/colon as language field separator #72

Open
SvanteRichter opened this issue Dec 23, 2024 · 2 comments
Open

Underscore/colon as language field separator #72

SvanteRichter opened this issue Dec 23, 2024 · 2 comments

Comments

@SvanteRichter
Copy link

SvanteRichter commented Dec 23, 2024

Hello!

Could I ask the reason to use underscore in the language fields (name_en and name_de)? Seems like protomaps are using colon, and openmaptiles have moved to colon but are keeping name_en, name_de and name_int (probably for compatability? openmaptiles/openmaptiles#279).

When adding more languages (like for #68) is the plan to align with protomaps & openmaptiles and use colon or will underscore be used for those?

I'm asking since examples like maplibre (https://maplibre.org/maplibre-gl-js/docs/examples/language-switch/) and plugins (https://github.com/teritorio/openmaptiles-gl-language) seem to default to using colon as the separator.

It also seems like some docs here use colon: https://github.com/shortbread-tiles/shortbread-docs/blob/main/shortbread-website/static/taginfo.json#L18 and some issues use it too (#22) so I think having a clear, documented separator might be nice.

Thanks!

@joto
Copy link
Contributor

joto commented Dec 23, 2024

For maximum compatibility with lots of software it is better not to use "strange characters" like colons. Even if it seems to work, sooner or later you'll run into problems somewhere. In this case for instance it would mean we have to escape those names in the PostgreSQL database properly if you are using a tool chain that uses the database. Not a huge problem, but annoying enough. Or you process the data in some programming language and then you can't use that name as the name of a variable. Life is just easier if you don't use these kinds of characters.

@SvanteRichter
Copy link
Author

SvanteRichter commented Dec 23, 2024

If there was no prior art I might agree with you, but the other two major opensource tile-schemas use colon, OSM uses it for the same attributes, and shortbread already uses colon for other attributes (tower:type, recycling:glass_bottles, recycling:paper, recycling:clothes and recycling:scrap_metal). I'd lean more towards going with colon.

Seems like OSM uses underscores in place of spaces and colon to reference subkeys like short_name:de or railway:track_ref and also seems like underscores are used as a space replacement in shortbread in other places like state_capital or isolated_dwelling, so using underscore as a localization separator might not be the best. It seems like in almost all cases underscore is used as a space replacement and colon is used for subkeys, except for the two language fields currently in the spec.

Either way I think having some clarification would be good.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants