Horribly belated answer, but to detail the point I was trying to get across in my comment.
Having language files for this which specify the structure of the phrase, as well as another one for the days of the week.
For example, you could have your phrasing files like:
phrasing.properties:
phrasing.dayrange=%1$s to %2$s
phrasing_en_US.properties:
phrasing.dayrange=%1$s through %2$s
phrasing_fr_FR.properties:
phrasing.dayrange=du %1$s au %2$s
Note there is no requirement for spaces before/after the %n$s points. String.format
(which will eventually be used, see below) has no such restriction.
And then have your day-name files as:
daynames.properties:
dayname.monday=Monday
dayname.tuesday=Tuesday
...
daynames_fr_FR.properties:
dayname.monday=Lundi
dayname.tuesday=Mardi
And then in your code you do something like:
/**
* Expects {@code fromDay} and {@code toDay} to be
* {@code Strings} in the format {@literal "monday"},
* {@literal "tuesday"}, etc. <emph>in English</emph>.
*/
public String formTheString(final String fromDay,
final String toDay) {
final ResourceBundle phrasingBundle = ResourceBundle.get("phrasing");
// Get the phrasing format: '%1$s ...' style
final String phrasing = phrasingBundle.getString("dayrange");
final ResourceBundle dayNameBundle = ResourceBundle.get("daynames");
// Get the translated day names
final String localisedFromDay = dayNameBundle.getString(fromDay);
final String localisedToDay = dayNameBundle.getString(toDay);
// Use the 'phrasing' as a format, passing in
// the translated day names as the parameters
// to it.
return String.format(phrasing, localisedFromDay, localisedToDay);
}
Alternatively to the 'dayname' files, you can do what the other answer here suggested.