-
-
Notifications
You must be signed in to change notification settings - Fork 116
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
Filter name tags #1115
Filter name tags #1115
Conversation
Quality Gate failedFailed conditions See analysis details on SonarQube Cloud Catch issues before they fail your Quality Gate with our IDE extension SonarQube for IDE |
Full logs: https://github.com/onthegomap/planetiler/actions/runs/12021905765 |
@@ -10,7 +10,7 @@ public class LanguageUtils { | |||
// See https://wiki.openstreetmap.org/wiki/Multilingual_names | |||
public static final Predicate<String> VALID_NAME_TAGS = | |||
Pattern | |||
.compile("^name:[a-z]{2,3}(-[a-z]{4})?([-_](x-)?[a-z]{2,})?(-([a-z]{2}|[0-9]{3}))?$", Pattern.CASE_INSENSITIVE) | |||
.compile("^name:[a-z]{2,3}(-[a-z]{4})?([-_](x-)?[a-z]{2,})?(-([a-z]{2}|\\d{3}))?$", Pattern.CASE_INSENSITIVE) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I just realized this pattern is case-insensitive. This means it’ll pull in both name:tec=*
and name:TEC=*
– the latter is not a localized name. The usual case conventions for IETF language tags apply (language codes as xyz
, script codes as Wxyz
, country codes as XY
). Some miscased keys have been common in the past, but as far as I know, they’re now deprecated (see also osmus/tileservice#21).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@@ -10,7 +10,7 @@ public class LanguageUtils { | |||
// See https://wiki.openstreetmap.org/wiki/Multilingual_names | |||
public static final Predicate<String> VALID_NAME_TAGS = | |||
Pattern | |||
.compile("^name:[a-z]{2,3}(-[a-z]{4})?([-_](x-)?[a-z]{2,})?(-([a-z]{2}|[0-9]{3}))?$", Pattern.CASE_INSENSITIVE) | |||
.compile("^name:[a-z]{2,3}(-[a-z]{4})?([-_](x-)?[a-z]{2,})?(-([a-z]{2}|\\d{3}))?$", Pattern.CASE_INSENSITIVE) |
This comment was marked as resolved.
This comment was marked as resolved.
Sorry, something went wrong.
Fix #1114 by filtering name tags that don't correspond to different languages.