MCPcopy Create free account
hub / github.com/Card-Forge/forge / localize

Method localize

forge-gui-mobile/src/forge/adventure/util/UIActor.java:198–207  ·  view source on GitHub ↗
(String str)

Source from the content-addressed store, hash-verified

196 }
197
198 public static String localize(String str) {
199 Pattern regex = Pattern.compile("tr\\([^\\)]*\\)");
200 for (int i = 0; i < 100; i++) {
201 Matcher matcher = regex.matcher(str);
202 if (!matcher.find())
203 return str;
204 str = matcher.replaceFirst(Forge.getLocalizer().getMessage(matcher.group().substring(3, matcher.group().length() - 1)));
205 }
206 return str;
207 }
208
209 private void readImageButtonProperties(ImageButton newActor, ObjectMap.Entries<String, String> entries) {
210 for (ObjectMap.Entry property : entries) {

Callers 5

NewGameSceneMethod · 0.95
readLabelPropertiesMethod · 0.95
readButtonPropertiesMethod · 0.95

Calls 4

getLocalizerMethod · 0.95
lengthMethod · 0.80
findMethod · 0.65
getMessageMethod · 0.45

Tested by

no test coverage detected