/**
  * @param text the text to include in the translated string
  * @return a new {@link TranslatedString} with just a single translation in the default language
  *     of the feed using the specified text.
  */
 public static TranslatedString getTextAsTranslatedString(String text) {
   TranslatedString.Builder builder = TranslatedString.newBuilder();
   Translation.Builder translation = Translation.newBuilder();
   translation.setText(text);
   builder.addTranslation(translation);
   return builder.build();
 }
コード例 #2
0
 private String getString(TranslatedString str) {
   return str.getTranslation(0).getText();
 }