List of usage examples for org.apache.wicket Component getVariation
public String getVariation()
From source file:de.inren.frontend.application.InRenApplication.java
License:Apache License
/** * I'm lazy some times. Don't throw exceptions when properties are missing, * just remind me with a default value (the key+locale). *//*from www . java2s . c o m*/ private void initializeFailSafeLocalize() { Localizer localizer = new Localizer() { @Override public String getString(String key, Component component, IModel<?> model, Locale locale, String style, String defaultValue) throws MissingResourceException { try { return super.getString(key, component, model, locale, style, defaultValue); } catch (MissingResourceException e) { String variation = (component != null ? component.getVariation() : null); String cacheKey = getCacheKey(key, component, locale, style, variation); log.info("######### Missing: cacheKey=[" + cacheKey + "] " + e.getMessage()); final String text = key + (locale == null ? "" : locale.getLanguage()); return "[" + text + "]"; } } }; this.getResourceSettings().setLocalizer(localizer); }