Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -89,12 +89,6 @@ public final class LocalizationPlugin {
private static final String STEP_REGEX = "\\[\"zoom\"], ";
private static final String STEP_TEMPLATE = "[\"zoom\"], \"\", ";

// legacy token syntax
private static final String TOKEN_TEMPLATE = "{%s}";
private static final String TOKEN_REGEX = "[{]((name).*?)[}]";
private static final String TOKEN_NAME = "{name";
private static final String TOKEN_ABBR = "{abbr}";

// configuration
private final MapboxMap mapboxMap;
private MapLocale mapLocale;
Expand Down Expand Up @@ -229,8 +223,6 @@ public void setMapLanguage(@NonNull MapLocale mapLocale) {
} else {
convertExpression(mapLocale, layer, textFieldProperty);
}
} else {
convertToken(mapLocale, layer, textFieldProperty);
}
}
}
Expand All @@ -248,15 +240,6 @@ public void setMapLanguage(@NonNull MapLocale mapLocale) {
}
}

private void convertToken(@NonNull MapLocale mapLocale, Layer layer, PropertyValue<?> textFieldProperty) {
String text = (String) textFieldProperty.getValue();
if (text != null && (text.contains(TOKEN_NAME) || text.contains(TOKEN_ABBR))) {
layer.setProperties(textField(text.replaceAll(
TOKEN_REGEX, String.format(TOKEN_TEMPLATE, mapLocale.getMapLanguage())
)));
}
}

private void convertExpression(@NonNull MapLocale mapLocale, Layer layer, PropertyValue<?> textFieldProperty) {
Expression textFieldExpression = textFieldProperty.getExpression();
if (textFieldExpression != null) {
Expand Down