/** * Returns the translated value for the translation-key filled with the * parameters. * * @param key * key for the translation in the language file. the key should * <b>always</b> have the following structure * <i>PACKAGE_NAME_FROM_CALLER.CLASS_NAME_FROM_CALLER.key</i> * @param def * default value which will be returned if there is no mapping * for the key * @param args * parameters which should be inserted in the translated string * @return translated value or the def parameter filled with the parameters * @see Loc#L(String, String) */ public static String LF(final String key, final String def, final Object... args) { try { return String.format(Loc.L(key, def), args); } catch (final Exception e) { return "Error: " + key; } }
/** * Returns a localized regular expression for words that usualy ar present * in an error message * * @return */ public static String getErrorRegex() { return Loc.L("system.error", ".*(error|failed).*"); }