*/
public abstract class BaseFinancialsBean extends BaseFacesBean {
- /**
- * Loaded resource bundle ("cached")
- */
- private static ResourceBundle RESOURCE_BUNDLE;
-
/**
* Serial number
*/
}
@Override
- protected ResourceBundle loadResourceBundle (final Locale locale) {
- // Is the instance there?
- if (null == RESOURCE_BUNDLE) {
- // Load resource bundle, so it will be loaded from this JAR
- RESOURCE_BUNDLE = ResourceBundle.getBundle("org.mxchange.localization.bundle", locale);
+ protected void loadResourceBundles (final Locale locale) {
+ // Is any locale loaded? (Will be 2)
+ if (BaseFacesBean.getBundles().isEmpty()) {
+ // Load resource bundles, so it will be loaded from this JAR"
+ // 1) Generic
+ ResourceBundle bundle = ResourceBundle.getBundle("org.mxchange.localization.bundle", locale);
+ BaseFacesBean.getBundles().add(bundle);
+
+ // 2) Project-specific
+ bundle = ResourceBundle.getBundle("org.mxchange.localization.project", locale);
+ BaseFacesBean.getBundles().add(bundle);
}
-
- // Return cache instance
- return RESOURCE_BUNDLE;
}
}
/**
* Department name
*/
- private String departmentName;
+ private String departmentI18nKey;
/**
* Owning user instance (which this department is assigned to)
updatedDepartment = this.adminDepartmentBean.addDepartment(department);
} catch (final DepartmentAlreadyAddedException ex) {
// Output message
- this.showFacesMessage("form-admin-add-department:departmentName", "ADMIN_DEPARTMENT_ALREADY_CREATED"); //NOI18N
+ this.showFacesMessage("form-admin-add-department:departmentI18nKey", "ADMIN_DEPARTMENT_ALREADY_CREATED"); //NOI18N
return ""; //NOI18N
}
* <p>
* @return Department name
*/
- public String getDepartmentName () {
- return this.departmentName;
+ public String getDepartmentI18nKey () {
+ return this.departmentI18nKey;
}
/**
* Setter for department name
* <p>
- * @param departmentName Department name
+ * @param departmentI18nKey Department name
*/
- public void setDepartmentName (final String departmentName) {
- this.departmentName = departmentName;
+ public void setDepartmentI18nKey (final String departmentI18nKey) {
+ this.departmentI18nKey = departmentI18nKey;
}
/**
*/
private Department createDepartment () {
// Create new department instance
- final Department department = new CompanyDepartment(this.getDepartmentCompany(), this.getDepartmentName());
+ final Department department = new CompanyDepartment(this.getDepartmentCompany(), this.getDepartmentI18nKey());
// Add all optional fields
department.setDepartmentHeadquarters(this.getDepartmentHeadquarters());
// Is a department set?
if (department instanceof Department) {
// Then create name
- sb.append(department.getDepartmentName());
+ sb.append(this.getMessageFromBundle(department.getDepartmentI18nKey()));
sb.append(" ("); //NOI18N
sb.append(department.getDepartmentCompany().getCompanyName());
sb.append(")"); //NOI18N
#@TODO Please fix German umlauts!
ADMIN_DEPARTMENT_ALREADY_CREATED=Die Abteilung existiert bereits im ausgewaehlten Unternehmen.
ADMIN_LIST_DEPARTMENTS_HEADER=Alle Abteilungen auflisten
-ADMIN_DEPARTMENT_NAME=Abteilung:
+#@TODO Please fix German umlauts!
+ADMIN_DEPARTMENT_I18N_KEY=Sprachschluessel:
+ADMIN_ENTER_DEPARTMENT_I18N_KEY=Sprachschluessel fuer Abteilung:
ADMIN_DEPARTMENT_LEAD_EMPLOYEE=Abteilungsleiter:
ADMIN_ADD_DEPARTMENT_TITLE=Neue Abteilung hinzuf\u00fcgen
ADMIN_DEPARTMENT_LEGEND=Daten der Abteilung eingeben:
ADMIN_DEPARTMENT_LEGEND_TITLE=Geben Sie hier die Daten der Abteilung ein.
#@TODO Please fix German umlauts!
ADMIN_ADD_DEPARTMENT_MINIMUM_DATA=Bitte geben Sie mindestens den Namen der Abteilung (z.B. Verkauf) ein und waehlen Sie mindestens das Unternehmen aus. Wenn bekannt, waehlen Sie entweder eine Filiale oder eine Hauptniederlassung aus.
-ADMIN_ENTER_DEPARTMENT_NAME=Name der Abteilung eingeben:
ADMIN_ASSIGN_DEPARTMENT_BRANCH_OFFICE=Filiale der Abteilung zuweisen:
ADMIN_ASSIGN_DEPARTMENT_HEADQUARTERS=Hauptsitz der Abteilung zuweisen:
ADMIN_ASSIGN_DEPARTMENT_COMPANY=Unternehmen der Abteilung zuweisen:
ADMIN_ASSIGN_DEPARTMENT_LEAD_EMPLOYEE=Leitender Mitarbeiter der Abteilung zuweisen:
ADMIN_ASSIGN_DEPARTMENT_USER_OWNER=Benutzer als Besitzer der Abteilung zuweisen:
ADMIN_DEPARTMENT_COMPANY_REQUIRED=Bitte weisen Sie ein Unternehmen der Abteilung zu.
-ADMIN_DEPARTMENT_NAME_REQUIRED=Bitte geben Sie der Abteilung einen Namen. Zum Beispiel: Verkauf, Personalwesen
+#@TODO Please fix German umlauts!
+ADMIN_DEPARTMENT_I18N_KEY_REQUIRED=Bitte geben Sie den Sprachschluessel der Abteilung ein. Zum Beispiel: DEPARTMENT_NAME_SALES
BUTTON_ADMIN_ADD_DEPARTMENT_DATA=Abteilung hinzuf\u00fcgen
#@TODO Please fix German umlauts!
PAGE_TITLE_ADMIN_LIST_OPENING_TIMES=Oeffnungszeiten auflisten
ADMIN_LINK_DELETE_DEPARTMENT_TITLE=Deletes a department.
ADMIN_DEPARTMENT_ALREADY_CREATED=The department already exists in selected company.
ADMIN_LIST_DEPARTMENTS_HEADER=List all departments
-ADMIN_DEPARTMENT_NAME=Department:
+ADMIN_DEPARTMENT_I18N_KEY=I18n key:
+ADMIN_ENTER_DEPARTMENT_I18N_KEY=I18n key for department:
ADMIN_DEPARTMENT_LEAD_EMPLOYEE=Department leader:
ADMIN_ADD_DEPARTMENT_TITLE=Add new department
ADMIN_DEPARTMENT_LEGEND=Enter data of department:
ADMIN_DEPARTMENT_LEGEND_TITLE=Here you can enter data of the new department.
#Bitte geben Sie mindestens den Namen der Abteilung (z.B. Verkauf) ein und waehlen Sie mindestens das Unternehmen aus. Wenn bekannt, waehlen Sie entweder eine Filiale oder eine Hauptniederlassung aus.
ADMIN_ADD_DEPARTMENT_MINIMUM_DATA=Please enter at least name of department (e.g. Sales) and choose assigned company. If known, choose a branch office or headquarters.
-ADMIN_ENTER_DEPARTMENT_NAME=Enter name of department:
ADMIN_ASSIGN_DEPARTMENT_BRANCH_OFFICE=Assign branch office to department:
ADMIN_ASSIGN_DEPARTMENT_HEADQUARTERS=Assign headquarters to department:
ADMIN_ASSIGN_DEPARTMENT_COMPANY=Assign company to department:
ADMIN_ASSIGN_DEPARTMENT_LEAD_EMPLOYEE=Assign leading employee to department:
ADMIN_ASSIGN_DEPARTMENT_USER_OWNER=Assign owning user to department:
ADMIN_DEPARTMENT_COMPANY_REQUIRED=Please assign a company to this department.
-ADMIN_DEPARTMENT_NAME_REQUIRED=Please enter a name for the department. Examples: Sales, Human Resources
+ADMIN_DEPARTMENT_I18N_KEY_REQUIRED=Please enter an i18n key for the department. Example: DEPARTMENT_NAME_SALES
BUTTON_ADMIN_ADD_DEPARTMENT_DATA=Add department
PAGE_TITLE_ADMIN_LIST_OPENING_TIMES=List opening times
CONTENT_TITLE_ADMIN_LIST_OPENING_TIMES=List opening times:
-->
<p:fieldset legend="#{msg.ADMIN_DEPARTMENT_LEGEND}">
<p:panelGrid layout="grid" columns="2" columnClasses="ui-grid-col-4, ui-grid-col-8" styleClass="table table-full ui-noborder">
- <p:outputLabel for="departmentName" value="#{msg.ADMIN_ENTER_DEPARTMENT_NAME}" />
- <p:inputText styleClass="input" id="departmentName" size="2" maxlength="10" value="#{adminDepartmentController.departmentName}" required="true" requiredMessage="#{msg.ADMIN_DEPARTMENT_NAME_REQUIRED}" />
+ <p:outputLabel for="departmentI18nKey" value="#{msg.ADMIN_ENTER_DEPARTMENT_I18N_KEY}" />
+ <p:inputText styleClass="input" id="departmentI18nKey" size="2" maxlength="10" value="#{adminDepartmentController.departmentI18nKey}" required="true" requiredMessage="#{msg.ADMIN_DEPARTMENT_I18N_KEY_REQUIRED}" />
<p:outputLabel for="departmentCompany" value="#{msg.ADMIN_ASSIGN_DEPARTMENT_COMPANY}" />
<p:selectOneMenu
</p:link>
</p:column>
- <p:column headerText="#{msg.ADMIN_DEPARTMENT_NAME}" sortBy="#{department.departmentName}" filterBy="#{department.departmentName}" filterMatchMode="contains">
- <h:outputText value="#{department.departmentName}" />
+ <p:column headerText="#{msg.ADMIN_DEPARTMENT_I18N_KEY}" sortBy="#{department.departmentI18nKey}" filterBy="#{department.departmentI18nKey}" filterMatchMode="contains">
+ <h:outputText value="#{project[department.departmentI18nKey]}" />
</p:column>
<p:column headerText="#{msg.ADMIN_BASIC_COMPANY_DATA_COMPANY_NAME}" sortBy="#{department.departmentCompany}" filterBy="#{department.departmentCompany}" filterMatchMode="in">