package com.routeme.utility.directions;

import com.google.maps.model.DirectionsResult;
import com.google.maps.model.TravelMode;
import com.google.maps.model.Vehicle;
import com.routeme.model.NonTransitRoute;
import com.routeme.model.Route;
import com.routeme.model.TransitRoute;

public class GoogleDirectionsUtility {
    protected static final String MUNICH_UNDERGROUND = "U-bahn";
    protected static final String MUNICH_COMMUTER_RAIL = "S-bahn";
    protected static final String MUNICH_TRAM_RAIL = "tram";
    protected static final String MUNICH_BUS_ = "Bus";
    protected static final String GOOGLE_UNDERGROUND = "Subway";
    protected static final String GOOGLE_COMMUTER_RAIL = "Commuter train";
    protected static final String GOOGLE_TRAM_RAIL = "Tram";
    protected static final String GOOGLE_BUS_ = "Bus";
    protected static final String GOOGLE_DIRECTIONS_API_KEY = "AIzaSyBgegEmbuKzGU4RKWWqqUu8y6ra2a87ZtY";

    public static String getMunichTransitVehicleName(Vehicle googleVehicle) {
        String googleVehicleName = googleVehicle.name;
        switch (googleVehicleName) {
        case GOOGLE_UNDERGROUND:
            return MUNICH_UNDERGROUND;
        case GOOGLE_COMMUTER_RAIL:
            return MUNICH_COMMUTER_RAIL;
        default:
            return googleVehicleName;
        }
    }

    public static void printRouteResults(DirectionsResult result, TravelMode travelMode) {
        System.out.println("--");
        for (int i = 0; i < result.routes.length; i++) {
            Route route;
            if (travelMode == TravelMode.TRANSIT) {
                route = new TransitRoute(result.routes[i]);
            } else {
                route = new NonTransitRoute(result.routes[i]);
            }
            System.out.println(route.getPredictionIoId());
        }
    }

    public static String getGoogleDirectionsApiKey() {
        return GOOGLE_DIRECTIONS_API_KEY;
    }
}

@@ -1908,11 +1908,618 @@
 Y;%0A    %7D
+%0A%0A    public static String replaceUmlaut(String input) %7B%0A%0A        // replace all lower Umlauts%0A        String output = input.replace(%22%C3%BC%22, %22ue%22).replace(%22%C3%B6%22, %22oe%22).replace(%22%C3%A4%22, %22ae%22).replace(%22%C3%9F%22, %22ss%22);%0A%0A        // first replace all capital umlaute in a non-capitalized context (e.g.%0A        // %C3%9Cbung)%0A        output = output.replace(%22%C3%9C(?=%5Ba-z%C3%A4%C3%B6%C3%BC%C3%9F %5D)%22, %22Ue%22).replace(%22%C3%96(?=%5Ba-z%C3%A4%C3%B6%C3%BC%C3%9F %5D)%22, %22Oe%22)%0A                .replace(%22%C3%84(?=%5Ba-z%C3%A4%C3%B6%C3%BC%C3%9F %5D)%22, %22Ae%22);%0A%0A        // now replace all the other capital umlaute%0A        output = output.replace(%22%C3%9C%22, %22UE%22).replace(%22%C3%96%22, %22OE%22).replace(%22%C3%84%22, %22AE%22);%0A%0A        return output;%0A    %7D
 %0A%7D%0A

Replace german characters with english ones