use of org.olat.core.gui.translator.PackageTranslator in project OpenOLAT by OpenOLAT.
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;
}
use of org.olat.core.gui.translator.PackageTranslator in project OpenOLAT by OpenOLAT.
the class Util method createPackageTranslator.
public static Translator createPackageTranslator(Translator baseClass, Class<?> fallbackClass, Locale locale) {
String fallbackpackage = Util.getPackageName(fallbackClass);
Translator fallback = new PackageTranslator(fallbackpackage, locale);
Translator translator = new PackageTranslator(((PackageTranslator) baseClass).getPackageName(), locale, fallback);
return translator;
}
use of org.olat.core.gui.translator.PackageTranslator in project OpenOLAT by OpenOLAT.
the class Util method createPackageTranslator.
public static Translator createPackageTranslator(Class<?> baseClass, Class<?> fallbackClass, Locale locale) {
String fallbackpackage = Util.getPackageName(fallbackClass);
Translator fallback = new PackageTranslator(fallbackpackage, locale);
String transpackage = Util.getPackageName(baseClass);
Translator translator = new PackageTranslator(transpackage, locale, fallback);
return translator;
}
use of org.olat.core.gui.translator.PackageTranslator in project OpenOLAT by OpenOLAT.
the class ENCourseNode 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)
*/
public NodeRunConstructionResult createNodeRunConstructionResult(UserRequest ureq, WindowControl wControl, UserCourseEnvironment userCourseEnv, NodeEvaluation ne, String nodecmd) {
Controller controller;
migrateConfig();
// Do not allow guests to enroll to groups
Roles roles = ureq.getUserSession().getRoles();
if (roles.isGuestOnly()) {
Translator trans = new PackageTranslator(PACKAGE, ureq.getLocale());
String title = trans.translate("guestnoaccess.title");
String message = trans.translate("guestnoaccess.message");
controller = MessageUIFactory.createInfoMessage(ureq, wControl, title, message);
} else {
controller = new ENRunController(getModuleConfiguration(), ureq, wControl, userCourseEnv, this);
}
Controller ctrl = TitledWrapperHelper.getWrapper(ureq, wControl, controller, this, "o_en_icon");
return new NodeRunConstructionResult(ctrl);
}
use of org.olat.core.gui.translator.PackageTranslator in project OpenOLAT by OpenOLAT.
the class MSCourseNode 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);
List<Property> list = cpm.listCourseNodeProperties(this, null, null, null);
// no properties created yet
if (list.size() == 0)
return null;
Translator trans = new PackageTranslator(PACKAGE_MS, locale);
return trans.translate("warn.nodedelete");
}
Aggregations