Ejemplo n.º 1
0
  private Asset getLocalizedAssetFromResource(Resource unlocalized, Locale locale) {
    Resource localized = locale == null ? unlocalized : unlocalized.forLocale(locale);

    if (localized == null || !localized.exists())
      throw new RuntimeException(
          String.format("Unable to locate asset '%s' (the file does not exist).", unlocalized));

    return getAssetForResource(localized);
  }
Ejemplo n.º 2
0
  private Resource localize(Resource unlocalized, Locale locale) {
    Resource localized = unlocalized.forLocale(locale);

    return localized != null ? localized : unlocalized;
  }