Search in sources :

Example 21 with PackageTranslator

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;
}
Also used : PackageTranslator(org.olat.core.gui.translator.PackageTranslator) Translator(org.olat.core.gui.translator.Translator) PackageTranslator(org.olat.core.gui.translator.PackageTranslator)

Example 22 with PackageTranslator

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;
}
Also used : PackageTranslator(org.olat.core.gui.translator.PackageTranslator) Translator(org.olat.core.gui.translator.Translator) PackageTranslator(org.olat.core.gui.translator.PackageTranslator)

Example 23 with PackageTranslator

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;
}
Also used : PackageTranslator(org.olat.core.gui.translator.PackageTranslator) Translator(org.olat.core.gui.translator.Translator) PackageTranslator(org.olat.core.gui.translator.PackageTranslator)

Example 24 with PackageTranslator

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);
}
Also used : PackageTranslator(org.olat.core.gui.translator.PackageTranslator) PackageTranslator(org.olat.core.gui.translator.PackageTranslator) Translator(org.olat.core.gui.translator.Translator) Roles(org.olat.core.id.Roles) ENRunController(org.olat.course.nodes.en.ENRunController) TabbableController(org.olat.core.gui.control.generic.tabbable.TabbableController) ENEditController(org.olat.course.nodes.en.ENEditController) Controller(org.olat.core.gui.control.Controller) NodeEditController(org.olat.course.editor.NodeEditController) ENRunController(org.olat.course.nodes.en.ENRunController) ConditionEditController(org.olat.course.condition.ConditionEditController) NodeRunConstructionResult(org.olat.course.run.navigation.NodeRunConstructionResult)

Example 25 with PackageTranslator

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");
}
Also used : PackageTranslator(org.olat.core.gui.translator.PackageTranslator) PackageTranslator(org.olat.core.gui.translator.PackageTranslator) Translator(org.olat.core.gui.translator.Translator) Property(org.olat.properties.Property) CoursePropertyManager(org.olat.course.properties.CoursePropertyManager) PersistingCoursePropertyManager(org.olat.course.properties.PersistingCoursePropertyManager)

Aggregations

PackageTranslator (org.olat.core.gui.translator.PackageTranslator)40 Translator (org.olat.core.gui.translator.Translator)34 CoursePropertyManager (org.olat.course.properties.CoursePropertyManager)8 PersistingCoursePropertyManager (org.olat.course.properties.PersistingCoursePropertyManager)8 Property (org.olat.properties.Property)8 Controller (org.olat.core.gui.control.Controller)6 TabbableController (org.olat.core.gui.control.generic.tabbable.TabbableController)6 Roles (org.olat.core.id.Roles)6 NodeEditController (org.olat.course.editor.NodeEditController)6 NodeRunConstructionResult (org.olat.course.run.navigation.NodeRunConstructionResult)6 File (java.io.File)4 FormMultipartItem (org.olat.core.gui.components.form.flexible.FormMultipartItem)4 AssessmentCourseNodeController (org.olat.course.assessment.ui.tool.AssessmentCourseNodeController)4 MSEditFormController (org.olat.course.nodes.ms.MSEditFormController)4 DropboxController (org.olat.course.nodes.ta.DropboxController)4 ReturnboxController (org.olat.course.nodes.ta.ReturnboxController)4 TaskController (org.olat.course.nodes.ta.TaskController)4 Locale (java.util.Locale)2 ValidationError (org.olat.core.gui.components.form.ValidationError)2 BusinessControl (org.olat.core.id.context.BusinessControl)2