Skip to content

Commit

Permalink
Course Timetabling: Arr Hrs
Browse files Browse the repository at this point in the history
- various pages showing timetable: localize Arr Hrs and Arr N Hrs messages
  • Loading branch information
tomas-muller committed Jun 6, 2024
1 parent 5badd6d commit 5ef810e
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3419,6 +3419,15 @@ public interface CourseMessages extends Messages {
@DefaultMessage("Arr Hrs")
String arrHrs();

@DefaultMessage("Arr {0} Hrs")
String arrHrsN(int n);

@DefaultMessage("Arrange Hours")
String arrangeHours();

@DefaultMessage("Arrange {0} Hours")
String arrangeHoursN(int n);

@DefaultMessage("Course")
String columnCourse();

Expand Down
8 changes: 4 additions & 4 deletions JavaSource/org/unitime/timetable/model/Class_.java
Original file line number Diff line number Diff line change
Expand Up @@ -679,9 +679,9 @@ private String htmlForTimePatterns(Set patterns){
DurationModel dm = getSchedulingSubpart().getInstrOfferingConfig().getDurationModel();
Integer ah = dm.getArrangedHours(getSchedulingSubpart().getMinutesPerWk(), effectiveDatePattern());
if (ah == null) {
sb.append("<span title='Arrange Hours'>Arr Hrs</span>");
sb.append("<span title='" + MSG.arrangeHours() + "'>" + MSG.arrHrs() + "</span>");
} else {
sb.append("<span title='Arrange "+ah+" Hours'>Arr "+ah+" Hrs</span>");
sb.append("<span title='" + MSG.arrangeHoursN(ah) + "'>" + MSG.arrHrsN(ah) + "</span>");
}
}
return(sb.toString());
Expand Down Expand Up @@ -1637,9 +1637,9 @@ public String buildAssignedTimeHtml(ClassAssignmentProxy proxy){
DurationModel dm = getSchedulingSubpart().getInstrOfferingConfig().getDurationModel();
Integer ah = dm.getArrangedHours(getSchedulingSubpart().getMinutesPerWk(), effectiveDatePattern());
if (ah == null) {
sb.append("Arr Hrs");
sb.append(MSG.arrHrs());
} else {
sb.append("Arr "+ah+" Hrs");
sb.append(MSG.arrHrsN(ah));
}
}
}
Expand Down
6 changes: 4 additions & 2 deletions JavaSource/org/unitime/timetable/util/PdfWorksheet.java
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
import org.hibernate.query.Query;
import org.unitime.commons.hibernate.util.HibernateUtil;
import org.unitime.localization.impl.Localization;
import org.unitime.localization.messages.CourseMessages;
import org.unitime.timetable.ApplicationProperties;
import org.unitime.timetable.defaults.ApplicationProperty;
import org.unitime.timetable.gwt.resources.GwtConstants;
Expand Down Expand Up @@ -84,6 +85,7 @@
*/
public class PdfWorksheet {
protected static GwtConstants CONSTANTS = Localization.create(GwtConstants.class);
protected static CourseMessages MSG = Localization.create(CourseMessages.class);

private boolean iUseCommitedAssignments = true;
private static int sNrChars = 133;
Expand Down Expand Up @@ -246,9 +248,9 @@ private String[] time(Class_ clazz) {
DurationModel dm = clazz.getSchedulingSubpart().getInstrOfferingConfig().getDurationModel();
Integer ah = dm.getArrangedHours(clazz.getSchedulingSubpart().getMinutesPerWk(), clazz.effectiveDatePattern());
if (ah != null)
return new String[]{"Arr "+ah+" Hrs"+dpat};
return new String[]{MSG.arrHrsN(ah)+dpat};
else
return new String[]{"Arr Hrs"+dpat};
return new String[]{MSG.arrHrs()+dpat};
}
boolean onlyOneReq = true;
TimeLocation req = null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -355,9 +355,9 @@ private CSVField csvBuildTimePatternCell(PreferenceGroup prefGroup, boolean isEd
DurationModel dm = clazz.getSchedulingSubpart().getInstrOfferingConfig().getDurationModel();
Integer ah = dm.getArrangedHours(clazz.getSchedulingSubpart().getMinutesPerWk(), clazz.effectiveDatePattern());
if (ah == null) {
addText(cell, "Arr Hrs", true);
addText(cell, MSG.arrHrs(), true);
} else {
addText(cell, "Arr "+ah+" Hrs", true);
addText(cell, MSG.arrHrsN(ah), true);
}
}
return cell;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -641,9 +641,9 @@ private PdfPCell pdfBuildTimePatternCell(PreferenceGroup prefGroup, boolean isEd
DurationModel dm = clazz.getSchedulingSubpart().getInstrOfferingConfig().getDurationModel();
Integer ah = dm.getArrangedHours(clazz.getSchedulingSubpart().getMinutesPerWk(), clazz.effectiveDatePattern());
if (ah == null) {
addText(cell, "Arr Hrs", false, false, Element.ALIGN_CENTER, color, true);
addText(cell, MSG.arrHrs(), false, false, Element.ALIGN_CENTER, color, true);
} else {
addText(cell, "Arr "+ah+" Hrs", false, false, Element.ALIGN_CENTER, color, true);
addText(cell, MSG.arrHrsN(ah), false, false, Element.ALIGN_CENTER, color, true);
}
}
return cell;
Expand Down

0 comments on commit 5ef810e

Please sign in to comment.