use of org.olat.core.util.i18n.ui.SingleKeyTranslatorController in project OpenOLAT by OpenOLAT.
the class QEducationalContextsAdminController method doOpenTranslationTool.
private void doOpenTranslationTool(UserRequest ureq, QEducationalContext row) {
String key2Translate = "item.level." + row.getLevel().toLowerCase();
String[] keys2Translate = { key2Translate };
singleKeyTrnsCtrl = new SingleKeyTranslatorController(ureq, getWindowControl(), keys2Translate, QuestionsController.class);
listenTo(singleKeyTrnsCtrl);
removeAsListenerAndDispose(cmc);
cmc = new CloseableModalController(getWindowControl(), "close", singleKeyTrnsCtrl.getInitialComponent(), true, translate("translation"));
listenTo(cmc);
cmc.activate();
}
use of org.olat.core.util.i18n.ui.SingleKeyTranslatorController in project OpenOLAT by OpenOLAT.
the class GenericSelectionPropertyHandlerController method formOK.
@Override
protected void formOK(UserRequest ureq) {
// save the data to config
boolean m = modeRadio.isSelected(1);
handler.setMultiSelect(m);
List<String> selectionKeys = new ArrayList<String>();
for (int i = 0; i < optionFieldNames.size(); i++) {
TextElement te = (TextElement) hcFlc.getFormComponent(OPTFIELD_PREFIX + optionFieldNames.get(i));
String textValue = te.getValue();
if (StringHelper.containsNonWhitespace(textValue))
selectionKeys.add(textValue);
}
String[] selectionKeysArray = new String[selectionKeys.size()];
handler.setSelectionKeys(selectionKeys.toArray(selectionKeysArray));
handler.saveConfig();
// remove i18nKeys that are no longer used (prevent orphans)
if (singleKeyTrsCtrl == null) {
singleKeyTrsCtrl = new SingleKeyTranslatorController(ureq, getWindowControl(), "", GenericSelectionPropertyHandler.class);
}
for (String key : i18nKeysToDelete) {
singleKeyTrsCtrl.deleteI18nKey(key);
}
fireEvent(ureq, Event.DONE_EVENT);
}
use of org.olat.core.util.i18n.ui.SingleKeyTranslatorController in project OpenOLAT by OpenOLAT.
the class LicenseAdminConfigController method doOpenTranslator.
private void doOpenTranslator(UserRequest ureq, LicenseType licenseType) {
String i18nKey = LicenseUIFactory.LICENSE_TYPE_TRANS + licenseType.getName().toLowerCase();
String[] keys2Translate = { i18nKey };
translatorCtrl = new SingleKeyTranslatorController(ureq, getWindowControl(), keys2Translate, LicenseAdminController.class);
listenTo(translatorCtrl);
removeAsListenerAndDispose(cmc);
cmc = new CloseableModalController(getWindowControl(), "close", translatorCtrl.getInitialComponent(), true, translate("admin.translate"));
listenTo(cmc);
cmc.activate();
}
use of org.olat.core.util.i18n.ui.SingleKeyTranslatorController in project openolat by klemens.
the class LicenseAdminConfigController method doOpenTranslator.
private void doOpenTranslator(UserRequest ureq, LicenseType licenseType) {
String i18nKey = LicenseUIFactory.LICENSE_TYPE_TRANS + licenseType.getName().toLowerCase();
String[] keys2Translate = { i18nKey };
translatorCtrl = new SingleKeyTranslatorController(ureq, getWindowControl(), keys2Translate, LicenseAdminController.class);
listenTo(translatorCtrl);
removeAsListenerAndDispose(cmc);
cmc = new CloseableModalController(getWindowControl(), "close", translatorCtrl.getInitialComponent(), true, translate("admin.translate"));
listenTo(cmc);
cmc.activate();
}
use of org.olat.core.util.i18n.ui.SingleKeyTranslatorController in project openolat by klemens.
the class QEducationalContextsAdminController method doOpenTranslationTool.
private void doOpenTranslationTool(UserRequest ureq, QEducationalContext row) {
String key2Translate = "item.level." + row.getLevel().toLowerCase();
String[] keys2Translate = { key2Translate };
singleKeyTrnsCtrl = new SingleKeyTranslatorController(ureq, getWindowControl(), keys2Translate, QuestionsController.class);
listenTo(singleKeyTrnsCtrl);
removeAsListenerAndDispose(cmc);
cmc = new CloseableModalController(getWindowControl(), "close", singleKeyTrnsCtrl.getInitialComponent(), true, translate("translation"));
listenTo(cmc);
cmc.activate();
}
Aggregations