Skip to content

Commit

Permalink
more translatable strings in single parameter warnings #11859
Browse files Browse the repository at this point in the history
  • Loading branch information
behrisch committed Jan 24, 2023
1 parent e1bef2e commit fda886f
Show file tree
Hide file tree
Showing 81 changed files with 180 additions and 180 deletions.
2 changes: 1 addition & 1 deletion src/activitygen/activitygen_main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ loadNet(RONet& toFill, ROAbstractEdgeBuilder& eb) {
PROGRESS_DONE_MESSAGE();
}
if (!deprecatedVehicleClassesSeen.empty()) {
WRITE_WARNING("Deprecated vehicle classes '" + toString(deprecatedVehicleClassesSeen) + "' in input network.");
WRITE_WARNINGF(TL("Deprecated vehicle classes '%' in input network."), toString(deprecatedVehicleClassesSeen));
deprecatedVehicleClassesSeen.clear();
}
}
Expand Down
10 changes: 5 additions & 5 deletions src/dfrouter/RODFNet.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,7 @@ RODFNet::computeRoutesFor(ROEdge* edge, RODFRouteDesc& base, int /*no*/,
// without a detector occurred
if (current.passedNo > maxFollowingLength) {
// mark not to process any further
WRITE_WARNING("Could not close route for '" + det.getID() + "'");
WRITE_WARNINGF(TL("Could not close route for '%'"), det.getID());
unfoundEnds.push_back(current);
current.factor = 1.;
double cdist = current.edges2Pass[0]->getFromJunction()->getPosition().distanceTo(current.edges2Pass.back()->getToJunction()->getPosition());
Expand Down Expand Up @@ -436,7 +436,7 @@ RODFNet::revalidateFlows(const RODFDetector* detector,
}
// ok, there is no information for the whole time;
// lets find preceding detectors and rebuild the flows if possible
WRITE_WARNING("Detector '" + detector->getID() + "' has no flows.\n Trying to rebuild.");
WRITE_WARNINGF(TL("Detector '%' has no flows.\n Trying to rebuild."), detector->getID());
// go back and collect flows
ROEdgeVector previous;
{
Expand Down Expand Up @@ -698,7 +698,7 @@ RODFNet::isSource(const RODFDetector& det, ROEdge* edge,
const RODFDetectorCon& detectors,
bool strict) const {
if (seen.size() == 1000) { // !!!
WRITE_WARNING("Quitting checking for being a source for detector '" + det.getID() + "' due to seen edge limit.");
WRITE_WARNINGF(TL("Quitting checking for being a source for detector '%' due to seen edge limit."), det.getID());
return false;
}
if (edge == getDetectorEdge(det)) {
Expand Down Expand Up @@ -798,7 +798,7 @@ bool
RODFNet::isDestination(const RODFDetector& det, ROEdge* edge, ROEdgeVector& seen,
const RODFDetectorCon& detectors) const {
if (seen.size() == 1000) { // !!!
WRITE_WARNING("Quitting checking for being a destination for detector '" + det.getID() + "' due to seen edge limit.");
WRITE_WARNINGF(TL("Quitting checking for being a destination for detector '%' due to seen edge limit."), det.getID());
return false;
}
if (edge == getDetectorEdge(det)) {
Expand Down Expand Up @@ -874,7 +874,7 @@ bool
RODFNet::isFalseSource(const RODFDetector& det, ROEdge* edge, ROEdgeVector& seen,
const RODFDetectorCon& detectors) const {
if (seen.size() == 1000) { // !!!
WRITE_WARNING("Quitting checking for being a false source for detector '" + det.getID() + "' due to seen edge limit.");
WRITE_WARNINGF(TL("Quitting checking for being a false source for detector '%' due to seen edge limit."), det.getID());
return false;
}
seen.push_back(edge);
Expand Down
2 changes: 1 addition & 1 deletion src/duarouter/duarouter_main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ computeRoutes(RONet& net, ROLoader& loader, OptionsCont& oc) {
op = &ROEdge::getStoredEffort;
}
if (measure != "traveltime" && !net.hasLoadedEffort()) {
WRITE_WARNING("No weight data was loaded for attribute '" + measure + "'.");
WRITE_WARNINGF(TL("No weight data was loaded for attribute '%'."), measure);
}
router = new DijkstraRouter<ROEdge, ROVehicle>(
ROEdge::getAllEdges(), oc.getBool("ignore-errors"), op, ttFunction, false, nullptr, net.hasPermissions(), oc.isSet("restriction-params"));
Expand Down
4 changes: 2 additions & 2 deletions src/guisim/Command_Hotkey_InductionLoop.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -52,11 +52,11 @@ Command_Hotkey_InductionLoop::registerHotkey(const std::string& key, MSInductLoo
// see FXAccelTable::parseAccel
hotkey = c + FX::KEY_space - ' ';
} else {
WRITE_WARNING("Hotkey '" + key + "' is not supported");
WRITE_WARNINGF(TL("Hotkey '%' is not supported"), key);
return false;
}
} else {
WRITE_WARNING("Hotkey '" + key + "' is not supported");
WRITE_WARNINGF(TL("Hotkey '%' is not supported"), key);
return false;
}
GUINet* gn = dynamic_cast<GUINet*>(MSNet::getInstance());
Expand Down
4 changes: 2 additions & 2 deletions src/guisim/Command_Hotkey_TrafficLight.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -53,11 +53,11 @@ Command_Hotkey_TrafficLight::registerHotkey(const std::string& key, MSTrafficLig
// see FXAccelTable::parseAccel
hotkey = c + FX::KEY_space - ' ';
} else {
WRITE_WARNING("Hotkey '" + key + "' is not supported");
WRITE_WARNINGF(TL("Hotkey '%' is not supported"), key);
return false;
}
} else {
WRITE_WARNING("Hotkey '" + key + "' is not supported");
WRITE_WARNINGF(TL("Hotkey '%' is not supported"), key);
return false;
}
GUINet* gn = dynamic_cast<GUINet*>(MSNet::getInstance());
Expand Down
4 changes: 2 additions & 2 deletions src/libsumo/Helper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1392,7 +1392,7 @@ Helper::postProcessRemoteControl() {
controlled.second->getInfluencer().postProcessRemoteControl(controlled.second);
numControlled++;
} else {
WRITE_WARNING("Vehicle '" + controlled.first + "' was removed though being controlled by TraCI");
WRITE_WARNINGF(TL("Vehicle '%' was removed though being controlled by TraCI"), controlled.first);
}
}
myRemoteControlledVehicles.clear();
Expand All @@ -1401,7 +1401,7 @@ Helper::postProcessRemoteControl() {
controlled.second->getInfluencer().postProcessRemoteControl(controlled.second);
numControlled++;
} else {
WRITE_WARNING("Person '" + controlled.first + "' was removed though being controlled by TraCI");
WRITE_WARNINGF(TL("Person '%' was removed though being controlled by TraCI"), controlled.first);
}
}
myRemoteControlledPersons.clear();
Expand Down
2 changes: 1 addition & 1 deletion src/libsumo/TrafficLight.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -644,7 +644,7 @@ TrafficLight::findConstraintsDeadLocks(const std::string& foeId, const std::stri
}
}
} else if (ego != nullptr) {
WRITE_WARNING("Cannot check for all deadlocks on swapConstraints because the route for vehicle '" + ego->getID() + "' is not computed yet");
WRITE_WARNINGF(TL("Cannot check for all deadlocks on swapConstraints because the route for vehicle '%' is not computed yet"), ego->getID());
}
}

Expand Down
4 changes: 2 additions & 2 deletions src/libsumo/Vehicle.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1312,7 +1312,7 @@ Vehicle::changeLaneRelative(const std::string& vehID, int indexOffset, double du
int laneIndex = veh->getLaneIndex() + indexOffset;
if (laneIndex < 0 && !veh->getLaneChangeModel().isOpposite()) {
if (veh->getLaneIndex() == -1) {
WRITE_WARNING("Ignoring changeLaneRelative for vehicle '" + vehID + "' that isn't on the road");
WRITE_WARNINGF(TL("Ignoring changeLaneRelative for vehicle '%' that isn't on the road"), vehID);
} else {
WRITE_WARNING("Ignoring indexOffset " + toString(indexOffset) + " for vehicle '" + vehID + "' on laneIndex " + toString(veh->getLaneIndex()));
}
Expand Down Expand Up @@ -1406,7 +1406,7 @@ Vehicle::add(const std::string& vehID,
}
if (vehicleParams.departProcedure == DepartDefinition::GIVEN && vehicleParams.depart < MSNet::getInstance()->getCurrentTimeStep()) {
vehicleParams.depart = MSNet::getInstance()->getCurrentTimeStep();
WRITE_WARNING("Departure time for vehicle '" + vehID + "' is in the past; using current time instead.");
WRITE_WARNINGF(TL("Departure time for vehicle '%' is in the past; using current time instead."), vehID);
} else if (vehicleParams.departProcedure == DepartDefinition::NOW) {
vehicleParams.depart = MSNet::getInstance()->getCurrentTimeStep();
}
Expand Down
2 changes: 1 addition & 1 deletion src/marouter/ROMARouteHandler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ void
ROMARouteHandler::myEndElement(int element) {
if (element == SUMO_TAG_TRIP || element == SUMO_TAG_VEHICLE) {
if (myVehicleParameter->fromTaz == "" || myVehicleParameter->toTaz == "") {
WRITE_WARNING("No origin or no destination given, ignoring '" + myVehicleParameter->id + "'!");
WRITE_WARNINGF(TL("No origin or no destination given, ignoring '%'!"), myVehicleParameter->id);
} else {
int quota = getScalingQuota(myScale, myNumLoaded);
for (int i = 0; i < quota; i++) {
Expand Down
2 changes: 1 addition & 1 deletion src/marouter/marouter_main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ computeRoutes(RONet& net, OptionsCont& oc, ODMatrix& matrix) {
op = &ROEdge::getStoredEffort;
}
if (measure != "traveltime" && !net.hasLoadedEffort()) {
WRITE_WARNING("No weight data was loaded for attribute '" + measure + "'.");
WRITE_WARNINGF(TL("No weight data was loaded for attribute '%'."), measure);
}
router = new DijkstraRouter<ROEdge, ROVehicle>(ROEdge::getAllEdges(), oc.getBool("ignore-errors"), op, ttOp, false, nullptr, net.hasPermissions());
}
Expand Down
2 changes: 1 addition & 1 deletion src/mesosim/METriggeredCalibrator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ METriggeredCalibrator::execute(SUMOTime currentTime) {
route = MSRoute::dictionary(pars->routeid);
}
if (route == nullptr) {
WRITE_WARNING("No valid routes in calibrator '" + getID() + "'.");
WRITE_WARNINGF(TL("No valid routes in calibrator '%'."), getID());
break;
}
if (!route->contains(myEdge)) {
Expand Down
4 changes: 2 additions & 2 deletions src/microsim/MSBaseVehicle.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -810,7 +810,7 @@ MSBaseVehicle::calculateArrivalParams(bool onInit) {
switch (myParameter->arrivalPosProcedure) {
case ArrivalPosDefinition::GIVEN:
if (fabs(myParameter->arrivalPos) > lastLaneLength) {
WRITE_WARNING("Vehicle '" + getID() + "' will not be able to arrive at the given position!");
WRITE_WARNINGF(TL("Vehicle '%' will not be able to arrive at the given position!"), getID());
}
// Maybe we should warn the user about invalid inputs!
myArrivalPos = MIN2(myParameter->arrivalPos, lastLaneLength);
Expand Down Expand Up @@ -866,7 +866,7 @@ MSBaseVehicle::calculateArrivalParams(bool onInit) {
return;
}
}
WRITE_WARNING("Vehicle '" + getID() + "' will not be able to arrive with the given speed!");
WRITE_WARNINGF(TL("Vehicle '%' will not be able to arrive with the given speed!"), getID());
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/microsim/MSNet.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1421,7 +1421,7 @@ MSNet::getRouterTT(const int rngIndex, const MSEdgeVector& prohibited) const {
myRouterTT[rngIndex] = new DijkstraRouter<MSEdge, SUMOVehicle>(MSEdge::getAllEdges(), true, &MSNet::getTravelTime, nullptr, false, nullptr, true);
} else {
if (routingAlgorithm != "astar") {
WRITE_WARNING("TraCI and Triggers cannot use routing algorithm '" + routingAlgorithm + "'. using 'astar' instead.");
WRITE_WARNINGF(TL("TraCI and Triggers cannot use routing algorithm '%'. using 'astar' instead."), routingAlgorithm);
}
myRouterTT[rngIndex] = new AStarRouter<MSEdge, SUMOVehicle>(MSEdge::getAllEdges(), true, &MSNet::getTravelTime, nullptr, true);
}
Expand Down
4 changes: 2 additions & 2 deletions src/microsim/MSRouteHandler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,7 @@ MSRouteHandler::openRoute(const SUMOSAXAttributes& attrs) {
// we may use this vehicle's id as default
myActiveRouteID = "!" + myVehicleParameter->id; // !!! document this
if (attrs.hasAttribute(SUMO_ATTR_ID)) {
WRITE_WARNING("Ids of internal routes are ignored (vehicle '" + myVehicleParameter->id + "').");
WRITE_WARNINGF(TL("Ids of internal routes are ignored (vehicle '%')."), myVehicleParameter->id);
}
} else {
bool ok = true;
Expand Down Expand Up @@ -556,7 +556,7 @@ MSRouteHandler::closeVehicle() {
if (myVehicleParameter->wasSet(VEHPARS_ROUTE_SET)) {
// if the route id was given, prefer that one
if (route != nullptr && !myAmLoadingState) {
WRITE_WARNING("Ignoring child element 'route' for vehicle '" + myVehicleParameter->id + "' because attribute 'route' is set.");
WRITE_WARNINGF(TL("Ignoring child element 'route' for vehicle '%' because attribute 'route' is set."), myVehicleParameter->id);
}
route = MSRoute::dictionary(myVehicleParameter->routeid, &myParsingRNG);
}
Expand Down
2 changes: 1 addition & 1 deletion src/microsim/MSVehicle.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5284,7 +5284,7 @@ MSVehicle::leaveLane(const MSMoveReminder::Notification reason, const MSLane* ap
if (reason != MSMoveReminder::NOTIFICATION_PARKING && resumeFromStopping()) {
myStopDist = std::numeric_limits<double>::max();
if (myPastStops.back().speed <= 0) {
WRITE_WARNING("Vehicle '" + getID() + "' aborts stop.");
WRITE_WARNINGF(TL("Vehicle '%' aborts stop."), getID());
}
}
if (reason != MSMoveReminder::NOTIFICATION_PARKING && reason != MSMoveReminder::NOTIFICATION_LANE_CHANGE) {
Expand Down
2 changes: 1 addition & 1 deletion src/microsim/devices/MSDevice.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ MSDevice::insertDefaultAssignmentOptions(const std::string& deviceName, const st

void
MSDevice::saveState(OutputDevice& /* out */) const {
WRITE_WARNING("Device '" + getID() + "' cannot save state");
WRITE_WARNINGF(TL("Device '%' cannot save state"), getID());
}


Expand Down
4 changes: 2 additions & 2 deletions src/microsim/devices/MSDevice_BTreceiver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -418,7 +418,7 @@ MSDevice_BTreceiver::notifyEnter(SUMOTrafficObject& veh, MSMoveReminder::Notific
bool
MSDevice_BTreceiver::notifyMove(SUMOTrafficObject& veh, double /* oldPos */, double newPos, double newSpeed) {
if (sVehicles.find(veh.getID()) == sVehicles.end()) {
WRITE_WARNING("btreceiver: Can not update position of vehicle '" + veh.getID() + "' which is not on the road.");
WRITE_WARNINGF(TL("btreceiver: Can not update position of vehicle '%' which is not on the road."), veh.getID());
return true;
}
const std::string location = MSDevice_BTsender::getLocation(veh);
Expand All @@ -433,7 +433,7 @@ MSDevice_BTreceiver::notifyLeave(SUMOTrafficObject& veh, double /* lastPos */, M
return true;
}
if (sVehicles.find(veh.getID()) == sVehicles.end()) {
WRITE_WARNING("btreceiver: Can not update position of vehicle '" + veh.getID() + "' which is not on the road.");
WRITE_WARNINGF(TL("btreceiver: Can not update position of vehicle '%' which is not on the road."), veh.getID());
return true;
}
const std::string location = MSDevice_BTsender::getLocation(veh);
Expand Down
4 changes: 2 additions & 2 deletions src/microsim/devices/MSDevice_BTsender.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ MSDevice_BTsender::notifyEnter(SUMOTrafficObject& veh, MSMoveReminder::Notificat
bool
MSDevice_BTsender::notifyMove(SUMOTrafficObject& veh, double /* oldPos */, double newPos, double newSpeed) {
if (sVehicles.find(veh.getID()) == sVehicles.end()) {
WRITE_WARNING("btsender: Can not update position of vehicle '" + veh.getID() + "' which is not on the road.");
WRITE_WARNINGF(TL("btsender: Can not update position of vehicle '%' which is not on the road."), veh.getID());
return true;
}
sVehicles[veh.getID()]->updates.push_back(VehicleState(newSpeed, veh.getPosition(), getLocation(veh), newPos, veh.getRoutePosition()));
Expand All @@ -131,7 +131,7 @@ MSDevice_BTsender::notifyLeave(SUMOTrafficObject& veh, double /* lastPos */, MSM
return true;
}
if (sVehicles.find(veh.getID()) == sVehicles.end()) {
WRITE_WARNING("btsender: Can not update position of vehicle '" + veh.getID() + "' which is not on the road.");
WRITE_WARNINGF(TL("btsender: Can not update position of vehicle '%' which is not on the road."), veh.getID());
return true;
}
sVehicles[veh.getID()]->updates.push_back(VehicleState(veh.getSpeed(), veh.getPosition(), getLocation(veh), veh.getPositionOnLane(), veh.getRoutePosition()));
Expand Down
4 changes: 2 additions & 2 deletions src/microsim/devices/MSDevice_ElecHybrid.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -371,7 +371,7 @@ MSDevice_ElecHybrid::notifyMove(SUMOTrafficObject& tObject, double /* oldPos */,
resistance, node_pos, pos_veh_node, Element::ElementType::RESISTOR_traction_wire);

if (element_pos->getResistance() - resistance < 0) {
WRITE_WARNING("The resistivity of overhead wire segment connected to vehicle " + veh.getID() + " is < 0. Set to 1e-6.");
WRITE_WARNINGF(TL("The resistivity of overhead wire segment connected to vehicle % is < 0. Set to 1e-6."), veh.getID());
}

element_pos->setResistance(element_pos->getResistance() - resistance);
Expand Down Expand Up @@ -919,7 +919,7 @@ void
MSDevice_ElecHybrid::setActualBatteryCapacity(const double actualBatteryCapacity) {
// Use the SOC limits to cap the actual battery capacity
if (actualBatteryCapacity < mySOCMin * myMaximumBatteryCapacity) {
//WRITE_WARNING("The Battery of vehicle '" + getID() + "' has been exhausted.");
//WRITE_WARNINGF(TL("The Battery of vehicle '%' has been exhausted."), getID());
myActualBatteryCapacity = MIN2(mySOCMin * myMaximumBatteryCapacity, myActualBatteryCapacity);
} else if (actualBatteryCapacity > mySOCMax * myMaximumBatteryCapacity) {
myActualBatteryCapacity = MAX2(mySOCMax * myMaximumBatteryCapacity, myActualBatteryCapacity);
Expand Down
4 changes: 2 additions & 2 deletions src/microsim/devices/MSDevice_Example.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ MSDevice_Example::buildVehicleDevices(SUMOVehicle& v, std::vector<MSVehicleDevic
try {
customParameter2 = StringUtils::toDouble(v.getParameter().getParameter("example", "-1"));
} catch (...) {
WRITE_WARNING("Invalid value '" + v.getParameter().getParameter("example", "-1") + "'for vehicle parameter 'example'");
WRITE_WARNINGF(TL("Invalid value '%'for vehicle parameter 'example'"), v.getParameter().getParameter("example", "-1"));
}

} else {
Expand All @@ -72,7 +72,7 @@ MSDevice_Example::buildVehicleDevices(SUMOVehicle& v, std::vector<MSVehicleDevic
try {
customParameter3 = StringUtils::toDouble(v.getVehicleType().getParameter().getParameter("example", "-1"));
} catch (...) {
WRITE_WARNING("Invalid value '" + v.getVehicleType().getParameter().getParameter("example", "-1") + "'for vType parameter 'example'");
WRITE_WARNINGF(TL("Invalid value '%'for vType parameter 'example'"), v.getVehicleType().getParameter().getParameter("example", "-1"));
}

} else {
Expand Down
Loading

0 comments on commit fda886f

Please sign in to comment.