preparing actions on routes

This commit is contained in:
Stephan Richter
2020-10-27 23:51:17 +01:00
parent 57f9bb17f1
commit 1d8a5d65b9
6 changed files with 55 additions and 30 deletions

View File

@@ -5,6 +5,8 @@ import java.lang.reflect.InvocationTargetException;
import org.json.JSONObject;
import de.keawe.tools.translations.Translation;
import de.srsoftware.web4rail.Application;
import de.srsoftware.web4rail.Plan;
public abstract class Action {
@@ -37,4 +39,8 @@ public abstract class Action {
}
return null;
}
protected String t(String tex,Object...fills) {
return Translation.get(Application.class, tex, fills);
}
}

View File

@@ -27,4 +27,9 @@ public class SpeedReduction extends RouteAction {
json.put(MAX_SPEED, maxSpeed);
return json;
}
@Override
public String toString() {
return t("Reduce speed to {} km/h",maxSpeed);
}
}