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");
}
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;
}
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;
}
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");
}
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);
}
Aggregations