Search in sources :

Example 51 with Translator

use of org.olat.core.gui.translator.Translator in project OpenOLAT by OpenOLAT.

the class ScormCourseNodeConfiguration method getLinkText.

@Override
public String getLinkText(Locale locale) {
    Translator fallback = Util.createPackageTranslator(CourseNodeConfiguration.class, locale);
    Translator translator = Util.createPackageTranslator(this.getClass(), locale, fallback);
    return translator.translate("title_scorm");
}
Also used : Translator(org.olat.core.gui.translator.Translator)

Example 52 with Translator

use of org.olat.core.gui.translator.Translator in project OpenOLAT by OpenOLAT.

the class OrgTypeStatisticManager method createColumnDescriptor.

@Override
public ColumnDescriptor createColumnDescriptor(UserRequest ureq, int column, String headerId) {
    if (column == 0) {
        return new DefaultColumnDescriptor("stat.table.header.node", 0, null, ureq.getLocale());
    }
    if (headerId != null) {
        Translator translator = Util.createPackageTranslator(ShibbolethModule.class, ureq.getLocale());
        if (translator != null) {
            String newHeaderId = translator.translate("swissEduPersonHomeOrganizationType." + headerId);
            if (newHeaderId != null && !newHeaderId.startsWith(Translator.NO_TRANSLATION_ERROR_PREFIX)) {
                headerId = newHeaderId;
            }
        }
    }
    TotalAwareColumnDescriptor cd = new TotalAwareColumnDescriptor(headerId, column, StatisticDisplayController.CLICK_TOTAL_ACTION + column, ureq.getLocale(), ColumnDescriptor.ALIGNMENT_RIGHT);
    cd.setTranslateHeaderKey(false);
    return cd;
}
Also used : Translator(org.olat.core.gui.translator.Translator) TotalAwareColumnDescriptor(org.olat.course.statistic.TotalAwareColumnDescriptor) DefaultColumnDescriptor(org.olat.core.gui.components.table.DefaultColumnDescriptor)

Example 53 with Translator

use of org.olat.core.gui.translator.Translator in project OpenOLAT by OpenOLAT.

the class StudyBranch3StatisticManager method createColumnDescriptor.

@Override
public ColumnDescriptor createColumnDescriptor(UserRequest ureq, int column, String headerId) {
    if (column == 0) {
        return new DefaultColumnDescriptor("stat.table.header.node", 0, null, ureq.getLocale());
    }
    if (headerId != null) {
        Translator translator = Util.createPackageTranslator(ShibbolethModule.class, ureq.getLocale());
        if (translator != null) {
            String newHeaderId = translator.translate("swissEduPersonStudyBranch3." + headerId);
            if (newHeaderId != null && !newHeaderId.startsWith(Translator.NO_TRANSLATION_ERROR_PREFIX)) {
                headerId = newHeaderId;
            }
        }
    }
    TotalAwareColumnDescriptor cd = new TotalAwareColumnDescriptor(headerId, column, StatisticDisplayController.CLICK_TOTAL_ACTION + column, ureq.getLocale(), ColumnDescriptor.ALIGNMENT_RIGHT);
    cd.setTranslateHeaderKey(false);
    return cd;
}
Also used : Translator(org.olat.core.gui.translator.Translator) TotalAwareColumnDescriptor(org.olat.course.statistic.TotalAwareColumnDescriptor) DefaultColumnDescriptor(org.olat.core.gui.components.table.DefaultColumnDescriptor)

Example 54 with Translator

use of org.olat.core.gui.translator.Translator in project OpenOLAT by OpenOLAT.

the class HintMaterial method getHintTitle.

private String getHintTitle(RenderInstructions ri) {
    Locale locale = (Locale) ri.get(RenderInstructions.KEY_LOCALE);
    Translator translator = Util.createPackageTranslator(QTIModule.class, locale);
    return translator.translate("render.hint");
}
Also used : Locale(java.util.Locale) Translator(org.olat.core.gui.translator.Translator)

Example 55 with Translator

use of org.olat.core.gui.translator.Translator in project OpenOLAT by OpenOLAT.

the class MembersOverviewIdentitiesController method initForm.

@Override
protected void initForm(FormItemContainer formLayout, Controller listener, UserRequest ureq) {
    formLayout.setElementCssClass("o_sel_user_import_overview");
    if (notfounds != null && !notfounds.isEmpty()) {
        String page = velocity_root + "/warn_notfound.html";
        FormLayoutContainer warnLayout = FormLayoutContainer.createCustomFormLayout("warnNotFounds", getTranslator(), page);
        warnLayout.setRootForm(mainForm);
        formLayout.add(warnLayout);
        StringBuilder sb = new StringBuilder();
        for (String notfound : notfounds) {
            if (sb.length() > 0)
                sb.append(", ");
            sb.append(notfound);
        }
        String msg = translate("user.notfound", new String[] { sb.toString() });
        addToRunContext("notFounds", sb.toString());
        warnLayout.contextPut("notFounds", msg);
    }
    // add the table
    FlexiTableColumnModel tableColumnModel = FlexiTableDataModelFactory.createFlexiTableColumnModel();
    int colIndex = 0;
    if (isAdministrativeUser) {
        tableColumnModel.addFlexiColumnModel(new DefaultFlexiColumnModel("table.user.login", colIndex++));
    }
    List<UserPropertyHandler> userPropertyHandlers = userManager.getUserPropertyHandlersFor(USER_PROPS_ID, isAdministrativeUser);
    List<UserPropertyHandler> resultingPropertyHandlers = new ArrayList<UserPropertyHandler>();
    // followed by the users fields
    for (int i = 0; i < userPropertyHandlers.size(); i++) {
        UserPropertyHandler userPropertyHandler = userPropertyHandlers.get(i);
        boolean visible = UserManager.getInstance().isMandatoryUserProperty(USER_PROPS_ID, userPropertyHandler);
        if (visible) {
            resultingPropertyHandlers.add(userPropertyHandler);
            tableColumnModel.addFlexiColumnModel(new DefaultFlexiColumnModel(userPropertyHandler.i18nColumnDescriptorLabelKey(), colIndex++));
        }
    }
    Translator myTrans = userManager.getPropertyHandlerTranslator(getTranslator());
    MembersOverviewDataModel userTableModel = new MembersOverviewDataModel(oks, resultingPropertyHandlers, isAdministrativeUser, getLocale(), tableColumnModel);
    FlexiTableElement tableEl = uifactory.addTableElement(getWindowControl(), "users", userTableModel, myTrans, formLayout);
    tableEl.setCustomizeColumns(false);
}
Also used : ArrayList(java.util.ArrayList) FormLayoutContainer(org.olat.core.gui.components.form.flexible.impl.FormLayoutContainer) Translator(org.olat.core.gui.translator.Translator) FlexiTableColumnModel(org.olat.core.gui.components.form.flexible.impl.elements.table.FlexiTableColumnModel) DefaultFlexiColumnModel(org.olat.core.gui.components.form.flexible.impl.elements.table.DefaultFlexiColumnModel) UserPropertyHandler(org.olat.user.propertyhandlers.UserPropertyHandler) FlexiTableElement(org.olat.core.gui.components.form.flexible.elements.FlexiTableElement)

Aggregations

Translator (org.olat.core.gui.translator.Translator)586 Identity (org.olat.core.id.Identity)62 Date (java.util.Date)54 Controller (org.olat.core.gui.control.Controller)54 RepositoryEntry (org.olat.repository.RepositoryEntry)54 Locale (java.util.Locale)52 PackageTranslator (org.olat.core.gui.translator.PackageTranslator)46 ArrayList (java.util.ArrayList)40 TabbableController (org.olat.core.gui.control.generic.tabbable.TabbableController)40 NodeEditController (org.olat.course.editor.NodeEditController)40 TitleItem (org.olat.core.commons.services.notifications.model.TitleItem)36 Roles (org.olat.core.id.Roles)36 NodeRunConstructionResult (org.olat.course.run.navigation.NodeRunConstructionResult)36 SubscriptionListItem (org.olat.core.commons.services.notifications.model.SubscriptionListItem)32 Publisher (org.olat.core.commons.services.notifications.Publisher)30 SubscriptionInfo (org.olat.core.commons.services.notifications.SubscriptionInfo)30 FormLayoutContainer (org.olat.core.gui.components.form.flexible.impl.FormLayoutContainer)30 MailBundle (org.olat.core.util.mail.MailBundle)28 ICourse (org.olat.course.ICourse)26 UserPropertyHandler (org.olat.user.propertyhandlers.UserPropertyHandler)26