ItEr60S04ValidacionEProbasFuncionaisItEr59S04: [Bug #565] Fixed translation problem for enums.
This commit is contained in:
parent
3e456feca5
commit
2fa3bdd126
18 changed files with 193 additions and 49 deletions
|
|
@ -20,6 +20,7 @@
|
|||
|
||||
package org.zkoss.ganttz.data.resourceload;
|
||||
|
||||
import org.zkoss.ganttz.i18n.I18nHelper;
|
||||
|
||||
/**
|
||||
* @author Susana Montes Pedreira <smontes@wirelessgalicia.com>
|
||||
|
|
@ -53,13 +54,20 @@ public class TimeLineRole<T> {
|
|||
*/
|
||||
public enum TimeLineRoleEnum {
|
||||
|
||||
NONE("None"), WORKER("Worker"), ORDER("Order"), TASK("Task") {
|
||||
NONE(_("None")), WORKER(_("Worker")), ORDER(_("Order")), TASK(_("Task")) {
|
||||
@Override
|
||||
public boolean isVisibleScheduled() {
|
||||
return true;
|
||||
}
|
||||
},
|
||||
CRITERION("Criterion");
|
||||
CRITERION(_("Criterion"));
|
||||
|
||||
/**
|
||||
* Forces to mark the string as needing translation
|
||||
*/
|
||||
private static String _(String string) {
|
||||
return string;
|
||||
}
|
||||
|
||||
private String name;
|
||||
|
||||
|
|
@ -80,7 +88,7 @@ public class TimeLineRole<T> {
|
|||
}
|
||||
|
||||
public String toString() {
|
||||
return this.name;
|
||||
return I18nHelper._(this.name);
|
||||
}
|
||||
|
||||
public boolean isVisibleScheduled() {
|
||||
|
|
|
|||
|
|
@ -20,10 +20,9 @@
|
|||
|
||||
package org.zkoss.ganttz.timetracker.zoom;
|
||||
|
||||
import static org.zkoss.ganttz.i18n.I18nHelper._;
|
||||
|
||||
import org.joda.time.Days;
|
||||
import org.joda.time.LocalDate;
|
||||
import org.zkoss.ganttz.i18n.I18nHelper;
|
||||
/**
|
||||
* @author Francisco Javier Moran Rúa
|
||||
*/
|
||||
|
|
@ -108,6 +107,13 @@ public enum ZoomLevel {
|
|||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* Forces to mark the string as needing translation
|
||||
*/
|
||||
private static String _(String string) {
|
||||
return string;
|
||||
}
|
||||
|
||||
private String name;
|
||||
|
||||
private ZoomLevel(String name) {
|
||||
|
|
@ -143,7 +149,7 @@ public enum ZoomLevel {
|
|||
|
||||
@Override
|
||||
public String toString() {
|
||||
return name;
|
||||
return I18nHelper._(name);
|
||||
}
|
||||
|
||||
public static ZoomLevel getFromString(String zoomLevelParameter) {
|
||||
|
|
|
|||
|
|
@ -20,15 +20,35 @@
|
|||
|
||||
package org.navalplanner.business.materials.entities;
|
||||
|
||||
import org.navalplanner.business.i18n.I18nHelper;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Diego Pino Garcia <dpino@igalia.com>
|
||||
*
|
||||
*/
|
||||
public enum MaterialStatusEnum {
|
||||
RECEIVED,
|
||||
PENDING,
|
||||
ORDERED,
|
||||
PROCESSING,
|
||||
CANCELED
|
||||
RECEIVED(_("RECEIVED")),
|
||||
PENDING(_("PENDING")),
|
||||
ORDERED(_("ORDERED")),
|
||||
PROCESSING(_("PROCESSING")),
|
||||
CANCELED(_("CANCELED"));
|
||||
|
||||
/**
|
||||
* Forces to mark the string as needing translation
|
||||
*/
|
||||
private static String _(String string) {
|
||||
return string;
|
||||
}
|
||||
|
||||
private String description;
|
||||
|
||||
private MaterialStatusEnum(String description) {
|
||||
this.description = description;
|
||||
}
|
||||
|
||||
public String toString() {
|
||||
return I18nHelper._(this.description);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@
|
|||
|
||||
package org.navalplanner.business.orders.entities;
|
||||
|
||||
import static org.navalplanner.business.i18n.I18nHelper._;
|
||||
import org.navalplanner.business.i18n.I18nHelper;
|
||||
|
||||
|
||||
/**
|
||||
|
|
@ -33,6 +33,13 @@ public enum OrderStatusEnum {
|
|||
_("FINISHED")), CANCELLED(_("CANCELLED")), SUBCONTRACTED_PENDING_ORDER(
|
||||
_("SUBCONTRACTED PENDING ORDER")), STORED(_("STORED"));
|
||||
|
||||
/**
|
||||
* Forces to mark the string as needing translation
|
||||
*/
|
||||
private static String _(String string) {
|
||||
return string;
|
||||
}
|
||||
|
||||
private String description;
|
||||
|
||||
private OrderStatusEnum(String description) {
|
||||
|
|
@ -40,7 +47,7 @@ public enum OrderStatusEnum {
|
|||
}
|
||||
|
||||
public String toString() {
|
||||
return this.description;
|
||||
return I18nHelper._(this.description);
|
||||
}
|
||||
|
||||
public static OrderStatusEnum getDefault() {
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@
|
|||
|
||||
package org.navalplanner.business.planner.entities;
|
||||
|
||||
import static org.navalplanner.business.i18n.I18nHelper._;
|
||||
import org.navalplanner.business.i18n.I18nHelper;
|
||||
|
||||
/**
|
||||
* Possible states of a {@link SubcontractedTaskData}.
|
||||
|
|
@ -31,6 +31,13 @@ public enum SubcontractState {
|
|||
PENDING(_("Pending"), true), FAILED_SENT(_("Failed sent"), true), SUCCESS_SENT(
|
||||
_("Success sent"), false);
|
||||
|
||||
/**
|
||||
* Forces to mark the string as needing translation
|
||||
*/
|
||||
private static String _(String string) {
|
||||
return string;
|
||||
}
|
||||
|
||||
private String name;
|
||||
private boolean sendable;
|
||||
|
||||
|
|
@ -41,7 +48,7 @@ public enum SubcontractState {
|
|||
|
||||
@Override
|
||||
public String toString() {
|
||||
return name;
|
||||
return I18nHelper._(name);
|
||||
}
|
||||
|
||||
public boolean isSendable() {
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@
|
|||
|
||||
package org.navalplanner.business.planner.entities;
|
||||
|
||||
import static org.navalplanner.business.i18n.I18nHelper._;
|
||||
import org.navalplanner.business.i18n.I18nHelper;
|
||||
|
||||
public enum TaskStatusEnum {
|
||||
ALL(_("All")),
|
||||
|
|
@ -29,6 +29,13 @@ public enum TaskStatusEnum {
|
|||
PENDING(_("Pending")),
|
||||
BLOCKED(_("Blocked"));
|
||||
|
||||
/**
|
||||
* Forces to mark the string as needing translation
|
||||
*/
|
||||
private static String _(String string) {
|
||||
return string;
|
||||
}
|
||||
|
||||
private String value;
|
||||
|
||||
private TaskStatusEnum(String value) {
|
||||
|
|
@ -36,6 +43,6 @@ public enum TaskStatusEnum {
|
|||
}
|
||||
|
||||
public String toString() {
|
||||
return value;
|
||||
return I18nHelper._(value);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@
|
|||
|
||||
package org.navalplanner.business.resources.entities;
|
||||
|
||||
import static org.navalplanner.business.i18n.I18nHelper._;
|
||||
import org.navalplanner.business.i18n.I18nHelper;
|
||||
|
||||
|
||||
/**
|
||||
|
|
@ -33,6 +33,13 @@ public enum ResourceEnum {
|
|||
WORKER(Worker.class, _("WORKER")),
|
||||
MACHINE(Machine.class, _("MACHINE"));
|
||||
|
||||
/**
|
||||
* Forces to mark the string as needing translation
|
||||
*/
|
||||
private static String _(String string) {
|
||||
return string;
|
||||
}
|
||||
|
||||
private Class<?> klass;
|
||||
private final String displayName;
|
||||
|
||||
|
|
@ -46,7 +53,7 @@ public enum ResourceEnum {
|
|||
}
|
||||
|
||||
public String getDisplayName() {
|
||||
return displayName;
|
||||
return I18nHelper._(displayName);
|
||||
}
|
||||
|
||||
public static ResourceEnum getDefault() {
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@
|
|||
|
||||
package org.navalplanner.business.users.entities;
|
||||
|
||||
import static org.navalplanner.business.i18n.I18nHelper._;
|
||||
import org.navalplanner.business.i18n.I18nHelper;
|
||||
|
||||
/**
|
||||
* Available types of {@link OrderAuthorization}.
|
||||
|
|
@ -32,6 +32,13 @@ public enum OrderAuthorizationType {
|
|||
READ_AUTHORIZATION(_("Read authorization")),
|
||||
WRITE_AUTHORIZATION(_("Write authorization"));
|
||||
|
||||
/**
|
||||
* Forces to mark the string as needing translation
|
||||
*/
|
||||
private static String _(String string) {
|
||||
return string;
|
||||
}
|
||||
|
||||
private final String displayName;
|
||||
|
||||
private OrderAuthorizationType(String displayName) {
|
||||
|
|
@ -39,6 +46,6 @@ public enum OrderAuthorizationType {
|
|||
}
|
||||
|
||||
public String getDisplayName() {
|
||||
return displayName;
|
||||
return I18nHelper._(displayName);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@
|
|||
|
||||
package org.navalplanner.business.users.entities;
|
||||
|
||||
import static org.navalplanner.business.i18n.I18nHelper._;
|
||||
import org.navalplanner.business.i18n.I18nHelper;
|
||||
|
||||
/**
|
||||
* Available user roles.
|
||||
|
|
@ -36,6 +36,13 @@ public enum UserRole {
|
|||
ROLE_EDIT_ALL_ORDERS(_("All orders edition allowed")),
|
||||
ROLE_CREATE_ORDER(_("Order creation allowed"));
|
||||
|
||||
/**
|
||||
* Forces to mark the string as needing translation
|
||||
*/
|
||||
private static String _(String string) {
|
||||
return string;
|
||||
}
|
||||
|
||||
private final String displayName;
|
||||
|
||||
private UserRole(String displayName) {
|
||||
|
|
@ -43,7 +50,7 @@ public enum UserRole {
|
|||
}
|
||||
|
||||
public String getDisplayName() {
|
||||
return displayName;
|
||||
return I18nHelper._(displayName);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@
|
|||
*/
|
||||
package org.navalplanner.business.workreports.entities;
|
||||
|
||||
import static org.navalplanner.business.i18n.I18nHelper._;
|
||||
import org.navalplanner.business.i18n.I18nHelper;
|
||||
|
||||
public enum HoursManagementEnum {
|
||||
|
||||
|
|
@ -31,6 +31,13 @@ public enum HoursManagementEnum {
|
|||
HOURS_CALCULATED_BY_CLOCK(_("Number of hours calculated by clock.")),
|
||||
NUMBER_OF_HOURS_AND_CLOCK(_("Number of assigned hours and the time."));
|
||||
|
||||
/**
|
||||
* Forces to mark the string as needing translation
|
||||
*/
|
||||
private static String _(String string) {
|
||||
return string;
|
||||
}
|
||||
|
||||
private String description;
|
||||
|
||||
private HoursManagementEnum(String description) {
|
||||
|
|
@ -38,7 +45,7 @@ public enum HoursManagementEnum {
|
|||
}
|
||||
|
||||
public String toString() {
|
||||
return this.description;
|
||||
return I18nHelper._(this.description);
|
||||
}
|
||||
|
||||
public static HoursManagementEnum getDefault() {
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@
|
|||
*/
|
||||
package org.navalplanner.business.workreports.entities;
|
||||
|
||||
import static org.navalplanner.business.i18n.I18nHelper._;
|
||||
import org.navalplanner.business.i18n.I18nHelper;
|
||||
|
||||
/**
|
||||
* @author Susana Montes Pedreira <smontes@wirelessgalicia.com>
|
||||
|
|
@ -32,6 +32,13 @@ public enum PositionInWorkReportEnum {
|
|||
|
||||
HEADING(_("heading")), LINE(_("line"));
|
||||
|
||||
/**
|
||||
* Forces to mark the string as needing translation
|
||||
*/
|
||||
private static String _(String string) {
|
||||
return string;
|
||||
}
|
||||
|
||||
private String displayName;
|
||||
|
||||
private PositionInWorkReportEnum(String displayName) {
|
||||
|
|
@ -43,7 +50,7 @@ public enum PositionInWorkReportEnum {
|
|||
}
|
||||
|
||||
public String toString() {
|
||||
return displayName;
|
||||
return I18nHelper._(displayName);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -20,12 +20,11 @@
|
|||
|
||||
package org.navalplanner.web.common.components;
|
||||
|
||||
import static org.navalplanner.web.I18nHelper._;
|
||||
|
||||
import java.util.HashSet;
|
||||
|
||||
import org.navalplanner.business.resources.entities.Criterion;
|
||||
import org.navalplanner.business.resources.entities.Worker;
|
||||
import org.navalplanner.web.I18nHelper;
|
||||
import org.navalplanner.web.planner.allocation.INewAllocationsAdder;
|
||||
import org.navalplanner.web.resources.search.NewAllocationSelectorController;
|
||||
import org.zkoss.zk.ui.HtmlMacroComponent;
|
||||
|
|
@ -41,14 +40,14 @@ import org.zkoss.zul.api.Radiogroup;
|
|||
public class NewAllocationSelector extends HtmlMacroComponent {
|
||||
|
||||
public enum AllocationType {
|
||||
SPECIFIC("specific allocation") {
|
||||
SPECIFIC(_("specific allocation")) {
|
||||
@Override
|
||||
public void addTo(NewAllocationSelectorController controller,
|
||||
INewAllocationsAdder allocationsAdder) {
|
||||
allocationsAdder.addSpecific(controller.getSelectedWorkers());
|
||||
}
|
||||
},
|
||||
GENERIC("generic allocation") {
|
||||
GENERIC(_("generic allocation")) {
|
||||
@Override
|
||||
public void addTo(
|
||||
NewAllocationSelectorController controller,
|
||||
|
|
@ -59,6 +58,13 @@ public class NewAllocationSelector extends HtmlMacroComponent {
|
|||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* Forces to mark the string as needing translation
|
||||
*/
|
||||
private static String _(String string) {
|
||||
return string;
|
||||
}
|
||||
|
||||
private final String name;
|
||||
|
||||
private AllocationType(String name) {
|
||||
|
|
@ -66,7 +72,7 @@ public class NewAllocationSelector extends HtmlMacroComponent {
|
|||
}
|
||||
|
||||
public String getName() {
|
||||
return _(name);
|
||||
return I18nHelper._(name);
|
||||
}
|
||||
|
||||
public static AllocationType getSelected(Radiogroup radioGroup) {
|
||||
|
|
|
|||
|
|
@ -23,8 +23,7 @@
|
|||
*/
|
||||
package org.navalplanner.web.common.components.finders;
|
||||
|
||||
import static org.navalplanner.web.I18nHelper._;
|
||||
|
||||
import org.navalplanner.business.i18n.I18nHelper;
|
||||
import org.navalplanner.business.orders.entities.OrderElement;
|
||||
|
||||
/**
|
||||
|
|
@ -36,6 +35,13 @@ public enum OrderElementFilterEnum implements IFilterEnum {
|
|||
|
||||
None("..."), Criterion(_("Criterion")), Label(_("Label"));
|
||||
|
||||
/**
|
||||
* Forces to mark the string as needing translation
|
||||
*/
|
||||
private static String _(String string) {
|
||||
return string;
|
||||
}
|
||||
|
||||
private String description;
|
||||
|
||||
private OrderElementFilterEnum(String description) {
|
||||
|
|
@ -43,7 +49,7 @@ public enum OrderElementFilterEnum implements IFilterEnum {
|
|||
}
|
||||
|
||||
public String toString() {
|
||||
return this.description;
|
||||
return I18nHelper._(this.description);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -23,11 +23,20 @@
|
|||
*/
|
||||
package org.navalplanner.web.common.components.finders;
|
||||
|
||||
import org.navalplanner.business.i18n.I18nHelper;
|
||||
|
||||
public enum OrderFilterEnum implements IFilterEnum {
|
||||
|
||||
None("..."), Criterion("Criterion"), Label("Label"), ExternalCompany(
|
||||
"Customer"), State(
|
||||
"State"), Code("Code"), CustomerReference("Customer Reference");
|
||||
None("..."), Criterion(_("Criterion")), Label(_("Label")), ExternalCompany(
|
||||
_("Customer")), State(_("State")), Code(_("Code")), CustomerReference(
|
||||
_("Customer Reference"));
|
||||
|
||||
/**
|
||||
* Forces to mark the string as needing translation
|
||||
*/
|
||||
private static String _(String string) {
|
||||
return string;
|
||||
}
|
||||
|
||||
private String description;
|
||||
|
||||
|
|
@ -36,7 +45,7 @@ public enum OrderFilterEnum implements IFilterEnum {
|
|||
}
|
||||
|
||||
public String toString() {
|
||||
return this.description;
|
||||
return I18nHelper._(this.description);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -25,7 +25,14 @@ package org.navalplanner.web.common.components.finders;
|
|||
|
||||
public enum ResourceFilterEnum implements IFilterEnum {
|
||||
|
||||
None("..."), Criterion("Criterion"), CostCategory("Cost category");
|
||||
None("..."), Criterion(_("Criterion")), CostCategory(_("Cost category"));
|
||||
|
||||
/**
|
||||
* Forces to mark the string as needing translation
|
||||
*/
|
||||
private static String _(String string) {
|
||||
return string;
|
||||
}
|
||||
|
||||
private String description;
|
||||
|
||||
|
|
|
|||
|
|
@ -37,6 +37,7 @@ import org.navalplanner.business.planner.entities.DerivedAllocation;
|
|||
import org.navalplanner.business.planner.entities.ResourceAllocation;
|
||||
import org.navalplanner.business.planner.entities.TaskElement;
|
||||
import org.navalplanner.business.resources.entities.ResourceEnum;
|
||||
import org.navalplanner.web.I18nHelper;
|
||||
import org.navalplanner.web.common.IMessagesForUser;
|
||||
import org.navalplanner.web.common.Util;
|
||||
import org.navalplanner.web.common.components.NewAllocationSelector;
|
||||
|
|
@ -488,34 +489,45 @@ public class ResourceAllocationController extends GenericForwardComposer {
|
|||
}
|
||||
|
||||
public enum DerivedAllocationColumn implements IConvertibleToColumn {
|
||||
NAME("Name") {
|
||||
NAME(_("Name")) {
|
||||
@Override
|
||||
public Component cellFor(DerivedAllocation data) {
|
||||
return new Label(data.getName());
|
||||
}
|
||||
},
|
||||
ALPHA("Alpha") {
|
||||
ALPHA(_("Alpha")) {
|
||||
@Override
|
||||
public Component cellFor(DerivedAllocation data) {
|
||||
return new Label(String.format("%3.2f", data.getAlpha()));
|
||||
}
|
||||
},
|
||||
HOURS("Total Hours") {
|
||||
HOURS(_("Total Hours")) {
|
||||
@Override
|
||||
public Component cellFor(DerivedAllocation data) {
|
||||
return new Label(data.getHours() + "");
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* Forces to mark the string as needing translation
|
||||
*/
|
||||
private static String _(String string) {
|
||||
return string;
|
||||
}
|
||||
|
||||
private final String name;
|
||||
|
||||
private DerivedAllocationColumn(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return I18nHelper._(name);
|
||||
}
|
||||
|
||||
@Override
|
||||
public org.zkoss.zul.api.Column toColumn() {
|
||||
return new Column(_(name));
|
||||
return new Column(getName());
|
||||
}
|
||||
|
||||
public static void appendColumnsTo(Grid grid) {
|
||||
|
|
|
|||
|
|
@ -20,8 +20,6 @@
|
|||
|
||||
package org.navalplanner.web.planner.chart;
|
||||
|
||||
import static org.navalplanner.web.I18nHelper._;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.math.RoundingMode;
|
||||
import java.util.ArrayList;
|
||||
|
|
@ -34,6 +32,7 @@ import java.util.SortedMap;
|
|||
import java.util.TreeMap;
|
||||
|
||||
import org.joda.time.LocalDate;
|
||||
import org.navalplanner.web.I18nHelper;
|
||||
import org.zkforge.timeplot.Plotinfo;
|
||||
import org.zkforge.timeplot.Timeplot;
|
||||
import org.zkforge.timeplot.geometry.TimeGeometry;
|
||||
|
|
@ -63,6 +62,13 @@ public abstract class EarnedValueChartFiller extends ChartFiller {
|
|||
_("Schedule Performance Index"), "#008888")
|
||||
;
|
||||
|
||||
/**
|
||||
* Forces to mark the string as needing translation
|
||||
*/
|
||||
private static String _(String string) {
|
||||
return string;
|
||||
}
|
||||
|
||||
private String acronym;
|
||||
private String name;
|
||||
private String color;
|
||||
|
|
@ -74,11 +80,11 @@ public abstract class EarnedValueChartFiller extends ChartFiller {
|
|||
}
|
||||
|
||||
public String getAcronym() {
|
||||
return acronym;
|
||||
return I18nHelper._(acronym);
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
return I18nHelper._(name);
|
||||
}
|
||||
|
||||
public String getColor() {
|
||||
|
|
|
|||
|
|
@ -34,6 +34,7 @@ import org.navalplanner.business.common.exceptions.InstanceNotFoundException;
|
|||
import org.navalplanner.business.common.exceptions.ValidationException;
|
||||
import org.navalplanner.business.resources.entities.VirtualWorker;
|
||||
import org.navalplanner.business.resources.entities.Worker;
|
||||
import org.navalplanner.web.I18nHelper;
|
||||
import org.navalplanner.web.calendars.BaseCalendarEditionController;
|
||||
import org.navalplanner.web.calendars.IBaseCalendarModel;
|
||||
import org.navalplanner.web.common.ConstraintChecker;
|
||||
|
|
@ -648,6 +649,13 @@ public class WorkerCRUDController extends GenericForwardComposer implements
|
|||
LIMITING_RESOURCE(_("LIMITING RESOURCE")),
|
||||
NON_LIMITING_RESOURCE(_("NON LIMITING RESOURCE"));
|
||||
|
||||
/**
|
||||
* Forces to mark the string as needing translation
|
||||
*/
|
||||
private static String _(String string) {
|
||||
return string;
|
||||
}
|
||||
|
||||
private String option;
|
||||
|
||||
private LimitingResourceEnum(String option) {
|
||||
|
|
@ -655,7 +663,7 @@ public class WorkerCRUDController extends GenericForwardComposer implements
|
|||
}
|
||||
|
||||
public String toString() {
|
||||
return option;
|
||||
return I18nHelper._(option);
|
||||
}
|
||||
|
||||
public static LimitingResourceEnum valueOf(Boolean isLimitingResource) {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue