From 1a9deaa2e7280dbd9468995c041770efcc224727 Mon Sep 17 00:00:00 2001 From: Manuel Rego Casasnovas Date: Fri, 29 Jun 2012 17:32:40 +0200 Subject: [PATCH] i18n: Fixing strings * Correct some wrong strings * Remove unneeded strings marked to be translated FEA: ItEr76S04BugFixing --- .../howto-develop-a-use-case-in-libreplan.rst | 2 +- .../costcategories/entities/CostCategory.java | 8 ++--- .../ResourcesCostCategoryAssignment.java | 2 +- .../business/materials/entities/UnitType.java | 2 +- .../ResourcesPerDayModification.java | 4 +-- .../entities/CriterionSatisfaction.java | 3 +- .../workreports/entities/WorkReportLine.java | 10 +++--- .../valueobjects/DescriptionValue.java | 2 +- .../calendars/BaseCalendarCRUDController.java | 12 ++----- .../BaseCalendarEditionController.java | 16 ++++----- .../web/common/ConfigurationController.java | 2 +- .../web/common/ConfigurationModel.java | 2 +- .../libreplan/web/common/TemplateModel.java | 2 +- .../CostCategoryCRUDController.java | 14 ++++---- ...urcesCostCategoryAssignmentController.java | 5 ++- .../TypeOfWorkHoursCRUDController.java | 2 +- .../CalendarExceptionTypeModel.java | 2 +- .../ExpenseSheetCRUDController.java | 13 ++++--- .../ExternalCompanyCRUDController.java | 6 ++-- .../web/materials/MaterialsController.java | 5 ++- .../web/materials/UnitTypeModel.java | 4 +-- .../web/montecarlo/MonteCarloController.java | 2 +- ...kQualityFormsToOrderElementController.java | 8 ++--- ...edTaskQualityFormsToOrderElementModel.java | 4 +-- .../ManageOrderElementAdvancesController.java | 14 ++++---- .../web/orders/OrderCRUDController.java | 18 ++++------ .../orders/OrderElementTreeController.java | 4 +-- .../web/orders/OrdersTreeComponent.java | 2 +- .../web/orders/ProjectDetailsController.java | 4 +-- ...ssignedCriterionRequirementController.java | 6 ++-- .../labels/AssignedLabelsController.java | 2 +- .../AssignedMaterialsController.java | 6 ++-- .../web/planner/allocation/FormBinder.java | 2 +- .../streches/StretchesFunctionModel.java | 4 +-- .../company/CompanyPlanningController.java | 2 +- .../order/OrderPlanningController.java | 2 +- .../planner/reassign/ReassignController.java | 2 +- .../org/libreplan/web/print/CutyPrint.java | 8 ++--- .../QualityFormCRUDController.java | 6 ++-- .../OrderCostsPerResourceController.java | 2 +- .../criterion/CriterionTreeController.java | 2 +- .../machine/MachineCRUDController.java | 4 +-- .../MachineConfigurationController.java | 2 +- .../worker/CriterionsController.java | 14 ++++---- .../worker/CriterionsMachineController.java | 14 ++++---- .../worker/WorkerCRUDController.java | 6 ++-- .../web/scenarios/ScenarioModel.java | 2 +- .../templates/OrderTemplatesController.java | 2 +- .../web/templates/OrderTemplatesModel.java | 4 +-- .../templates/TemplatesTreeController.java | 2 +- .../libreplan/web/tree/TreeController.java | 2 +- .../web/users/ProfileCRUDController.java | 4 +-- .../workreports/WorkReportCRUDController.java | 36 +++++++++---------- .../WorkReportQueryController.java | 4 +-- .../WorkReportTypeCRUDController.java | 8 ++--- .../web/workreports/WorkReportTypeModel.java | 8 ++--- .../ws/calendars/impl/CalendarConverter.java | 6 ++-- .../ws/common/impl/OrderElementConverter.java | 2 +- .../workreports/impl/WorkReportConverter.java | 2 +- .../src/main/webapp/calendars/_edition.zul | 4 +-- .../src/main/webapp/common/configuration.zul | 6 ++-- .../costcategories/_editCostCategory.zul | 4 +-- .../excetiondays/_editExceptionDayType.zul | 6 ++-- .../_editExternalCompany.zul | 4 +-- .../src/main/webapp/labels/_editLabelType.zul | 8 ++--- .../src/main/webapp/materials/materials.zul | 4 +-- .../main/webapp/montecarlo/_montecarlo.zul | 2 +- .../webapp/orders/_listOrderElementHours.zul | 4 +-- .../webapp/orders/_orderElementDetails.zul | 4 +-- .../main/webapp/orders/_projectDetails.zul | 4 +-- .../src/main/webapp/profiles/_editProfile.zul | 2 +- .../webapp/resources/criterions/_edition.zul | 4 +-- .../webapp/resources/machine/_editMachine.zul | 6 ++-- .../machine/_machineConfigurationUnits.zul | 2 +- .../main/webapp/resources/worker/_edition.zul | 2 +- .../src/main/webapp/scenarios/_edition.zul | 2 +- .../templates/_materialAssignmentsBox.zul | 2 +- .../typeofworkhours/_editTypeOfWorkHours.zul | 6 ++-- .../src/main/webapp/users/_editUser.zul | 2 +- .../main/webapp/workreports/workReport.zul | 2 +- .../material_test.sah | 4 +-- scripts/functional-tests/common_functions.sah | 4 +-- .../data-types/exception_days_test.sah | 4 +-- .../data-types/label_test.sah | 4 +-- .../data-types/work_hours_test.sah | 4 +-- .../resources/companies_test.sah | 4 +-- .../resources/machines_test.sah | 8 ++--- .../functional-tests/users/profile_test.sah | 4 +-- scripts/functional-tests/users/user_test.sah | 4 +-- 89 files changed, 214 insertions(+), 246 deletions(-) diff --git a/doc/src/technical/howto-develop-a-use-case-in-libreplan.rst b/doc/src/technical/howto-develop-a-use-case-in-libreplan.rst index fe40b3aaf..e665153bd 100644 --- a/doc/src/technical/howto-develop-a-use-case-in-libreplan.rst +++ b/doc/src/technical/howto-develop-a-use-case-in-libreplan.rst @@ -2014,7 +2014,7 @@ following validation on ``_editStretchesFunctionTemplate.zul`` file:: value="@{controller.stretchesFunctionTemplate.name}" width="300px" onBlur="controller.updateWindowTitle()" - constraint="no empty:${i18n:_('cannot be null or empty')}" /> + constraint="no empty:${i18n:_('cannot be empty')}" /> Now, if users set an empty name, they will receive an error in a pop-up. However, if they click *Save* button, the request to sever will be sent and then they diff --git a/libreplan-business/src/main/java/org/libreplan/business/costcategories/entities/CostCategory.java b/libreplan-business/src/main/java/org/libreplan/business/costcategories/entities/CostCategory.java index 7dd689f04..b826e9d51 100644 --- a/libreplan-business/src/main/java/org/libreplan/business/costcategories/entities/CostCategory.java +++ b/libreplan-business/src/main/java/org/libreplan/business/costcategories/entities/CostCategory.java @@ -106,7 +106,7 @@ public class CostCategory extends IntegrationEntity implements IHumanIdentifiabl // this is not exactly an overlapping but a // problem with missing compulsory fields throw ValidationException.invalidValue( - _("Hours cost type cannot be empty or null"), + "Hours cost type cannot be empty", listElement); } if (listElement.getType().getId() @@ -115,12 +115,12 @@ public class CostCategory extends IntegrationEntity implements IHumanIdentifiabl // this is not exactly an overlapping but a // problem with missing compulsory fields throw ValidationException.invalidValue( - _("Init date cannot be empty or null"), + "Init date cannot be empty", listElement); } if (endDate == null && listElement.getEndDate() == null) { throw ValidationException.invalidValue( - _("End date cannot be empty or null"), + "End date cannot be empty", listElement); } else if ((endDate == null && listElement.getEndDate() .compareTo(initDate) >= 0) @@ -340,4 +340,4 @@ public class CostCategory extends IntegrationEntity implements IHumanIdentifiabl return true; } } -} \ No newline at end of file +} diff --git a/libreplan-business/src/main/java/org/libreplan/business/costcategories/entities/ResourcesCostCategoryAssignment.java b/libreplan-business/src/main/java/org/libreplan/business/costcategories/entities/ResourcesCostCategoryAssignment.java index 49aca28a7..c2c614a8a 100644 --- a/libreplan-business/src/main/java/org/libreplan/business/costcategories/entities/ResourcesCostCategoryAssignment.java +++ b/libreplan-business/src/main/java/org/libreplan/business/costcategories/entities/ResourcesCostCategoryAssignment.java @@ -142,7 +142,7 @@ public class ResourcesCostCategoryAssignment extends IntegrationEntity { } } - @AssertTrue(message="cost assignment with end date less than start date") + @AssertTrue(message="cost assignment with end date before start date") public boolean checkConstraintPositiveTimeInterval() { /* Check if it makes sense to check the constraint .*/ diff --git a/libreplan-business/src/main/java/org/libreplan/business/materials/entities/UnitType.java b/libreplan-business/src/main/java/org/libreplan/business/materials/entities/UnitType.java index c684f4049..7f8dcb7e2 100644 --- a/libreplan-business/src/main/java/org/libreplan/business/materials/entities/UnitType.java +++ b/libreplan-business/src/main/java/org/libreplan/business/materials/entities/UnitType.java @@ -82,7 +82,7 @@ public class UnitType extends IntegrationEntity implements IHumanIdentifiable { this.measure = measure; } - @AssertTrue(message = "the measure unit type has to be unique. It is already used") + @AssertTrue(message = "the measure has to be unique") public boolean checkConstraintUniqueName() { if (StringUtils.isBlank(measure)) { return true; diff --git a/libreplan-business/src/main/java/org/libreplan/business/planner/entities/allocationalgorithms/ResourcesPerDayModification.java b/libreplan-business/src/main/java/org/libreplan/business/planner/entities/allocationalgorithms/ResourcesPerDayModification.java index 74a39c9e3..5a39450fe 100644 --- a/libreplan-business/src/main/java/org/libreplan/business/planner/entities/allocationalgorithms/ResourcesPerDayModification.java +++ b/libreplan-business/src/main/java/org/libreplan/business/planner/entities/allocationalgorithms/ResourcesPerDayModification.java @@ -172,12 +172,12 @@ public abstract class ResourcesPerDayModification extends @Override public String getNoValidPeriodsMessage() { - return _("The resource's calendar has no available days starting from the start of the task."); + return _("Resource is not available from task's start"); } @Override public String getNoValidPeriodsMessageDueToIntersectionMessage() { - return _("There are no days available at resource's calendar in the days marked available by the task's calendar."); + return _("Resource is not available according to task's calendar"); } private Resource getAssociatedResource() { diff --git a/libreplan-business/src/main/java/org/libreplan/business/resources/entities/CriterionSatisfaction.java b/libreplan-business/src/main/java/org/libreplan/business/resources/entities/CriterionSatisfaction.java index db996fe1d..dcfd06eca 100644 --- a/libreplan-business/src/main/java/org/libreplan/business/resources/entities/CriterionSatisfaction.java +++ b/libreplan-business/src/main/java/org/libreplan/business/resources/entities/CriterionSatisfaction.java @@ -293,8 +293,7 @@ public class CriterionSatisfaction extends IntegrationEntity { return criterion.getType().getResource(); } - @AssertTrue(message="criterion satisfaction with end date less than start " + - "date") + @AssertTrue(message = "criterion satisfaction with end date before start") public boolean checkConstraintPositiveTimeInterval() { /* Check if it makes sense to check the constraint .*/ diff --git a/libreplan-business/src/main/java/org/libreplan/business/workreports/entities/WorkReportLine.java b/libreplan-business/src/main/java/org/libreplan/business/workreports/entities/WorkReportLine.java index cf93ca823..e6f5917e0 100644 --- a/libreplan-business/src/main/java/org/libreplan/business/workreports/entities/WorkReportLine.java +++ b/libreplan-business/src/main/java/org/libreplan/business/workreports/entities/WorkReportLine.java @@ -198,7 +198,7 @@ public class WorkReportLine extends IntegrationEntity implements Comparable, this.labels = labels; } - @NotNull(message = "work report not specified") + @NotNull(message = "timesheet not specified") public WorkReport getWorkReport() { return workReport; } @@ -395,7 +395,7 @@ public class WorkReportLine extends IntegrationEntity implements Comparable, return Registry.getWorkReportLineDAO(); } - @AssertTrue(message = "fields should match with work report data if are shared by lines") + @AssertTrue(message = "fields should match with timesheet data if are shared by lines") public boolean checkConstraintFieldsMatchWithWorkReportIfAreSharedByLines() { if (!firstLevelValidationsPassed()) { return true; @@ -441,7 +441,7 @@ public class WorkReportLine extends IntegrationEntity implements Comparable, && (orderElement != null); } - @AssertTrue(message = "label type:the work report have not assigned this label type") + @AssertTrue(message = "label type: the timesheet has not assigned this label type") public boolean checkConstraintAssignedLabelTypes() { if (this.workReport == null || this.workReport.getWorkReportType() == null) { @@ -464,7 +464,7 @@ public class WorkReportLine extends IntegrationEntity implements Comparable, return true; } - @AssertTrue(message = "description value:the work report have not assigned the description field") + @AssertTrue(message = "description value: the timesheet has not assigned the description field") public boolean checkConstraintAssignedDescriptionValues() { if (this.workReport == null || this.workReport.getWorkReportType() == null) { @@ -487,7 +487,7 @@ public class WorkReportLine extends IntegrationEntity implements Comparable, return true; } - @AssertTrue(message = "There are repeated description values in the work report line") + @AssertTrue(message = "there are repeated description values in the timesheet lines") public boolean checkConstraintAssignedRepeatedDescriptionValues() { Set textFields = new HashSet(); diff --git a/libreplan-business/src/main/java/org/libreplan/business/workreports/valueobjects/DescriptionValue.java b/libreplan-business/src/main/java/org/libreplan/business/workreports/valueobjects/DescriptionValue.java index 17d6ebbf6..1ec9fb8f4 100644 --- a/libreplan-business/src/main/java/org/libreplan/business/workreports/valueobjects/DescriptionValue.java +++ b/libreplan-business/src/main/java/org/libreplan/business/workreports/valueobjects/DescriptionValue.java @@ -77,7 +77,7 @@ public class DescriptionValue implements INewObject { this.fieldName = fieldName; } - @NotNull(message = "value cannot be null") + @NotNull(message = "value not specified") public String getValue() { return value; } diff --git a/libreplan-webapp/src/main/java/org/libreplan/web/calendars/BaseCalendarCRUDController.java b/libreplan-webapp/src/main/java/org/libreplan/web/calendars/BaseCalendarCRUDController.java index 3b7d0fd19..1dbde8f3d 100644 --- a/libreplan-webapp/src/main/java/org/libreplan/web/calendars/BaseCalendarCRUDController.java +++ b/libreplan-webapp/src/main/java/org/libreplan/web/calendars/BaseCalendarCRUDController.java @@ -416,8 +416,7 @@ public class BaseCalendarCRUDController extends GenericForwardComposer { messagesForUser .showMessage( Level.ERROR, - _("Calendar cannot be removed because it still has children. " - + "Some other calendar is derived from this one.")); + _("Calendar cannot be removed as it has other derived calendars from it")); return; } @@ -453,11 +452,8 @@ public class BaseCalendarCRUDController extends GenericForwardComposer { calendar.getName()), _("Delete"), Messagebox.OK | Messagebox.CANCEL, Messagebox.QUESTION); } catch (InterruptedException e) { - LOG.error( - _("Error on showing removing element: ", calendar.getId()), - e); + throw new RuntimeException(e); } - return Messagebox.CANCEL; } private boolean isReferencedByOtherEntities(BaseCalendar calendar) { @@ -476,9 +472,7 @@ public class BaseCalendarCRUDController extends GenericForwardComposer { Messagebox.show(_(message), _("Warning"), Messagebox.OK, Messagebox.EXCLAMATION); } catch (InterruptedException e) { - LOG.error( - _("Error on showing warning message removing calendar: ", - calendar.getId()), e); + throw new RuntimeException(e); } } diff --git a/libreplan-webapp/src/main/java/org/libreplan/web/calendars/BaseCalendarEditionController.java b/libreplan-webapp/src/main/java/org/libreplan/web/calendars/BaseCalendarEditionController.java index 65089567f..7088a231d 100644 --- a/libreplan-webapp/src/main/java/org/libreplan/web/calendars/BaseCalendarEditionController.java +++ b/libreplan-webapp/src/main/java/org/libreplan/web/calendars/BaseCalendarEditionController.java @@ -594,7 +594,7 @@ public abstract class BaseCalendarEditionController extends } if (calendar.getCapacityOn(PartialDay.wholeDay(date)).isZero()) { - return _("Not working day"); + return _("Not workable day"); } return _("Normal"); @@ -628,7 +628,7 @@ public abstract class BaseCalendarEditionController extends Date endDate = dateboxEndDate.getValue(); if (endDate == null) { throw new WrongValueException(dateboxEndDate, - _("You should select a end date for the exception")); + _("You should select an end date for the exception")); } else { Clients.closeErrorBox(dateboxEndDate); } @@ -991,7 +991,7 @@ public abstract class BaseCalendarEditionController extends .getFellow("parentCalendars"); if (parentCalendars.getSelectedItem() == null) { throw new WrongValueException(parentCalendars, - _("cannot be null or empty")); + _("cannot be empty")); } selected = (BaseCalendar) parentCalendars.getSelectedItem() .getValue(); @@ -1181,7 +1181,7 @@ public abstract class BaseCalendarEditionController extends } }); - code.setConstraint("no empty:" + _("cannot be null or empty")); + code.setConstraint("no empty:" + _("cannot be empty")); listcell.appendChild(code); item.appendChild(listcell); @@ -1220,7 +1220,7 @@ public abstract class BaseCalendarEditionController extends if (!baseCalendarModel.isOwnException(calendarException)) { result.setDisabled(true); result - .setTooltiptext(_("derived exception can not be removed")); + .setTooltiptext(_("inherited exception can not be removed")); } return result; } @@ -1264,7 +1264,7 @@ public abstract class BaseCalendarEditionController extends Date endDate = dateboxEndDate.getValue(); if (endDate == null) { throw new WrongValueException(dateboxEndDate, - _("You should select a end date for the exception")); + _("You should select an end date for the exception")); } else { Clients.closeErrorBox(dateboxEndDate); } @@ -1404,7 +1404,7 @@ public abstract class BaseCalendarEditionController extends return null; } else { throw new IllegalArgumentException( - _("Only the last activation period allows to delete end date.")); + _("End date can only be deleted in the the last activation")); } } return new LocalDate(endDate); @@ -1438,7 +1438,7 @@ public abstract class BaseCalendarEditionController extends } }); - code.setConstraint("no empty:" + _("cannot be null or empty")); + code.setConstraint("no empty:" + _("cannot be empty")); listcell.appendChild(code); item.appendChild(listcell); diff --git a/libreplan-webapp/src/main/java/org/libreplan/web/common/ConfigurationController.java b/libreplan-webapp/src/main/java/org/libreplan/web/common/ConfigurationController.java index 50db9c297..7709d16c9 100644 --- a/libreplan-webapp/src/main/java/org/libreplan/web/common/ConfigurationController.java +++ b/libreplan-webapp/src/main/java/org/libreplan/web/common/ConfigurationController.java @@ -746,7 +746,7 @@ public class ConfigurationController extends GenericForwardComposer { if (prefixBox.getValue() == null || prefixBox.getValue().isEmpty()) { throw new WrongValueException(prefixBox, - _("cannot be null or empty")); + _("cannot be empty")); } try { diff --git a/libreplan-webapp/src/main/java/org/libreplan/web/common/ConfigurationModel.java b/libreplan-webapp/src/main/java/org/libreplan/web/common/ConfigurationModel.java index dbd0d1ccb..f914fc961 100644 --- a/libreplan-webapp/src/main/java/org/libreplan/web/common/ConfigurationModel.java +++ b/libreplan-webapp/src/main/java/org/libreplan/web/common/ConfigurationModel.java @@ -231,7 +231,7 @@ public class ConfigurationModel implements IConfigurationModel { entitySequenceDAO.remove(entitySequence); } catch (InstanceNotFoundException e) { throw new ValidationException( - _("Some sequences to remove not existed")); + _("Some sequences to be removed does not exist")); } catch (IllegalArgumentException e) { throw new ValidationException(e.getMessage()); } diff --git a/libreplan-webapp/src/main/java/org/libreplan/web/common/TemplateModel.java b/libreplan-webapp/src/main/java/org/libreplan/web/common/TemplateModel.java index ac3313d02..431ae16b7 100644 --- a/libreplan-webapp/src/main/java/org/libreplan/web/common/TemplateModel.java +++ b/libreplan-webapp/src/main/java/org/libreplan/web/common/TemplateModel.java @@ -345,7 +345,7 @@ public class TemplateModel implements ITemplateModel { } private IDesktopUpdate showProgress(int remaining) { - return sendMessage(_("{0} projects reassignation remaining", remaining)); + return sendMessage(_("{0} projects remaining to reassign", remaining)); } private IDesktopUpdate sendMessage(final String message) { diff --git a/libreplan-webapp/src/main/java/org/libreplan/web/costcategories/CostCategoryCRUDController.java b/libreplan-webapp/src/main/java/org/libreplan/web/costcategories/CostCategoryCRUDController.java index fc560ddec..420f6e446 100644 --- a/libreplan-webapp/src/main/java/org/libreplan/web/costcategories/CostCategoryCRUDController.java +++ b/libreplan-webapp/src/main/java/org/libreplan/web/costcategories/CostCategoryCRUDController.java @@ -140,12 +140,12 @@ public class CostCategoryCRUDController extends BaseCRUDController if (row != null) { if (hourCost.getType() == null) { Listbox workHoursType = getWorkHoursType(row); - String message = workHoursType.getItems().isEmpty() ? _("Type of hours is empty. Please, create some type of hours before proceeding") - : _("The type of hours cannot be null"); + String message = workHoursType.getItems().isEmpty() ? _("Hours types are empty. Please, create some hours types before proceeding") + : _("cannot be empty"); throw new WrongValueException(getWorkHoursType(row), message); } if (hourCost.getPriceCost() == null) { - throw new WrongValueException(getPricePerHour(row), _("Cannot be null or empty")); + throw new WrongValueException(getPricePerHour(row), _("cannot be empty")); } } } @@ -202,7 +202,7 @@ public class CostCategoryCRUDController extends BaseCRUDController if (!hourCost.getCategory().isCodeAutogenerated()) { txtCode.setConstraint("no empty:" - + _("cannot be null or empty")); + + _("cannot be empty")); } else { txtCode.setConstraint(""); } @@ -302,7 +302,7 @@ public class CostCategoryCRUDController extends BaseCRUDController private void appendDecimalboxCost(Row row) { Decimalbox boxCost = new Decimalbox(); bindDecimalboxCost(boxCost, (HourCost) row.getValue()); - boxCost.setConstraint("no empty:" + _("cannot be null or empty")); + boxCost.setConstraint("no empty:" + _("cannot be empty")); boxCost.setFormat(Util.getMoneyFormat()); row.appendChild(boxCost); } @@ -459,9 +459,7 @@ public class CostCategoryCRUDController extends BaseCRUDController removeHourCost(hourCost); } } catch (InterruptedException e) { - messagesForUser.showMessage( - Level.ERROR, e.getMessage()); - LOG.error(_("Error on showing removing element: ", hourCost.getId()), e); + throw new RuntimeException(e); } } diff --git a/libreplan-webapp/src/main/java/org/libreplan/web/costcategories/ResourcesCostCategoryAssignmentController.java b/libreplan-webapp/src/main/java/org/libreplan/web/costcategories/ResourcesCostCategoryAssignmentController.java index a1e3c1a7f..bf3b5b843 100644 --- a/libreplan-webapp/src/main/java/org/libreplan/web/costcategories/ResourcesCostCategoryAssignmentController.java +++ b/libreplan-webapp/src/main/java/org/libreplan/web/costcategories/ResourcesCostCategoryAssignmentController.java @@ -146,8 +146,7 @@ public class ResourcesCostCategoryAssignmentController extends GenericForwardCom removeCostCategoryAssignment(assignment); } } catch (InterruptedException e) { - messagesForUser.showMessage(Level.ERROR, e.getMessage()); - LOG.error(_("Error on showing removing element: ", assignment.getId()), e); + throw new RuntimeException(e); } } @@ -337,4 +336,4 @@ public class ResourcesCostCategoryAssignmentController extends GenericForwardCom return true; } -} \ No newline at end of file +} diff --git a/libreplan-webapp/src/main/java/org/libreplan/web/costcategories/TypeOfWorkHoursCRUDController.java b/libreplan-webapp/src/main/java/org/libreplan/web/costcategories/TypeOfWorkHoursCRUDController.java index 1bcd5d01a..4418788e8 100644 --- a/libreplan-webapp/src/main/java/org/libreplan/web/costcategories/TypeOfWorkHoursCRUDController.java +++ b/libreplan-webapp/src/main/java/org/libreplan/web/costcategories/TypeOfWorkHoursCRUDController.java @@ -103,7 +103,7 @@ public class TypeOfWorkHoursCRUDController extends BaseCRUDController MAX_NUMBER_ITERATIONS) { throw new WrongValueException(ibIterations, diff --git a/libreplan-webapp/src/main/java/org/libreplan/web/orders/AssignedTaskQualityFormsToOrderElementController.java b/libreplan-webapp/src/main/java/org/libreplan/web/orders/AssignedTaskQualityFormsToOrderElementController.java index 9816e96cc..2477514f9 100644 --- a/libreplan-webapp/src/main/java/org/libreplan/web/orders/AssignedTaskQualityFormsToOrderElementController.java +++ b/libreplan-webapp/src/main/java/org/libreplan/web/orders/AssignedTaskQualityFormsToOrderElementController.java @@ -204,9 +204,7 @@ public class AssignedTaskQualityFormsToOrderElementController extends deleteTaskQualityForm(taskQualityForm); } } catch (InterruptedException e) { - messagesForUser.showMessage(Level.ERROR, e.getMessage()); - LOG.error(_("Error on showing removing element: ", taskQualityForm - .getId()), e); + throw new RuntimeException(e); } } @@ -520,14 +518,14 @@ public class AssignedTaskQualityFormsToOrderElementController extends && (!item.checkConstraintIfDateCanBeNull())) { item.setDate(null); throw new WrongValueException(comp, - _("date not specified.")); + _("date not specified")); } if (!assignedTaskQualityFormsToOrderElementModel .isCorrectConsecutiveDate(taskQualityForm, item)) { item.setDate(null); throw new WrongValueException( comp, - _("must be greater than the previous date.")); + _("must be after the previous date")); } } } diff --git a/libreplan-webapp/src/main/java/org/libreplan/web/orders/AssignedTaskQualityFormsToOrderElementModel.java b/libreplan-webapp/src/main/java/org/libreplan/web/orders/AssignedTaskQualityFormsToOrderElementModel.java index 22a45d7cf..99a29cb3b 100644 --- a/libreplan-webapp/src/main/java/org/libreplan/web/orders/AssignedTaskQualityFormsToOrderElementModel.java +++ b/libreplan-webapp/src/main/java/org/libreplan/web/orders/AssignedTaskQualityFormsToOrderElementModel.java @@ -263,7 +263,7 @@ public class AssignedTaskQualityFormsToOrderElementModel implements if ((!taskQualityForm.isByItems()) && (!taskQualityForm.isCorrectConsecutivePassed(item))) { throw new ValidationException(new InvalidValue( - _("can not pass until the previous item is passed."), + _("can not pass until the previous item is passed"), TaskQualityForm.class, "passed", item.getName(), taskQualityForm)); @@ -271,7 +271,7 @@ public class AssignedTaskQualityFormsToOrderElementModel implements if ((!taskQualityForm.isByItems()) && (!taskQualityForm.isCorrectConsecutiveDate(item))) { throw new ValidationException(new InvalidValue( - _("must be greater than the previous date."), + _("must be after the previous date"), TaskQualityForm.class, "date", item.getName(), taskQualityForm)); } diff --git a/libreplan-webapp/src/main/java/org/libreplan/web/orders/ManageOrderElementAdvancesController.java b/libreplan-webapp/src/main/java/org/libreplan/web/orders/ManageOrderElementAdvancesController.java index e79f2d17a..5b9825d91 100644 --- a/libreplan-webapp/src/main/java/org/libreplan/web/orders/ManageOrderElementAdvancesController.java +++ b/libreplan-webapp/src/main/java/org/libreplan/web/orders/ManageOrderElementAdvancesController.java @@ -136,7 +136,7 @@ public class ManageOrderElementAdvancesController extends manageOrderElementAdvancesModel.confirmSave(); return true; } catch (DuplicateAdvanceAssignmentForOrderElementException e) { - messagesForUser.showMessage(Level.ERROR, _("cannot include a progress of the same progress type twice")); + messagesForUser.showMessage(Level.ERROR, _("Cannot create another progress of the same type")); } catch (DuplicateValueTrueReportGlobalAdvanceException e) { messagesForUser.showMessage( Level.ERROR, _("spread values are not valid, at least one value should be true")); @@ -145,7 +145,7 @@ public class ManageOrderElementAdvancesController extends } catch (InstanceNotFoundException e) { messagesForUser.showMessage( Level.ERROR, e.getMessage()); - LOG.error(_("Couldn't find element: {0}", e.getKey()), e); + LOG.error("Couldn't find element: " + e.getKey(), e); } increaseScreenHeight(); return false; @@ -950,7 +950,7 @@ public class ManageOrderElementAdvancesController extends if (advance.getAdvanceType() == null) { throw new WrongValueException( getComboboxTypeBy(listItem), - _("Value is not valid, the type must be not empty")); + _("cannot be empty")); } DirectAdvanceAssignment directAdvanceAssignment; @@ -964,7 +964,7 @@ public class ManageOrderElementAdvancesController extends && directAdvanceAssignment.getMaxValue() == null) { throw new WrongValueException( getDecimalboxMaxValueBy(listItem), - _("Value is not valid, the current value must be not empty")); + _("cannot be empty")); } } } @@ -1297,7 +1297,7 @@ public class ManageOrderElementAdvancesController extends } private void showMessageDeleteSpread() { - String message = _("This progress can not be removed, because it is spread. It is necessary to select another progress as spread."); + String message = _("Spread progress cannot be removed. Please select another progress as spread."); showErrorMessage(message); } @@ -1418,7 +1418,7 @@ public class ManageOrderElementAdvancesController extends advanceMeasurement.setDate(null); ((Datebox) comp).setValue(null); throw new WrongValueException(comp, - _("The date is not valid, the date must be not empty")); + _("cannot be empty")); } else { String errorMessage = validateDateAdvanceMeasurement( new LocalDate(value), advanceMeasurement); @@ -1445,7 +1445,7 @@ public class ManageOrderElementAdvancesController extends if (((BigDecimal) value) == null) { throw new WrongValueException( comp, - _("Value is not valid, the current value must be not empty")); + _("cannot be empty")); } else { String errorMessage = validateValueAdvanceMeasurement(advanceMeasurement); if (errorMessage != null) { diff --git a/libreplan-webapp/src/main/java/org/libreplan/web/orders/OrderCRUDController.java b/libreplan-webapp/src/main/java/org/libreplan/web/orders/OrderCRUDController.java index 28f3f868d..1749ae1f0 100644 --- a/libreplan-webapp/src/main/java/org/libreplan/web/orders/OrderCRUDController.java +++ b/libreplan-webapp/src/main/java/org/libreplan/web/orders/OrderCRUDController.java @@ -832,9 +832,7 @@ public class OrderCRUDController extends GenericForwardComposer { remove(order); } } catch (InterruptedException e) { - messagesForUser.showMessage( - Level.ERROR, e.getMessage()); - LOG.error(_("Error on showing removing element: ", order.getId()), e); + throw new RuntimeException(e); } } else { @@ -864,23 +862,21 @@ public class OrderCRUDController extends GenericForwardComposer { .showMessage( Level.ERROR, _( - "You can not remove the project \"{0}\" because of any of its tasks are already in use in some timesheets and the project just exists in the current scenario", + "You can not remove the project \"{0}\" because it has work reported on it or any of its tasks", order.getName())); } else { if (!StringUtils.isBlank(order.getExternalCode())) { try { if (Messagebox .show( - _("Deleting this subcontracted project, you are going to lose the relation to report progress. Are you sure?"), + _("This is a subcontracted project, if you delete it you can not report progress anymore. Are you sure?"), _("Confirm"), Messagebox.OK | Messagebox.CANCEL, Messagebox.QUESTION) == Messagebox.CANCEL) { return; } } catch (InterruptedException e) { - messagesForUser.showMessage(Level.ERROR, e.getMessage()); - LOG.error(_("Error on showing removing element: ", order - .getId()), e); + throw new RuntimeException(e); } } @@ -1322,7 +1318,7 @@ public class OrderCRUDController extends GenericForwardComposer { && (finishDate.compareTo(filterStartDate.getValue()) < 0)) { filterFinishDate.setValue(null); throw new WrongValueException(comp, - _("must be greater than start date")); + _("must be after start date")); } } }; @@ -1506,7 +1502,7 @@ public class OrderCRUDController extends GenericForwardComposer { if (StringUtils.isBlank((String) value)) { throw new WrongValueException(comp, - _("cannot be null or empty")); + _("cannot be empty")); } try { Order found = orderDAO @@ -1530,7 +1526,7 @@ public class OrderCRUDController extends GenericForwardComposer { if (StringUtils.isBlank((String) value)) { throw new WrongValueException(comp, - _("cannot be null or empty")); + _("cannot be empty")); } try { Order found = orderDAO diff --git a/libreplan-webapp/src/main/java/org/libreplan/web/orders/OrderElementTreeController.java b/libreplan-webapp/src/main/java/org/libreplan/web/orders/OrderElementTreeController.java index c3b709d7e..9c5f47db5 100644 --- a/libreplan-webapp/src/main/java/org/libreplan/web/orders/OrderElementTreeController.java +++ b/libreplan-webapp/src/main/java/org/libreplan/web/orders/OrderElementTreeController.java @@ -674,7 +674,7 @@ public class OrderElementTreeController extends TreeController { .getValue()) < 0)) { filterFinishDateOrderElement.setValue(null); throw new WrongValueException(comp, - _("must be greater than start date")); + _("must be after start date")); } } }; @@ -715,7 +715,7 @@ public class OrderElementTreeController extends TreeController { messagesForUser .showMessage( Level.ERROR, - _("You can not remove the task \"{0}\" because of this or any of its children are already in use in some timesheets", + _("You can not remove the task \"{0}\" because it has work reported on it or any of its children", element.getName())); } else { super.remove(element); diff --git a/libreplan-webapp/src/main/java/org/libreplan/web/orders/OrdersTreeComponent.java b/libreplan-webapp/src/main/java/org/libreplan/web/orders/OrdersTreeComponent.java index f2edaa57a..d9bf40f74 100644 --- a/libreplan-webapp/src/main/java/org/libreplan/web/orders/OrdersTreeComponent.java +++ b/libreplan-webapp/src/main/java/org/libreplan/web/orders/OrdersTreeComponent.java @@ -89,7 +89,7 @@ public class OrdersTreeComponent extends TreeComponent { }); columns.add(new OrdersTreeColumn(_("Must start after"), "estimated_init", - _("Date which the task must start after (press enter in textbox to open calendar popup or type in date directly)")) { + _("Estimated init date for the task (press enter in textbox to open calendar popup or type in date directly)")) { @Override protected void doCell(OrderElementTreeitemRenderer treeRenderer, diff --git a/libreplan-webapp/src/main/java/org/libreplan/web/orders/ProjectDetailsController.java b/libreplan-webapp/src/main/java/org/libreplan/web/orders/ProjectDetailsController.java index e5c17d7f6..e0743fca8 100644 --- a/libreplan-webapp/src/main/java/org/libreplan/web/orders/ProjectDetailsController.java +++ b/libreplan-webapp/src/main/java/org/libreplan/web/orders/ProjectDetailsController.java @@ -164,7 +164,7 @@ public class ProjectDetailsController extends GenericForwardComposer { } private void showWrongValue() { - throw new WrongValueException(initDate, _("cannot be null or empty")); + throw new WrongValueException(initDate, _("cannot be empty")); } private void showWrongName() { @@ -233,7 +233,7 @@ public class ProjectDetailsController extends GenericForwardComposer { deadline.setValue(null); getOrder().setDeadline(null); throw new WrongValueException(comp, - _("must be greater than start date")); + _("must be after start date")); } } }; diff --git a/libreplan-webapp/src/main/java/org/libreplan/web/orders/criterionrequirements/AssignedCriterionRequirementController.java b/libreplan-webapp/src/main/java/org/libreplan/web/orders/criterionrequirements/AssignedCriterionRequirementController.java index 084067a3c..da77e2fa2 100644 --- a/libreplan-webapp/src/main/java/org/libreplan/web/orders/criterionrequirements/AssignedCriterionRequirementController.java +++ b/libreplan-webapp/src/main/java/org/libreplan/web/orders/criterionrequirements/AssignedCriterionRequirementController.java @@ -260,9 +260,7 @@ public abstract class AssignedCriterionRequirementController extends updateCriterionsWithDiferentResourceType(hoursGroupWrapper); } } catch (InterruptedException e) { - messagesForUser.showMessage(Level.ERROR, e.getMessage()); - LOG.error(_("Error on showing removing element: ", - hoursGroupWrapper.getHoursGroup().getId()), e); + throw new RuntimeException(e); } } Util.reloadBindings(listHoursGroups); @@ -319,7 +317,7 @@ public abstract class AssignedCriterionRequirementController extends Bandbox bandType = getBandType(requirementWrapper, row); bandType.setValue(null); throw new WrongValueException(bandType, - _("The criterion and its type cannot be null")); + _("cannot be empty")); } } diff --git a/libreplan-webapp/src/main/java/org/libreplan/web/orders/labels/AssignedLabelsController.java b/libreplan-webapp/src/main/java/org/libreplan/web/orders/labels/AssignedLabelsController.java index 98fa6fd61..5bba2e1e0 100644 --- a/libreplan-webapp/src/main/java/org/libreplan/web/orders/labels/AssignedLabelsController.java +++ b/libreplan-webapp/src/main/java/org/libreplan/web/orders/labels/AssignedLabelsController.java @@ -123,7 +123,7 @@ public abstract class AssignedLabelsController extends final String labelName = txtLabelName.getValue(); if (labelName == null || labelName.isEmpty()) { throw new WrongValueException(txtLabelName, - _("cannot be null or empty")); + _("cannot be empty")); } // Label does not exist, create diff --git a/libreplan-webapp/src/main/java/org/libreplan/web/orders/materials/AssignedMaterialsController.java b/libreplan-webapp/src/main/java/org/libreplan/web/orders/materials/AssignedMaterialsController.java index 7525c27bd..95bb541d4 100644 --- a/libreplan-webapp/src/main/java/org/libreplan/web/orders/materials/AssignedMaterialsController.java +++ b/libreplan-webapp/src/main/java/org/libreplan/web/orders/materials/AssignedMaterialsController.java @@ -391,7 +391,7 @@ public abstract class AssignedMaterialsController extends GenericForwardCo removeMaterialAssignment(materialAssignment); } } catch (InterruptedException e) { - LOG.error(_("Error on showing delete confirm"), e); + throw new RuntimeException(e); } } @@ -479,9 +479,9 @@ public abstract class AssignedMaterialsController extends GenericForwardCo splitMaterialAssignment(materialAssignment, dbUnits.getValue()); } } catch (SuspendNotAllowedException e) { - LOG.error(_("Error on splitting"), e); + throw new RuntimeException(e); } catch (InterruptedException e) { - LOG.error(_("Error on splitting"), e); + throw new RuntimeException(e); } } diff --git a/libreplan-webapp/src/main/java/org/libreplan/web/planner/allocation/FormBinder.java b/libreplan-webapp/src/main/java/org/libreplan/web/planner/allocation/FormBinder.java index ce2f2d57c..d81b2bcca 100644 --- a/libreplan-webapp/src/main/java/org/libreplan/web/planner/allocation/FormBinder.java +++ b/libreplan-webapp/src/main/java/org/libreplan/web/planner/allocation/FormBinder.java @@ -674,7 +674,7 @@ public class FormBinder { public void markNoEmptyResourcesPerDay(List rows) { Validate.isTrue(!rows.isEmpty()); - final String message = _("resources per day must be not empty and bigger than zero"); + final String message = _("resources per day cannot be empty or less than zero"); if (!recommendedAllocation) { AllocationRow first = rows.get(0); throw new WrongValueException( diff --git a/libreplan-webapp/src/main/java/org/libreplan/web/planner/allocation/streches/StretchesFunctionModel.java b/libreplan-webapp/src/main/java/org/libreplan/web/planner/allocation/streches/StretchesFunctionModel.java index 67a7b87b3..060ca8d6d 100644 --- a/libreplan-webapp/src/main/java/org/libreplan/web/planner/allocation/streches/StretchesFunctionModel.java +++ b/libreplan-webapp/src/main/java/org/libreplan/web/planner/allocation/streches/StretchesFunctionModel.java @@ -282,13 +282,13 @@ public class StretchesFunctionModel implements IStretchesFunctionModel { throws IllegalArgumentException { if (date.compareTo(task.getStartDate()) < 0) { throw new IllegalArgumentException( - _("Stretch date must not be less than task start date: " + _("Stretch date must not be before task start date: " + sameFormatAsDefaultZK(task.getStartDate()))); } if (date.compareTo(taskEndDate) > 0) { throw new IllegalArgumentException( - _("Stretch date must not be greater than the task's end date: " + _("Stretch date must not be after task end date: " + sameFormatAsDefaultZK(taskEndDate))); } diff --git a/libreplan-webapp/src/main/java/org/libreplan/web/planner/company/CompanyPlanningController.java b/libreplan-webapp/src/main/java/org/libreplan/web/planner/company/CompanyPlanningController.java index 673c456ff..d553f6431 100644 --- a/libreplan-webapp/src/main/java/org/libreplan/web/planner/company/CompanyPlanningController.java +++ b/libreplan-webapp/src/main/java/org/libreplan/web/planner/company/CompanyPlanningController.java @@ -254,7 +254,7 @@ public class CompanyPlanningController implements Composer { filterStartDate.getRawValue()) < 0)) { filterFinishDate.setValue(null); throw new WrongValueException(comp, - _("must be greater than start date")); + _("must be after start date")); } } }; diff --git a/libreplan-webapp/src/main/java/org/libreplan/web/planner/order/OrderPlanningController.java b/libreplan-webapp/src/main/java/org/libreplan/web/planner/order/OrderPlanningController.java index 7fb6b16c9..395a63a0f 100644 --- a/libreplan-webapp/src/main/java/org/libreplan/web/planner/order/OrderPlanningController.java +++ b/libreplan-webapp/src/main/java/org/libreplan/web/planner/order/OrderPlanningController.java @@ -322,7 +322,7 @@ public class OrderPlanningController implements Composer { .getValue()) < 0)) { filterFinishDateOrderElement.setValue(null); throw new WrongValueException(comp, - _("must be greater than start date")); + _("must be after start date")); } } diff --git a/libreplan-webapp/src/main/java/org/libreplan/web/planner/reassign/ReassignController.java b/libreplan-webapp/src/main/java/org/libreplan/web/planner/reassign/ReassignController.java index e4e9e8b1b..5015e42f7 100644 --- a/libreplan-webapp/src/main/java/org/libreplan/web/planner/reassign/ReassignController.java +++ b/libreplan-webapp/src/main/java/org/libreplan/web/planner/reassign/ReassignController.java @@ -140,7 +140,7 @@ public class ReassignController extends GenericForwardComposer { Date value = associatedDate.getValue(); if (value == null) { throw new WrongValueException(associatedDate, - _("must be not empty")); + _("cannot be empty")); } } window.setVisible(false); diff --git a/libreplan-webapp/src/main/java/org/libreplan/web/print/CutyPrint.java b/libreplan-webapp/src/main/java/org/libreplan/web/print/CutyPrint.java index 8e02215d0..3f8b8d296 100644 --- a/libreplan-webapp/src/main/java/org/libreplan/web/print/CutyPrint.java +++ b/libreplan-webapp/src/main/java/org/libreplan/web/print/CutyPrint.java @@ -21,8 +21,6 @@ package org.libreplan.web.print; -import static org.zkoss.ganttz.i18n.I18nHelper._; - import java.io.File; import java.io.FileInputStream; import java.io.FileNotFoundException; @@ -243,11 +241,11 @@ public class CutyPrint { } Executions.getCurrent().sendRedirect(filename, "_blank"); } catch (Exception e) { - LOG.error(_("Could open generated PDF"), e); + LOG.error("Could open generated PDF", e); } } catch (IOException e) { - LOG.error(_("Could not execute print command"), e); + LOG.error("Could not execute print command", e); } } @@ -340,7 +338,7 @@ public class CutyPrint { out.close(); } catch (FileNotFoundException ex) { - LOG.error(ex.getMessage() + _(" in the specified directory.")); + LOG.error(ex.getMessage() + " in the specified directory.", ex); System.exit(0); } catch (IOException e) { LOG.error(e.getMessage()); diff --git a/libreplan-webapp/src/main/java/org/libreplan/web/qualityforms/QualityFormCRUDController.java b/libreplan-webapp/src/main/java/org/libreplan/web/qualityforms/QualityFormCRUDController.java index bf492b0b5..3ecb9e6d7 100644 --- a/libreplan-webapp/src/main/java/org/libreplan/web/qualityforms/QualityFormCRUDController.java +++ b/libreplan-webapp/src/main/java/org/libreplan/web/qualityforms/QualityFormCRUDController.java @@ -250,7 +250,7 @@ public class QualityFormCRUDController extends BaseCRUDController { .checkConstraintOutOfRangeQualityFormItemPercentage(item)) { item.setPercentage(null); throw new WrongValueException(comp, - _("percentage must be in range (0,100]")); + _("percentage should be between 1 and 100")); } if (!qualityFormModel .checkConstraintUniqueQualityFormItemPercentage()) { @@ -391,9 +391,7 @@ public class QualityFormCRUDController extends BaseCRUDController { Messagebox.show(_(message), _("Warning"), Messagebox.OK, Messagebox.EXCLAMATION); } catch (InterruptedException e) { - LOG.error( - _("Error on showing warning message removing qualityForm: ", - qualityForm.getId()), e); + throw new RuntimeException(e); } } } diff --git a/libreplan-webapp/src/main/java/org/libreplan/web/reports/OrderCostsPerResourceController.java b/libreplan-webapp/src/main/java/org/libreplan/web/reports/OrderCostsPerResourceController.java index 709417297..b8fda5aff 100644 --- a/libreplan-webapp/src/main/java/org/libreplan/web/reports/OrderCostsPerResourceController.java +++ b/libreplan-webapp/src/main/java/org/libreplan/web/reports/OrderCostsPerResourceController.java @@ -158,7 +158,7 @@ public class OrderCostsPerResourceController extends LibrePlanReportController { && (endingDate.compareTo(getStartingDate()) < 0)) { ((Datebox) comp).setValue(null); throw new WrongValueException(comp, - _("must be greater than finish date")); + _("must be after finish date")); } } }; diff --git a/libreplan-webapp/src/main/java/org/libreplan/web/resources/criterion/CriterionTreeController.java b/libreplan-webapp/src/main/java/org/libreplan/web/resources/criterion/CriterionTreeController.java index 3df20f4d3..a13ee6662 100644 --- a/libreplan-webapp/src/main/java/org/libreplan/web/resources/criterion/CriterionTreeController.java +++ b/libreplan-webapp/src/main/java/org/libreplan/web/resources/criterion/CriterionTreeController.java @@ -132,7 +132,7 @@ public class CriterionTreeController extends GenericForwardComposer { criterionForThisRow.setName(value); } })); - String message = _("cannot be null or empty"); + String message = _("cannot be empty"); textboxName .setConstraint("no empty:"+message); diff --git a/libreplan-webapp/src/main/java/org/libreplan/web/resources/machine/MachineCRUDController.java b/libreplan-webapp/src/main/java/org/libreplan/web/resources/machine/MachineCRUDController.java index d1e049b27..4aa2015f2 100644 --- a/libreplan-webapp/src/main/java/org/libreplan/web/resources/machine/MachineCRUDController.java +++ b/libreplan-webapp/src/main/java/org/libreplan/web/resources/machine/MachineCRUDController.java @@ -405,7 +405,7 @@ public class MachineCRUDController extends BaseCRUDController { && (finishDate.compareTo(filterStartDate.getValue()) < 0)) { filterFinishDate.setValue(null); throw new WrongValueException(comp, - _("must be greater than start date")); + _("must be after start date")); } } }; @@ -551,7 +551,7 @@ public class MachineCRUDController extends BaseCRUDController { machineModel.confirmRemove(machine); } catch (InstanceNotFoundException e) { messagesForUser.showMessage(Level.INFO, - _("This machine was already removed by other user")); + _("Machine was already removed")); } } diff --git a/libreplan-webapp/src/main/java/org/libreplan/web/resources/machine/MachineConfigurationController.java b/libreplan-webapp/src/main/java/org/libreplan/web/resources/machine/MachineConfigurationController.java index 4bfb003ec..ab6425290 100644 --- a/libreplan-webapp/src/main/java/org/libreplan/web/resources/machine/MachineConfigurationController.java +++ b/libreplan-webapp/src/main/java/org/libreplan/web/resources/machine/MachineConfigurationController.java @@ -219,7 +219,7 @@ public class MachineConfigurationController extends GenericForwardComposer { if (startDateBox.getValue().compareTo((Date) value) > 0) { throw new WrongValueException( comp, - _("End date is not valid, the new end date must be greater than the start date")); + _("End date is not valid, the new end date after the start date")); } } } diff --git a/libreplan-webapp/src/main/java/org/libreplan/web/resources/worker/CriterionsController.java b/libreplan-webapp/src/main/java/org/libreplan/web/resources/worker/CriterionsController.java index 6937d6d2d..e9746b10c 100644 --- a/libreplan-webapp/src/main/java/org/libreplan/web/resources/worker/CriterionsController.java +++ b/libreplan-webapp/src/main/java/org/libreplan/web/resources/worker/CriterionsController.java @@ -179,11 +179,11 @@ public class CriterionsController extends GenericForwardComposer { } if(assignedCriterionsModel.checkSameCriterionAndSameInterval(satisfaction)){ throw new WrongValueException(comp, - _("Criterion is not valid, it overlaps other criterionSatisfaction with the same criterion")); + _("Criterion already assigned")); } if(assignedCriterionsModel.checkNotAllowSimultaneousCriterionsPerResource(satisfaction)){ throw new WrongValueException(comp, - _("CriterionType is not valid, it overlaps other criterionSatisfaction with the same criterionType")); + _("This type of criteria cannot have multiple values in the same period")); } } @@ -209,7 +209,7 @@ public class CriterionsController extends GenericForwardComposer { (CriterionSatisfactionDTO)((Row) comp.getParent()).getValue(); if(value == null) { throw new WrongValueException(comp, - _("Start date cannot be null")); + _("cannot be empty")); } if(!criterionSatisfactionDTO.isLessToEndDate((Date) value)){ throw new WrongValueException(comp, @@ -236,10 +236,10 @@ public class CriterionsController extends GenericForwardComposer { (CriterionSatisfactionDTO)((Row) comp.getParent()).getValue(); if(!criterionSatisfactionDTO.isGreaterStartDate((Date) value)){ throw new WrongValueException(comp, - _("End date is not valid, the new end date must be greater than the start date")); + _("End date is not valid, the new end date after the start date")); }else if(!criterionSatisfactionDTO.isPostEndDate((Date) value)){ throw new WrongValueException(comp, - _("End date is not valid, the new end date must be later the current end date")); + _("End date is not valid, the new end date must be after the current end date")); } } @@ -340,7 +340,7 @@ public class CriterionsController extends GenericForwardComposer { // Value is incorrect, clear startDate.setValue(null); throw new WrongValueException(startDate, - _("The start date cannot be null")); + _("cannot be empty")); } if (CriterionSatisfactionDTO.CRITERION_WITH_ITS_TYPE.equals(propertyName)) { // Locate TextboxResource @@ -348,7 +348,7 @@ public class CriterionsController extends GenericForwardComposer { // Value is incorrect, clear bandType.setValue(null); throw new WrongValueException(bandType, - _("The criterion and its type cannot be null")); + _("cannot be empty")); } } } diff --git a/libreplan-webapp/src/main/java/org/libreplan/web/resources/worker/CriterionsMachineController.java b/libreplan-webapp/src/main/java/org/libreplan/web/resources/worker/CriterionsMachineController.java index 6dfd51428..5f3c269f4 100644 --- a/libreplan-webapp/src/main/java/org/libreplan/web/resources/worker/CriterionsMachineController.java +++ b/libreplan-webapp/src/main/java/org/libreplan/web/resources/worker/CriterionsMachineController.java @@ -179,12 +179,12 @@ public class CriterionsMachineController extends GenericForwardComposer { if (assignedMachineCriterionsModel .checkSameCriterionAndSameInterval(satisfaction)) { throw new WrongValueException(comp, - _("Criterion is not valid, the criterion overlap other criterionSatisfaction whith same criterion")); + _("Criterion already assigned")); } if (assignedMachineCriterionsModel .checkNotAllowSimultaneousCriterionsPerResource(satisfaction)) { throw new WrongValueException(comp, - _("CriterionType is not valid, the criterionType overlap other criterionSatisfaction whith same criterionType")); + _("This type of criteria cannot have multiple values in the same period")); } } @@ -211,11 +211,11 @@ public class CriterionsMachineController extends GenericForwardComposer { if (!criterionSatisfactionDTO.isGreaterStartDate((Date) value)) { throw new WrongValueException( comp, - _("End date is not valid, the new end date must be greater than the start date")); + _("End date is not valid, the new end date must be after the start date")); } else if (!criterionSatisfactionDTO.isPostEndDate((Date) value)) { throw new WrongValueException( comp, - _("End date is not valid, the new end date must be later the current end date")); + _("End date is not valid, the new end date must be after the current end date")); } } @@ -233,7 +233,7 @@ public class CriterionsMachineController extends GenericForwardComposer { CriterionSatisfactionDTO criterionSatisfactionDTO = (CriterionSatisfactionDTO) ((Row) comp .getParent()).getValue(); if (value == null) { - throw new WrongValueException(comp, _("Start date cannot be null")); + throw new WrongValueException(comp, _("cannot be empty")); } if (!criterionSatisfactionDTO.isLessToEndDate((Date) value)) { throw new WrongValueException( @@ -345,7 +345,7 @@ public class CriterionsMachineController extends GenericForwardComposer { // Value is incorrect, clear startDate.setValue(null); throw new WrongValueException(startDate, - _("The start date cannot be null")); + _("cannot be empty")); } if (CriterionSatisfactionDTO.CRITERION_WITH_ITS_TYPE .equals(propertyName)) { @@ -354,7 +354,7 @@ public class CriterionsMachineController extends GenericForwardComposer { // Value is incorrect, clear bandType.setValue(null); throw new WrongValueException(bandType, - _("The criterion and its type cannot be null")); + _("cannot be empty")); } } } diff --git a/libreplan-webapp/src/main/java/org/libreplan/web/resources/worker/WorkerCRUDController.java b/libreplan-webapp/src/main/java/org/libreplan/web/resources/worker/WorkerCRUDController.java index e4b9deebf..bafaa2c28 100644 --- a/libreplan-webapp/src/main/java/org/libreplan/web/resources/worker/WorkerCRUDController.java +++ b/libreplan-webapp/src/main/java/org/libreplan/web/resources/worker/WorkerCRUDController.java @@ -301,13 +301,13 @@ public class WorkerCRUDController extends GenericForwardComposer implements String loginName = loginNameTextbox.getValue(); if (StringUtils.isBlank(loginName)) { throw new WrongValueException(loginNameTextbox, - _("cannot be null or empty")); + _("cannot be empty")); } String password = passwordTextbox.getValue(); if (StringUtils.isBlank(loginName)) { throw new WrongValueException(passwordTextbox, - _("cannot be null or empty")); + _("cannot be empty")); } String passwordConfirmation = passwordConfirmationTextbox.getValue(); @@ -765,7 +765,7 @@ public class WorkerCRUDController extends GenericForwardComposer implements && (finishDate.compareTo(filterStartDate.getValue()) < 0)) { filterFinishDate.setValue(null); throw new WrongValueException(comp, - _("must be greater than start date")); + _("must be after start date")); } } }; diff --git a/libreplan-webapp/src/main/java/org/libreplan/web/scenarios/ScenarioModel.java b/libreplan-webapp/src/main/java/org/libreplan/web/scenarios/ScenarioModel.java index 779981524..e1603b326 100644 --- a/libreplan-webapp/src/main/java/org/libreplan/web/scenarios/ScenarioModel.java +++ b/libreplan-webapp/src/main/java/org/libreplan/web/scenarios/ScenarioModel.java @@ -115,7 +115,7 @@ public class ScenarioModel implements IScenarioModel { boolean isMainScenario = PredefinedScenarios.MASTER.getScenario().getId().equals(scenario.getId()); if (isMainScenario) { throw new IllegalArgumentException( - _("You can not remove the default scenario called \"{0}\"", PredefinedScenarios.MASTER.getName())); + _("You can not remove the default scenario \"{0}\"", PredefinedScenarios.MASTER.getName())); } Scenario currentScenario = scenarioManager.getCurrent(); diff --git a/libreplan-webapp/src/main/java/org/libreplan/web/templates/OrderTemplatesController.java b/libreplan-webapp/src/main/java/org/libreplan/web/templates/OrderTemplatesController.java index 543807766..2167202f8 100644 --- a/libreplan-webapp/src/main/java/org/libreplan/web/templates/OrderTemplatesController.java +++ b/libreplan-webapp/src/main/java/org/libreplan/web/templates/OrderTemplatesController.java @@ -392,7 +392,7 @@ public class OrderTemplatesController extends GenericForwardComposer implements } } } catch (InterruptedException e) { - LOG.error(_("Error on showing delete confirm"), e); + throw new RuntimeException(e); } } diff --git a/libreplan-webapp/src/main/java/org/libreplan/web/templates/OrderTemplatesModel.java b/libreplan-webapp/src/main/java/org/libreplan/web/templates/OrderTemplatesModel.java index 607ef25e6..c5f76500a 100644 --- a/libreplan-webapp/src/main/java/org/libreplan/web/templates/OrderTemplatesModel.java +++ b/libreplan-webapp/src/main/java/org/libreplan/web/templates/OrderTemplatesModel.java @@ -308,13 +308,13 @@ public class OrderTemplatesModel implements IOrderTemplatesModel { public void validateTemplateName(String name) throws IllegalArgumentException { if ((name == null) || (name.isEmpty())) { - throw new IllegalArgumentException(_("the name must be not empty")); + throw new IllegalArgumentException(_("the name cannot be empty")); } getTemplate().setName(name); if (!getTemplate().checkConstraintUniqueRootTemplateName()) { throw new IllegalArgumentException( - _("There exists other template with the same name.")); + _("Already exists other template with the same name")); } } diff --git a/libreplan-webapp/src/main/java/org/libreplan/web/templates/TemplatesTreeController.java b/libreplan-webapp/src/main/java/org/libreplan/web/templates/TemplatesTreeController.java index 61d2f085a..71a37adaa 100644 --- a/libreplan-webapp/src/main/java/org/libreplan/web/templates/TemplatesTreeController.java +++ b/libreplan-webapp/src/main/java/org/libreplan/web/templates/TemplatesTreeController.java @@ -107,7 +107,7 @@ public class TemplatesTreeController extends element.setName(value); } }); - textBox.setConstraint("no empty:" + _("cannot be null or empty")); + textBox.setConstraint("no empty:" + _("cannot be empty")); addCell(textBox); putNameTextbox(element, textBox); } diff --git a/libreplan-webapp/src/main/java/org/libreplan/web/tree/TreeController.java b/libreplan-webapp/src/main/java/org/libreplan/web/tree/TreeController.java index 131e41a30..328c17ea6 100644 --- a/libreplan-webapp/src/main/java/org/libreplan/web/tree/TreeController.java +++ b/libreplan-webapp/src/main/java/org/libreplan/web/tree/TreeController.java @@ -970,7 +970,7 @@ public abstract class TreeController> extends if (!readOnly && element.isLeaf()) { if (getHoursGroupHandler().hasMoreThanOneHoursGroup(element)) { boxHours.setReadonly(true); - tc.setTooltiptext(_("Not editable for containing more that an hours group.")); + tc.setTooltiptext(_("Disabled because of it contains more than one hours group")); } else { boxHours.setReadonly(false); tc.setTooltiptext(""); diff --git a/libreplan-webapp/src/main/java/org/libreplan/web/users/ProfileCRUDController.java b/libreplan-webapp/src/main/java/org/libreplan/web/users/ProfileCRUDController.java index e0177b04d..36a088026 100644 --- a/libreplan-webapp/src/main/java/org/libreplan/web/users/ProfileCRUDController.java +++ b/libreplan-webapp/src/main/java/org/libreplan/web/users/ProfileCRUDController.java @@ -155,9 +155,7 @@ public class ProfileCRUDController extends BaseCRUDController { Messagebox.show(_(message), _("Warning"), Messagebox.OK, Messagebox.EXCLAMATION); } catch (InterruptedException e) { - LOG.error( - _("Error on showing warning message removing typeOfWorkHours: ", - profile.getId()), e); + throw new RuntimeException(e); } } @Override diff --git a/libreplan-webapp/src/main/java/org/libreplan/web/workreports/WorkReportCRUDController.java b/libreplan-webapp/src/main/java/org/libreplan/web/workreports/WorkReportCRUDController.java index f6862fefb..37649e704 100644 --- a/libreplan-webapp/src/main/java/org/libreplan/web/workreports/WorkReportCRUDController.java +++ b/libreplan-webapp/src/main/java/org/libreplan/web/workreports/WorkReportCRUDController.java @@ -218,9 +218,7 @@ public class WorkReportCRUDController extends GenericForwardComposer implements Util.reloadBindings(listWindow); } } catch (InterruptedException e) { - messagesForUser.showMessage( - Level.ERROR, e.getMessage()); - LOG.error(_("Error on removing element: ", workReport.getId()), e); + throw new RuntimeException(e); } } @@ -313,21 +311,21 @@ public class WorkReportCRUDController extends GenericForwardComposer implements if (!getWorkReport() .checkConstraintDateMustBeNotNullIfIsSharedByLines()) { Datebox datebox = (Datebox) createWindow.getFellowIfAny("date"); - showInvalidMessage(datebox, _("Date cannot be null")); + showInvalidMessage(datebox, _("cannot be empty")); return false; } if (!getWorkReport() .checkConstraintResourceMustBeNotNullIfIsSharedByLines()) { showInvalidMessage(autocompleteResource, - _("Resource cannot be null")); + _("cannot be empty")); return false; } if (!getWorkReport() .checkConstraintOrderElementMustBeNotNullIfIsSharedByLines()) { showInvalidMessage(bandboxSelectOrderElementInHead, - _("Task code cannot be null")); + _("cannot be empty")); return false; } return true; @@ -356,7 +354,7 @@ public class WorkReportCRUDController extends GenericForwardComposer implements } else if (workReportLine.getDate() == null) { Datebox date = getDateboxDate(row); if (date != null) { - String message = _("The date cannot be null"); + String message = _("cannot be empty"); showInvalidMessage(date, message); } return false; @@ -369,7 +367,7 @@ public class WorkReportCRUDController extends GenericForwardComposer implements } else if (workReportLine.getResource() == null) { Autocomplete autoResource = getTextboxResource(row); if (autoResource != null) { - String message = _("The resource cannot be null"); + String message = _("cannot be empty"); showInvalidMessage(autoResource, message); } return false; @@ -382,7 +380,7 @@ public class WorkReportCRUDController extends GenericForwardComposer implements } else if (workReportLine.getOrderElement() == null) { BandboxSearch bandboxOrder = getTextboxOrder(row); if (bandboxOrder != null) { - String message = _("The task code cannot be null"); + String message = _("cannot be empty"); bandboxOrder.clear(); showInvalidMessage(bandboxOrder, message); } @@ -393,7 +391,7 @@ public class WorkReportCRUDController extends GenericForwardComposer implements .checkConstraintClockStartMustBeNotNullIfIsCalculatedByClock()) { Timebox timeStart = getTimeboxStart(row); if (timeStart != null) { - String message = _("Time Start cannot be null"); + String message = _("cannot be empty"); showInvalidMessage(timeStart, message); } return false; @@ -403,7 +401,7 @@ public class WorkReportCRUDController extends GenericForwardComposer implements .checkConstraintClockFinishMustBeNotNullIfIsCalculatedByClock()) { Timebox timeFinish = getTimeboxFinish(row); if (timeFinish != null) { - String message = _("Time finish cannot be null"); + String message = _("cannot be empty"); showInvalidMessage(timeFinish, message); } return false; @@ -412,7 +410,7 @@ public class WorkReportCRUDController extends GenericForwardComposer implements if (workReportLine.getEffort() == null) { Textbox effort = getEffort(row); if (effort == null) { - String message = _("Effort cannot be null"); + String message = _("cannot be empty"); showInvalidMessage(effort, message); } if (EffortDuration.parseFromFormattedString(effort.getValue()) @@ -436,8 +434,8 @@ public class WorkReportCRUDController extends GenericForwardComposer implements // Locate TextboxOrder Listbox autoTypeOfHours = getTypeOfHours(row); if (autoTypeOfHours != null) { - String message = autoTypeOfHours.getItems().isEmpty() ? _("Type of hours is empty. Please, create some type of hours before proceeding") - : _("The type of hours cannot be null"); + String message = autoTypeOfHours.getItems().isEmpty() ? _("Hours types are empty. Please, create some hours types before proceeding") + : _("cannot be empty"); showInvalidMessage(autoTypeOfHours, message); } return false; @@ -449,7 +447,7 @@ public class WorkReportCRUDController extends GenericForwardComposer implements // Locate TextboxCode Textbox txtCode = getCode(row); if (txtCode != null) { - String message = _("The code cannot be empty."); + String message = _("cannot be empty."); showInvalidMessage(txtCode, message); } return false; @@ -1225,9 +1223,7 @@ public class WorkReportCRUDController extends GenericForwardComposer implements removeWorkReportLine(workReportLine); } } catch (InterruptedException e) { - messagesForUser.showMessage( - Level.ERROR, e.getMessage()); - LOG.error(_("Error on showing removing element: ", workReportLine.getId()), e); + throw new RuntimeException(e); } } @@ -1504,7 +1500,7 @@ public class WorkReportCRUDController extends GenericForwardComposer implements && (finishDate.compareTo(filterStartDate.getValue()) < 0)) { filterFinishDate.setValue(null); throw new WrongValueException(comp, - _("must be greater than start date")); + _("must be later than start date")); } } }; @@ -1521,7 +1517,7 @@ public class WorkReportCRUDController extends GenericForwardComposer implements && (startDate.compareTo(filterFinishDate.getValue()) > 0)) { filterStartDate.setValue(null); throw new WrongValueException(comp, - _("must be lower than finish date")); + _("must be before finish date")); } } }; diff --git a/libreplan-webapp/src/main/java/org/libreplan/web/workreports/WorkReportQueryController.java b/libreplan-webapp/src/main/java/org/libreplan/web/workreports/WorkReportQueryController.java index 04d7bffa5..7ac06a504 100644 --- a/libreplan-webapp/src/main/java/org/libreplan/web/workreports/WorkReportQueryController.java +++ b/libreplan-webapp/src/main/java/org/libreplan/web/workreports/WorkReportQueryController.java @@ -135,7 +135,7 @@ public class WorkReportQueryController extends GenericForwardComposer { .getValue()) < 0)) { filterFinishDateLine.setValue(null); throw new WrongValueException(comp, - _("must be greater than start date")); + _("must be after start date")); } } }; @@ -339,7 +339,7 @@ public class WorkReportQueryController extends GenericForwardComposer { .goToCreateOrEditForm(line.getLocalDate()); } else { messagesForUser.showMessage(Level.WARNING, - _("You do not have permissions to edit this work report")); + _("You do not have permissions to edit this timesheet")); } } diff --git a/libreplan-webapp/src/main/java/org/libreplan/web/workreports/WorkReportTypeCRUDController.java b/libreplan-webapp/src/main/java/org/libreplan/web/workreports/WorkReportTypeCRUDController.java index d54d4cd4d..9e7632f4f 100644 --- a/libreplan-webapp/src/main/java/org/libreplan/web/workreports/WorkReportTypeCRUDController.java +++ b/libreplan-webapp/src/main/java/org/libreplan/web/workreports/WorkReportTypeCRUDController.java @@ -654,7 +654,7 @@ public class WorkReportTypeCRUDController extends BaseCRUDController @@ -55,7 +55,7 @@ + constraint="no empty:${i18n:_('cannot be empty')}" /> - diff --git a/libreplan-webapp/src/main/webapp/costcategories/_editCostCategory.zul b/libreplan-webapp/src/main/webapp/costcategories/_editCostCategory.zul index b27014be8..9e0dd9855 100644 --- a/libreplan-webapp/src/main/webapp/costcategories/_editCostCategory.zul +++ b/libreplan-webapp/src/main/webapp/costcategories/_editCostCategory.zul @@ -41,7 +41,7 @@ + constraint = "no empty:${i18n:_('cannot be empty')}"/> @@ -51,7 +51,7 @@