Tabnine Logo
Translation.tr
Code IndexAdd Tabnine to your IDE (free)

How to use
tr
method
in
com.graphhopper.util.Translation

Best Java code snippets using com.graphhopper.util.Translation.tr (Showing top 20 results out of 315)

origin: graphhopper/graphhopper

String getWayName(int pavementType, int wayType, Translation tr) {
  String pavementName = "";
  if (pavementType == 1)
    pavementName = tr.tr("unpaved");
  String wayTypeName = "";
  switch (wayType) {
    case 0:
      wayTypeName = "";
      break;
    case 1:
      wayTypeName = tr.tr("off_bike");
      break;
    case 2:
      wayTypeName = tr.tr("cycleway");
      break;
    case 3:
      wayTypeName = tr.tr("small_way");
      break;
  }
  if (pavementName.isEmpty()) {
    if (wayType == 0 || wayType == 3)
      return "";
    return wayTypeName;
  } else if (wayTypeName.isEmpty())
    return pavementName;
  else
    return wayTypeName + ", " + pavementName;
}
origin: graphhopper/graphhopper

  @Override
  public String getTurnDescription(Translation tr) {
    if (rawName)
      return getName();

    return tr.tr("stopover", viaPosition);
  }
}
origin: graphhopper/graphhopper

  @Override
  public String getTurnDescription(Translation tr) {
    if (rawName)
      return getName();

    return tr.tr("finish");
  }
}
origin: graphhopper/graphhopper

int indi = getSign();
if (indi == Instruction.CONTINUE_ON_STREET) {
  str = Helper.isEmpty(streetName) ? tr.tr("continue") : tr.tr("continue_onto", streetName);
} else if (indi == Instruction.PT_START_TRIP) {
  str = tr.tr("pt_start_trip", streetName);
} else if (indi == Instruction.PT_TRANSFER) {
  str = tr.tr("pt_transfer_to", streetName);
} else if (indi == Instruction.PT_END_TRIP) {
  str = tr.tr("pt_end_trip", streetName);
} else {
  String dir = null;
  switch (indi) {
    case Instruction.U_TURN_UNKNOWN:
      dir = tr.tr("u_turn");
      break;
    case Instruction.U_TURN_LEFT:
      dir = tr.tr("u_turn");
      break;
    case Instruction.U_TURN_RIGHT:
      dir = tr.tr("u_turn");
      break;
    case Instruction.KEEP_LEFT:
      dir = tr.tr("keep_left");
      break;
    case Instruction.TURN_SHARP_LEFT:
      dir = tr.tr("turn_sharp_left");
      break;
    case Instruction.TURN_LEFT:
      dir = tr.tr("turn_left");
origin: graphhopper/graphhopper

  @Override
  public String getTurnDescription(Translation tr) {
    if (rawName)
      return getName();

    String str;
    String streetName = getName();
    int indi = getSign();
    if (indi == Instruction.USE_ROUNDABOUT) {
      if (!exited) {
        str = tr.tr("roundabout_enter");
      } else {
        str = Helper.isEmpty(streetName) ? tr.tr("roundabout_exit", getExitNumber())
            : tr.tr("roundabout_exit_onto", getExitNumber(), streetName);
      }
    } else {
      throw new IllegalStateException(indi + "no roundabout indication");
    }
    return str;
  }
}
origin: graphhopper/graphhopper

@Override
public InstructionAnnotation getAnnotation(long flags, Translation tr) {
  if (isTransportModeFord(flags)) {
    return new InstructionAnnotation(1, tr.tr("way_contains_ford"));
  }
  return super.getAnnotation(flags, tr);
}
origin: graphhopper/graphhopper

  @Test
  public void testToRoundaboutString() {
    Translation ptMap = SINGLETON.get("pt");
    assertTrue(ptMap.tr("roundabout_exit_onto", "1", "somestreet").contains("somestreet"));
  }
}
origin: graphhopper/graphhopper

@Test
public void testToString() {
  Translation enMap = SINGLETON.getWithFallBack(Locale.UK);
  assertEquals("continue onto blp street", enMap.tr("continue_onto", "blp street"));
  Translation trMap = SINGLETON.getWithFallBack(Locale.GERMANY);
  assertEquals("Zu Fuß", trMap.tr("web.FOOT"));
  Translation ruMap = SINGLETON.getWithFallBack(new Locale("ru"));
  assertEquals("Пешком", ruMap.tr("web.FOOT"));
  Translation zhMap = SINGLETON.getWithFallBack(new Locale("vi", "VI"));
  assertEquals("Đi bộ", zhMap.tr("web.FOOT"));
  trMap = SINGLETON.get("de_DE");
  assertEquals("Zu Fuß", trMap.tr("web.FOOT"));
  trMap = SINGLETON.get("de");
  assertEquals("Zu Fuß", trMap.tr("web.FOOT"));
  trMap = SINGLETON.get("de_AT");
  assertEquals("Zu Fuß", trMap.tr("web.FOOT"));
  trMap = SINGLETON.get("he");
  assertEquals("רגל", trMap.tr("web.FOOT"));
  trMap = SINGLETON.get("iw");
  assertEquals("רגל", trMap.tr("web.FOOT"));
  // indonesia assertEquals("in", new Locale("id").getLanguage());
}
origin: com.graphhopper/graphhopper-core

String getWayName(int pavementType, int wayType, Translation tr) {
  String pavementName = "";
  if (pavementType == 1)
    pavementName = tr.tr("unpaved");
  String wayTypeName = "";
  switch (wayType) {
    case 0:
      wayTypeName = "";
      break;
    case 1:
      wayTypeName = tr.tr("off_bike");
      break;
    case 2:
      wayTypeName = tr.tr("cycleway");
      break;
    case 3:
      wayTypeName = tr.tr("small_way");
      break;
  }
  if (pavementName.isEmpty()) {
    if (wayType == 0 || wayType == 3)
      return "";
    return wayTypeName;
  } else if (wayTypeName.isEmpty())
    return pavementName;
  else
    return wayTypeName + ", " + pavementName;
}
origin: com.graphhopper/graphhopper-api

  @Override
  public String getTurnDescription(Translation tr) {
    if (rawName)
      return getName();

    return tr.tr("stopover", viaPosition);
  }
}
origin: com.rgi-corp/graphhopper

  @Override
  public String getTurnDescription(Translation tr) {
    if (rawName)
      return getName();

    return tr.tr("finish");
  }
}
origin: com.graphhopper/graphhopper-api

  @Override
  public String getTurnDescription(Translation tr) {
    if (rawName)
      return getName();

    return tr.tr("finish");
  }
}
origin: com.graphhopper/graphhopper

  @Override
  public String getTurnDescription( Translation tr )
  {
    if (rawName)
      return getName();

    return tr.tr("finish");
  }
}
origin: com.rgi-corp/graphhopper

  @Override
  public String getTurnDescription(Translation tr) {
    if (rawName)
      return getName();

    return tr.tr("stopover", viaPosition);
  }
}
origin: com.graphhopper/graphhopper

  @Override
  public String getTurnDescription( Translation tr )
  {
    if (rawName)
      return getName();

    return tr.tr("stopover", viaPosition);
  }
}
origin: com.rgi-corp/graphhopper

  @Override
  public String getTurnDescription(Translation tr) {
    if (rawName)
      return getName();

    String str;
    String streetName = getName();
    int indi = getSign();
    if (indi == Instruction.USE_ROUNDABOUT) {
      if (!exited) {
        str = tr.tr("roundabout_enter");
      } else {
        str = Helper.isEmpty(streetName) ? tr.tr("roundabout_exit", getExitNumber())
            : tr.tr("roundabout_exit_onto", getExitNumber(), streetName);
      }
    } else {
      throw new IllegalStateException(indi + "no roundabout indication");
    }
    return str;
  }
}
origin: com.graphhopper/graphhopper-api

  @Override
  public String getTurnDescription(Translation tr) {
    if (rawName)
      return getName();

    String str;
    String streetName = getName();
    int indi = getSign();
    if (indi == Instruction.USE_ROUNDABOUT) {
      if (!exited) {
        str = tr.tr("roundabout_enter");
      } else {
        str = Helper.isEmpty(streetName) ? tr.tr("roundabout_exit", getExitNumber())
            : tr.tr("roundabout_exit_onto", getExitNumber(), streetName);
      }
    } else {
      throw new IllegalStateException(indi + "no roundabout indication");
    }
    return str;
  }
}
origin: com.graphhopper/graphhopper

  @Override
  public String getTurnDescription( Translation tr )
  {
    if (rawName)
      return getName();

    String str;
    String streetName = getName();
    int indi = getSign();
    if (indi == Instruction.USE_ROUNDABOUT)
    {
      if (!exited)
      {
        str = tr.tr("roundabout_enter");
      } else
      {
        str = Helper.isEmpty(streetName) ? tr.tr("roundabout_exit", getExitNumber())
            : tr.tr("roundabout_exit_onto", getExitNumber(), streetName);
      }
    } else
    {
      throw new IllegalStateException(indi + "no roundabout indication");
    }
    return str;
  }
}
origin: com.graphhopper/graphhopper-core

@Override
public InstructionAnnotation getAnnotation(long flags, Translation tr) {
  if (isTransportModeFord(flags)) {
    return new InstructionAnnotation(1, tr.tr("way_contains_ford"));
  }
  return super.getAnnotation(flags, tr);
}
origin: com.rgi-corp/graphhopper

@Override
public InstructionAnnotation getAnnotation(long flags, Translation tr) {
  if (isTransportModeFord(flags)) {
    return new InstructionAnnotation(1, tr.tr("way_contains_ford"));
  }
  return super.getAnnotation(flags, tr);
}
com.graphhopper.utilTranslationtr

Popular methods of Translation

  • asMap
  • getLocale
  • getLanguage

Popular in Java

  • Reactive rest calls using spring rest template
  • onRequestPermissionsResult (Fragment)
  • getExternalFilesDir (Context)
  • startActivity (Activity)
  • FileInputStream (java.io)
    An input stream that reads bytes from a file. File file = ...finally if (in != null) in.clos
  • LinkedHashMap (java.util)
    LinkedHashMap is an implementation of Map that guarantees iteration order. All optional operations a
  • LinkedList (java.util)
    Doubly-linked list implementation of the List and Dequeinterfaces. Implements all optional list oper
  • Executor (java.util.concurrent)
    An object that executes submitted Runnable tasks. This interface provides a way of decoupling task s
  • ReentrantLock (java.util.concurrent.locks)
    A reentrant mutual exclusion Lock with the same basic behavior and semantics as the implicit monitor
  • DateTimeFormat (org.joda.time.format)
    Factory that creates instances of DateTimeFormatter from patterns and styles. Datetime formatting i
  • Top Vim plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now