Skip to content

Commit 6ef01c0

Browse files
committed
Use two resource strings to describe day or days before the last day of the month.
1 parent 64cfd63 commit 6ef01c0

18 files changed

Lines changed: 39 additions & 22 deletions

src/main/java/com/cronutils/descriptor/DescriptionStrategyFactory.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
package com.cronutils.descriptor;
1515

1616
import com.cronutils.model.field.expression.Every;
17+
import java.text.MessageFormat;
1718
import java.time.DayOfWeek;
1819
import java.time.Month;
1920
import java.time.format.TextStyle;
@@ -84,11 +85,10 @@ public static DescriptionStrategy daysOfMonthInstance(final ResourceBundle bundl
8485
.format("%s %s %s ", bundle.getString("the_nearest_weekday_to_the"), on.getTime().getValue(), bundle.getString("of_the_month"));
8586
case L:
8687
Integer daysBefore = on.getNth().getValue();
87-
if (daysBefore > 0) {
88-
String daysRep =
89-
daysBefore == 1 ? bundle.getString("day") : bundle.getString("days");
90-
return String.format("%d %s %s", daysBefore, daysRep,
91-
bundle.getString("before_last_day_of_month"));
88+
if (daysBefore > 1) {
89+
return MessageFormat.format(bundle.getString("days_before_last_day_of_month"), daysBefore);
90+
} else if (daysBefore == 1){
91+
return bundle.getString("day_before_last_day_of_month");
9292
} else {
9393
return bundle.getString("last_day_of_month");
9494
}

src/main/resources/CronUtilsI18N.properties

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,8 @@ last=last
2121
the_nearest_weekday_to_the=the nearest weekday to the
2222
last_day_of_month=last day of month
2323
last_weekday_of_month=last weekday of month
24-
before_last_day_of_month=before the last day of the month
24+
day_before_last_day_of_month=one day before the last day of the month
25+
days_before_last_day_of_month={0} days before the last day of the month
2526

2627
pattern_every_seconds = {0} {1}
2728
every_one=every

src/main/resources/CronUtilsI18N_de.properties

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,8 @@ last=letzten
2121
the_nearest_weekday_to_the=am n\ufffdchsten Werktag nach dem
2222
last_day_of_month=letzten Tag des Monats
2323
last_weekday_of_month=letzten Werktag des Monats
24-
before_last_day_of_month=vor dem letzten Tag des Monats
24+
day_before_last_day_of_month=einen Tag vor dem letzten Tag des Monats
25+
days_before_last_day_of_month={0} Tage vor dem letzten Tag des Monats
2526

2627
pattern_every_seconds = {0} {1}
2728
every_one=jede

src/main/resources/CronUtilsI18N_el.properties

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,4 +21,5 @@ last=\u03C4\u03B5\u03BB\u03B1\u03C5\u03C4\u03B1\u03AF\u03BF
2121
the_nearest_weekday_to_the=\u03B7 \u03BA\u03BF\u03BD\u03C4\u03B9\u03BD\u03CC\u03C4\u03B5\u03C1\u03B7 \u03B5\u03C1\u03B3\u03AC\u03C3\u03B9\u03BC\u03B7 \u03C3\u03C4\u03BF
2222
last_day_of_month=\u03C4\u03B5\u03BB\u03B5\u03C5\u03C4\u03B1\u03AF\u03B1 \u03BC\u03AD\u03C1\u03B1 \u03C4\u03BF\u03C5 \u03BC\u03AE\u03BD\u03B1
2323
last_weekday_of_month=\u03C4\u03B5\u03BB\u03B5\u03C5\u03C4\u03B1\u03AF\u03B1 \u03B5\u03C1\u03B3\u03AC\u03C3\u03B9\u03BC\u03B7 \u03C4\u03BF\u03C5 \u03BC\u03AE\u03BD\u03B1
24-
before_last_day_of_month=\u03C0\u03C1\u03B9\u03BD \u03B1\u03C0\u03CC \u03C4\u03B7\u03BD \u03C4\u03B5\u03BB\u03B5\u03C5\u03C4\u03B1\u03AF\u03B1 \u03B7\u03BC\u03AD\u03C1\u03B1 \u03C4\u03BF\u03C5 \u03BC\u03AE\u03BD\u03B1
24+
day_before_last_day_of_month=\u03BC\u03AF\u03B1 \u03B7\u03BC\u03AD\u03C1\u03B1 \u03C0\u03C1\u03B9\u03BD \u03B1\u03C0\u03CC \u03C4\u03B7\u03BD \u03C4\u03B5\u03BB\u03B5\u03C5\u03C4\u03B1\u03AF\u03B1 \u03B7\u03BC\u03AD\u03C1\u03B1 \u03C4\u03BF\u03C5 \u03BC\u03AE\u03BD\u03B1
25+
days_before_last_day_of_month={0} \u03B7\u03BC\u03AD\u03C1\u03B5\u03C2 \u03C0\u03C1\u03B9\u03BD \u03B1\u03C0\u03CC \u03C4\u03B7\u03BD \u03C4\u03B5\u03BB\u03B5\u03C5\u03C4\u03B1\u03AF\u03B1 \u03B7\u03BC\u03AD\u03C1\u03B1 \u03C4\u03BF\u03C5 \u03BC\u03AE\u03BD\u03B1

src/main/resources/CronUtilsI18N_en.properties

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,4 +22,5 @@ last=last
2222
the_nearest_weekday_to_the=the nearest weekday to the
2323
last_day_of_month=last day of month
2424
last_weekday_of_month=last weekday of month
25-
before_last_day_of_month=before the last day of the month
25+
day_before_last_day_of_month=one day before the last day of the month
26+
days_before_last_day_of_month={0} days before the last day of the month

src/main/resources/CronUtilsI18N_es.properties

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,4 +21,5 @@ last=ultimo
2121
the_nearest_weekday_to_the=dia de semana mas cercano a
2222
last_day_of_month=ultimo dia del mes
2323
last_weekday_of_month=ultimo dia de semana del mes
24-
before_last_day_of_month=antes del \u00FAltimo d\u00EDa del mes
24+
day_before_last_day_of_month=un día antes del último día del mes
25+
days_before_last_day_of_month={0} días antes del último día del mes

src/main/resources/CronUtilsI18N_fr.properties

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,4 +21,5 @@ days=jours
2121
months=les mois
2222
years=les ann\u00e9es
2323
last_weekday_of_month=derni\u00e8re semaine du mois
24-
before_last_day_of_month=avant le dernier jour du mois
24+
day_before_last_day_of_month=un jour avant le dernier jour du mois
25+
days_before_last_day_of_month={0} jours avant le dernier jour du mois

src/main/resources/CronUtilsI18N_id.properties

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,4 +21,5 @@ last=terakhir
2121
the_nearest_weekday_to_the=hari kerja terdekat ke
2222
last_day_of_month=hari terakhir di bulan
2323
last_weekday_of_month=hari kerja terakhir di bulan
24-
before_last_day_of_month=sebelum hari terakhir setiap bulan
24+
day_before_last_day_of_month=satu hari sebelum hari terakhir bulan itu
25+
days_before_last_day_of_month={0} hari sebelum hari terakhir setiap bulan

src/main/resources/CronUtilsI18N_it.properties

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,4 +21,5 @@ last=ultimo
2121
the_nearest_weekday_to_the=il giorno della settimana più vicino a
2222
last_day_of_month=ultimo giorno del mese
2323
last_weekday_of_month=ultimo giorno della settimana nel mese
24-
before_last_day_of_month=prima dell'ultimo giorno del mese
24+
day_before_last_day_of_month=un giorno prima dell'ultimo giorno del mese
25+
days_before_last_day_of_month={0} giorni prima dell'ultimo giorno del mese

src/main/resources/CronUtilsI18N_ko.properties

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,4 +21,5 @@ last=\uB9C8\uC9C0\uB9C9
2121
the_nearest_weekday_to_the=\uAC00\uC7A5 \uAC00\uAE4C\uC6B4 \uD3C9\uC77C
2222
last_day_of_month=\uB9D0\uC77C
2323
last_weekday_of_month=\uB9C8\uC9C0\uB9C9 \uC8FC
24-
before_last_day_of_month=\uB9E4\uC6D4 \uB9D0\uC77C \uC774\uC804
24+
day_before_last_day_of_month=\uB9E4\uC6D4 \uB9D0\uC77C \uD558\uB8E8 \uC804
25+
days_before_last_day_of_month=\uB9E4\uC6D4 \uB9D0\uC77C {0} \uC77C \uC804

0 commit comments

Comments
 (0)