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

OsmTranslationProvider should validate name subkeys #1114

Closed
1ec5 opened this issue Nov 25, 2024 · 1 comment · Fixed by #1115
Closed

OsmTranslationProvider should validate name subkeys #1114

1ec5 opened this issue Nov 25, 2024 · 1 comment · Fixed by #1115

Comments

@1ec5
Copy link

1ec5 commented Nov 25, 2024

OsmTranslationProvider considers any key that begins with name: to be a name key. However, the OSM tagging convention is stricter: only valid IETF language tags (BCP 47) are considered to be translation subkeys. This includes subkeys such as name:en, name:sr-Latn, and name:zh-Hant-TW but excludes name:left, name:etymology:wikidata, name:en:pronunciation, and name:TEC (part of a distinct tagging scheme for station names that vary by transit operator).

if (key.startsWith("name:") && entry.getValue() instanceof String stringVal) {

#147 implemented a VALID_NAME_TAGS regular expression that should filter the name subkeys correctly.

@1ec5
Copy link
Author

1ec5 commented Nov 25, 2024

I assume the * wildcard in #1111 would be more usable once this filter is in place.

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

Successfully merging a pull request may close this issue.

1 participant