use of org.opentripplanner.util.TranslatedString in project OpenTripPlanner by opentripplanner.
the class AlertsUpdateHandler method deBuffer.
/**
* convert a protobuf TranslatedString to a OTP TranslatedString
*
* @return A TranslatedString containing the same information as the input
*/
private I18NString deBuffer(GtfsRealtime.TranslatedString input) {
Map<String, String> translations = new HashMap<>();
for (GtfsRealtime.TranslatedString.Translation translation : input.getTranslationList()) {
String language = translation.getLanguage();
String string = translation.getText();
translations.put(language, string);
}
return translations.isEmpty() ? null : TranslatedString.getI18NString(translations);
}
Aggregations