/** * Checks if the passed string (plus the prefix) has a localization mapped. * * @param unloc * The unlocalized suffix * @return True if there is a localization mapped, false otherwise. */ public boolean canLocalize(@Nonnull String unloc) { return canLocalizeExact(addPrefix(unloc)); }
default void checkTranslation() { if (!getLang().canLocalizeExact(getKey()) && !getLang().canLocalizeExact(getKey() + ".line1")) { Log.error("Missing translation for '" + this + "': " + get()); } }
default @Nonnull NNList<String> getLines(@Nonnull Object... params) { NNList<String> result = new NNList<>(); for (int i = 1; i < 12; i++) { final String linekey = getKey() + ".line" + i; if (getLang().canLocalizeExact(linekey)) { result.add(getLang().localizeExact(linekey, params)); } else { return result; } } return result; }