super();
final IModel translationModel;
{
TranslateBean translateBean;
final GeoServerApplication application = getGeoServerApplication();
translateBean = (TranslateBean) application.getMetaData(TRANSLATION_BEAN);
if (translateBean == null) {
TranslationController controller = getController();
Map<Locale, Map<String, String>> translatedResources;
translatedResources = controller.getTranslatedResources();
// default locale is keyed by null
Locale baseLocale = null;
translateBean = new TranslateBean(baseLocale, translatedResources);
application.setMetaData(TRANSLATION_BEAN, translateBean);
}
translateBean.setTargetLanguage(targetLocale);
// translationModel = new Model(translateBean);
translationModel = new LoadableDetachableModel() {
private static final long serialVersionUID = 1L;
@Override
protected Object load() {
final Application application = getApplication();
TranslateBean translateState = (TranslateBean) application
.getMetaData(TRANSLATION_BEAN);
return translateState;
}
};
}