use of org.olat.core.gui.translator.PackageTranslator in project OpenOLAT by OpenOLAT.
the class TACourseNode method createNodeRunConstructionResult.
/**
* @see org.olat.course.nodes.CourseNode#createNodeRunConstructionResult(org.olat.core.gui.UserRequest,
* org.olat.core.gui.control.WindowControl,
* org.olat.course.run.userview.UserCourseEnvironment,
* org.olat.course.run.userview.NodeEvaluation)
*/
@Override
public NodeRunConstructionResult createNodeRunConstructionResult(UserRequest ureq, WindowControl wControl, UserCourseEnvironment userCourseEnv, NodeEvaluation ne, String nodecmd) {
updateModuleConfigDefaults(false);
Controller controller;
// Do not allow guests to access tasks
Roles roles = ureq.getUserSession().getRoles();
if (roles.isGuestOnly()) {
Translator trans = new PackageTranslator(PACKAGE, ureq.getLocale());
String title = trans.translate(NLS_GUESTNOACCESS_TITLE);
String message = trans.translate(NLS_GUESTNOACCESS_MESSAGE);
controller = MessageUIFactory.createInfoMessage(ureq, wControl, title, message);
} else {
controller = new TACourseNodeRunController(ureq, wControl, userCourseEnv, this, ne, false);
}
Controller ctrl = TitledWrapperHelper.getWrapper(ureq, wControl, controller, this, "o_ta_icon");
return new NodeRunConstructionResult(ctrl);
}
use of org.olat.core.gui.translator.PackageTranslator in project OpenOLAT by OpenOLAT.
the class OperatorManager method getRegisteredAndAlreadyTranslatedOperatorLabels.
public static String[] getRegisteredAndAlreadyTranslatedOperatorLabels(Locale locale, String[] operatorKeys) {
List<String> keys = Arrays.asList(operatorKeys);
Translator t = new PackageTranslator(OperatorManager.class.getPackage().getName(), locale);
String[] tmp = new String[operatorKeys.length];
int i = 0;
for (Operator o : ops) {
if (keys.contains(o.getOperatorKey())) {
tmp[i++] = t.translate(o.getLabelKey());
}
}
return tmp;
}
use of org.olat.core.gui.translator.PackageTranslator in project OpenOLAT by OpenOLAT.
the class ForumNodeForumCallback method informOnDelete.
/**
* @see org.olat.course.nodes.CourseNode#informOnDelete(org.olat.core.gui.UserRequest,
* org.olat.course.ICourse)
*/
@Override
public String informOnDelete(Locale locale, ICourse course) {
CoursePropertyManager cpm = PersistingCoursePropertyManager.getInstance(course);
Property forumKeyProperty = cpm.findCourseNodeProperty(this, null, null, FORUM_KEY);
// no forum created yet
if (forumKeyProperty == null)
return null;
return new PackageTranslator(PACKAGE_FO, locale).translate("warn.forumdelete");
}
use of org.olat.core.gui.translator.PackageTranslator in project OpenOLAT by OpenOLAT.
the class IQSELFCourseNode method informOnDelete.
/**
* @see org.olat.course.nodes.CourseNode#informOnDelete(org.olat.core.gui.UserRequest,
* org.olat.course.ICourse)
*/
@Override
public String informOnDelete(Locale locale, ICourse course) {
// Check if there are qtiresults for this selftest
String repositorySoftKey = (String) getModuleConfiguration().get(IQEditController.CONFIG_KEY_REPOSITORY_SOFTKEY);
Long repKey = RepositoryManager.getInstance().lookupRepositoryEntryBySoftkey(repositorySoftKey, true).getKey();
if (QTIResultManager.getInstance().hasResultSets(course.getResourceableId(), this.getIdent(), repKey)) {
return new PackageTranslator(PACKAGE_IQ, locale).translate("info.nodedelete");
}
return null;
}
use of org.olat.core.gui.translator.PackageTranslator in project openolat by klemens.
the class OperatorManager method getAllRegisteredAndAlreadyTranslatedOperatorLabels.
/**
* @param l the locale for translating the operators labels
* @return the translated labels for all registered operators
*/
public static String[] getAllRegisteredAndAlreadyTranslatedOperatorLabels(Locale l) {
Translator t = new PackageTranslator(OperatorManager.class.getPackage().getName(), l);
String[] tmp = new String[ops.size()];
int i = 0;
for (Operator o : ops) {
tmp[i++] = t.translate(o.getLabelKey());
}
return tmp;
}
Aggregations