Merge remote-tracking branch 'origin/master'

This commit is contained in:
Weblate 2016-08-05 11:56:02 +02:00
commit 0d649f772d
5 changed files with 9 additions and 13 deletions

View file

@ -99,7 +99,7 @@ public class AvoidSpecificRoads {
protected String getText(RouteDataObject obj) {
return RoutingHelper.formatStreetName(obj.getName(app.getSettings().MAP_PREFERRED_LOCALE.get()),
obj.getRef(), obj.getDestinationName(app.getSettings().MAP_PREFERRED_LOCALE.get()), true);
obj.getRef(), obj.getDestinationName(app.getSettings().MAP_PREFERRED_LOCALE.get()), app.getString(R.string.towards));
}
public void showDialog(final MapActivity mapActivity) {

View file

@ -428,7 +428,7 @@ public class ExternalApiHelper {
if (ni.directionInfo != null && ni.directionInfo.getTurnType() != null) {
TurnType tt = ni.directionInfo.getTurnType();
RouteDirectionInfo a = ni.directionInfo;
result.putExtra(prefix + PARAM_NT_DIRECTION_NAME, RoutingHelper.formatStreetName(a.getStreetName(), a.getRef(), a.getDestinationName(), false));
result.putExtra(prefix + PARAM_NT_DIRECTION_NAME, RoutingHelper.formatStreetName(a.getStreetName(), a.getRef(), a.getDestinationName(), ""));
result.putExtra(prefix + PARAM_NT_DIRECTION_TURN, tt.toXmlString());
if (tt.getLanes() != null) {
result.putExtra(prefix + PARAM_NT_DIRECTION_LANES, Arrays.toString(tt.getLanes()));

View file

@ -261,7 +261,7 @@ public class RouteCalculationResult {
}
String description = toString(turn, ctx) + " " + RoutingHelper.formatStreetName(info.getStreetName(),
info.getRef(), info.getDestinationName(), true);
info.getRef(), info.getDestinationName(), ctx.getString(R.string.towards));
String[] pointNames = s.getObject().getPointNames(s.getStartPointIndex());
if(pointNames != null) {
for (int t = 0; t < pointNames.length; t++) {

View file

@ -709,7 +709,7 @@ public class RoutingHelper {
}
public static String formatStreetName(String name, String ref, String destination, boolean includeTowards) {
public static String formatStreetName(String name, String ref, String destination, String towards) {
//Original version returned:
// 1. ref + " " + dest
// 2. dest
@ -733,11 +733,7 @@ public class RoutingHelper {
if (formattedStreetName.length() > 0) {
formattedStreetName = formattedStreetName + " ";
}
if (includeTowards) {
formattedStreetName = formattedStreetName + R.string.towards + " " + destination;
} else {
formattedStreetName = formattedStreetName + " " + destination;
}
formattedStreetName = formattedStreetName + towards + " " + destination;
}
return formattedStreetName;
@ -781,14 +777,14 @@ public class RoutingHelper {
if(next != null) {
next[0] = n.directionInfo.getTurnType();
}
return formatStreetName(nm, rf, dn, true);
return formatStreetName(nm, rf, dn, app.getString(R.string.towards));
}
RouteSegmentResult rs = getCurrentSegmentResult();
if(rs != null) {
String nm = rs.getObject().getName(settings.MAP_PREFERRED_LOCALE.get());
String rf = rs.getObject().getRef();
String dn = rs.getObject().getDestinationName(settings.MAP_PREFERRED_LOCALE.get());
return formatStreetName(nm, rf, dn, true);
return formatStreetName(nm, rf, dn, app.getString(R.string.towards));
}
return null;
}

View file

@ -317,7 +317,7 @@ public class MapInfoWidgetsFactory {
showNextTurn = true;
RouteDirectionInfo next = routingHelper.getRouteDirections().get(di);
type[0] = next.getTurnType();
text = RoutingHelper.formatStreetName(next.getStreetName(), next.getRef(), next.getDestinationName(), true);
text = RoutingHelper.formatStreetName(next.getStreetName(), next.getRef(), next.getDestinationName(), map.getMyApplication().getString(R.string.towards));
// if (next.distance > 0) {
// text += " " + OsmAndFormatter.getFormattedDistance(next.distance, map.getMyApplication());
// }
@ -332,7 +332,7 @@ public class MapInfoWidgetsFactory {
RouteDataObject rt = locationProvider.getLastKnownRouteSegment();
if (rt != null) {
text = RoutingHelper.formatStreetName(rt.getName(settings.MAP_PREFERRED_LOCALE.get()),
rt.getRef(), rt.getDestinationName(settings.MAP_PREFERRED_LOCALE.get()), true);
rt.getRef(), rt.getDestinationName(settings.MAP_PREFERRED_LOCALE.get()), map.getMyApplication().getString(R.string.towards));
}
if (text == null) {
text = "";