Fix bug 482460 - Recurrence summary in Edit Event dialog can't be correctly translated when local languages have grammatical genders for weekdays, months, ordinal numbers...r=philipp

This commit is contained in:
Decathlon 2009-04-28 12:49:24 +02:00
Родитель bdef76f345
Коммит f6f689d956
2 изменённых файлов: 162 добавлений и 61 удалений

Просмотреть файл

@ -82,6 +82,12 @@ function recurrenceRule2String(recurrenceInfo, startDate, endDate, allDay) {
let dow = day_of_week(day);
return (Math.abs(day) - dow) / 8 * (day < 0 ? -1 : 1);
}
function nounClass(aDayString, aRuleString) {
// Select noun class (grammatical gender) for rule string
let nounClass = getRString(aDayString + "Nounclass");
return aRuleString + nounClass.substr(0, 1).toUpperCase() +
nounClass.substr(1);
}
let ruleString;
if (rule.type == 'DAILY') {
@ -110,12 +116,14 @@ function recurrenceRule2String(recurrenceInfo, startDate, endDate, allDay) {
// weekly recurrence, currently we
// support a single 'BYDAY'-rule only.
if (checkRecurrenceRule(rule, ['BYDAY'])) {
// create a string like 'Monday, Tuesday and
// Wednesday'
// create a string like 'Monday, Tuesday and Wednesday'
let days = rule.getComponent("BYDAY", {});
var weekdays = "";
let weekdays = "";
// select noun class (grammatical gender) according to the
// first day of the list
let weeklyString = nounClass("repeatDetailsDay" + days[0], "weeklyNthOn");
for (let i = 0; i < days.length; i++) {
weekdays += getRString("repeatDetailsDay" + days[i])
weekdays += getRString("repeatDetailsDay" + days[i]);
if (days.length > 1 && i == (days.length - 2)) {
weekdays += ' ' + getRString("repeatDetailsAnd") + ' ';
} else if (i < days.length - 1) {
@ -123,7 +131,7 @@ function recurrenceRule2String(recurrenceInfo, startDate, endDate, allDay) {
}
}
let weeklyString = getRString("weeklyNthOn", [weekdays]);
weeklyString = getRString(weeklyString, [weekdays]);
ruleString= PluralForm.get(rule.interval, weeklyString)
.replace("#2", rule.interval);
@ -137,16 +145,24 @@ function recurrenceRule2String(recurrenceInfo, startDate, endDate, allDay) {
let byday = rule.getComponent("BYDAY", {});
if (day_position(byday[0]) == 0) {
// i.e every MONDAY of every N months
let day = getRString("repeatDetailsDay" + day_of_week(byday[0]));
ruleString = getRString("monthlyEveryOfEvery", [day]);
ruleString = PluralForm.get(rule.interval, ruleString)
let monthlyString = "monthlyEveryOfEvery";
let dayString = "repeatDetailsDay" + day_of_week(byday[0]);
let day = getRString(dayString);
monthlyString = nounClass(dayString, monthlyString);
monthlyString = getRString(monthlyString, [day]);
ruleString = PluralForm.get(rule.interval, monthlyString)
.replace("#2", rule.interval);
} else {
// i.e the FIRST MONDAY of every N months
let ordinal = getRString("repeatDetailsOrdinal" + day_position(byday[0]));
let day = getRString("repeatDetailsDay" + day_of_week(byday[0]));
ruleString = getRString("monthlyNthOfEvery", [ordinal, day]);
ruleString = PluralForm.get(rule.interval, ruleString)
let monthlyString = "monthlyNthOfEvery";
let ordinalString = "repeatOrdinal" + day_position(byday[0]);
let dayString = "repeatDetailsDay" + day_of_week(byday[0]);
monthlyString = nounClass(dayString, monthlyString);
ordinalString = nounClass(dayString, ordinalString);
let day = getRString(dayString);
let ordinal = getRString(ordinalString);
monthlyString = getRString(monthlyString, [ordinal, day]);
ruleString = PluralForm.get(rule.interval, monthlyString)
.replace("#3", rule.interval);
}
} else if (checkRecurrenceRule(rule, ['BYMONTHDAY'])) {
@ -207,21 +223,22 @@ function recurrenceRule2String(recurrenceInfo, startDate, endDate, allDay) {
byday = rule.getComponent("BYDAY", {});
if (bymonth.length == 1 && byday.length == 1) {
let dayString = getRString("repeatDetailsDay" + day_of_week(byday[0]));
let monthString = getRString("repeatDetailsMonth" + bymonth[0]);
let dayString = "repeatDetailsDay" + day_of_week(byday[0]);
let day = getRString(dayString);
let month = getRString("repeatDetailsMonth" + bymonth[0]);
if (day_position(byday[0]) == 0) {
let yearlyString = getRString("yearlyOnEveryNthOfNth",
[dayString, monthString]);
let yearlyString = "yearlyOnEveryNthOfNth";
yearlyString = nounClass(dayString, yearlyString);
yearlyString = getRString(yearlyString, [day, month]);
ruleString = PluralForm.get(rule.interval, yearlyString)
.replace("#3", rule.interval);
} else {
let ordinalString = getRString("repeatDetailsOrdinal" +
day_position(byday[0]));
let yearlyString = getRString("yearlyNthOnNthOf",
[ordinalString,
dayString,
monthString]);
let yearlyString = "yearlyNthOnNthOf";
let ordinalString = "repeatOrdinal" + day_position(byday[0])
yearlyString = nounClass(dayString, yearlyString);
ordinalString = nounClass(dayString, ordinalString);
let ordinal = getRString(ordinalString);
yearlyString = getRString(yearlyString, [ordinal, day, month]);
ruleString = PluralForm.get(rule.interval, yearlyString)
.replace("#4", rule.interval);
}

Просмотреть файл

@ -44,47 +44,96 @@
dailyEveryNth=every day;every #1 days
repeatDetailsRuleDaily4=every weekday
# LOCALIZATION NOTE (weeklyNthOn)
# LOCALIZATION NOTE (weeklyNthOnNounclass...)
# Edit recurrence window -> Recurrence pattern -> Weekly repeat rules
# Translate these strings according to noun class/gender of weekday (%1$S)
# set in 'repeadDetailsDay...Nounclass' strings.
# Nounclass1 <-> Masculine gender; Nounclass2 <-> Feminine gender.
# Add others strings with suffix 3, 4,... for others noun classes if your
# language need them. In this case, corresponding strings must be added for
# others rule strings with 'Nounclass...' suffix and corresponding values
# "nounclass..." must be written in 'repeatDetailsDayxNounclass' strings.
# %1$S - weekday (one or more)
# #2 - week interval
# e.g. "every 3 weeks on Tuesday, Wednesday and Thursday
weeklyNthOn=every %1$S;every #2 weeks on %1$S
weeklyNthOnNounclass1=every %1$S;every #2 weeks on %1$S
weeklyNthOnNounclass2=every %1$S;every #2 weeks on %1$S
# LOCALIZATION NOTE (weeklyNthOn)
# LOCALIZATION NOTE (weeklyEveryNth):
# Edit recurrence window -> Recurrence pattern -> Weekly repeat rules
# #1 - interval
# e.g. "every 5 weeks"
weeklyEveryNth=every week;every #1 weeks
# LOCALIZATION NOTE ('repeatDetailsDay...' and 'repeatDetailsDay...Nounclass'):
# Week days names and week days noun classes (feminine/masculine grammatical
# gender) for languages that need different localization when weekdays nouns
# have different noun classes (genders).
# For every weekday, in 'repeatDetailsDay...Nounclass' strings write:
# "nounclass1" for languages with grammatical genders -> MASCULINE gender;
# for languages with noun classes -> a noun class;
# for languages without noun classes or grammatical gender.
#
# "nounclass2" for languages with grammatical genders -> FEMININE gender;
# for languages with noun classes -> a different noun class.
#
# "nounclass3", "nounclass4" and so on for languages that need more than two
# noun classes for weekdays. In this case add corresponding
# rule string with "Nounclass..." suffix and ordinal string
# "repeatOrdinalxNounclass..."
# Will be used rule strings with "Nounclass..." suffix corresponding to the
# following strings if there is a weekday in the rule string.
repeatDetailsDay1=Sunday
repeatDetailsDay1Nounclass=nounclass1
repeatDetailsDay2=Monday
repeatDetailsDay2Nounclass=nounclass1
repeatDetailsDay3=Tuesday
repeatDetailsDay3Nounclass=nounclass1
repeatDetailsDay4=Wednesday
repeatDetailsDay4Nounclass=nounclass1
repeatDetailsDay5=Thursday
repeatDetailsDay5Nounclass=nounclass1
repeatDetailsDay6=Friday
repeatDetailsDay6Nounclass=nounclass1
repeatDetailsDay7=Saturday
repeatDetailsDay7Nounclass=nounclass1
# LOCALIZATION NOTE (repeatDetailsAnd)
# Used to show a number of weekdays in a list
# i.e. "Sunday, Monday, Tuesday " + and + " Wednesday"
repeatDetailsAnd=and
# LOCALIZATION NOTE (monthlyNthOfEvery):
# LOCALIZATION NOTE (monthlyNthOfEveryNounclass...):
# Edit recurrence window -> Recurrence pattern -> Monthly repeat rules
# %1$S - ordinal
# Translate these strings according to noun class/gender of weekday (%2$S)
# set in 'repeadDetailsDay...Nounclass' strings.
# Nounclass1 <-> Masculine gender; Nounclass2 <-> Feminine gender.
# Add others strings with suffix 3, 4,... for others noun classes if your
# language need them. In this case, corresponding strings must be added for
# others rule strings with 'Nounclass...' suffix and corresponding values
# "nounclass..." must be written in 'repeatDetailsDayxNounclass' strings.
# %1$S - ordinal with article and noun class/gender corresponding to weekday
# %2$S - weekday
# #3 - interval
# i.e. "the FIRST MONDAY of every 3 months"
monthlyNthOfEvery=the %1$S %2$S of every month;the %1$S %2$S of every #3 months
monthlyNthOfEveryNounclass1=%1$S %2$S of every month;%1$S %2$S of every #3 months
monthlyNthOfEveryNounclass2=%1$S %2$S of every month;%1$S %2$S of every #3 months
# LOCALIZATION NOTE (monthlyEveryOfEvery):
# LOCALIZATION NOTE (monthlyEveryOfEveryNounclass...):
# Edit recurrence window -> Recurrence pattern -> Monthly repeat rules
# Translate these strings according to noun class/gender of weekday (%1$S)
# set in 'repeadDetailsDay...Nounclass' strings.
# Nounclass1 <-> Masculine gender; Nounclass2 <-> Feminine gender.
# Add others strings with suffix 3, 4,... for others noun classes if your
# language need them. In this case, corresponding strings must be added for
# others rule strings with 'Nounclass...' suffix and corresponding values
# "nounclass..." must be written in 'repeatDetailsDayxNounclass' strings.
# %1$S - weekday
# #2 - interval
# i.e. "every MONDAY of every 3 months"
# more specific: every monday of January, April, July, October
monthlyEveryOfEvery=every %1$S of every month;every %1$S of every #2 months
monthlyEveryOfEveryNounclass1=every %1$S of every month;every %1$S of every #2 months
monthlyEveryOfEveryNounclass2=every %1$S of every month;every %1$S of every #2 months
# LOCALIZATION NOTE (monthlyDayOfNth):
# Edit recurrence window -> Recurrence pattern -> Monthly repeat rules
@ -100,12 +149,28 @@ monthlyDayOfNth=day %1$S of every month;day %1$S of every #2 months
# e.g. "the last day of every 3 months"
monthlyLastDayOfNth=the last day of the month; the last day of every #1 months
repeatDetailsOrdinal1=first
repeatDetailsOrdinal2=second
repeatDetailsOrdinal3=third
repeatDetailsOrdinal4=fourth
repeatDetailsOrdinal5=fifth
repeatDetailsOrdinal-1=last
# LOCALIZATION NOTE (repeatOrdinal...Nounclass...):
# Ordinal numbers nouns for every noun class (grammatical genders) of weekdays
# considered in 'repeatDetailsDayxNounclass' strings. For languages that need
# localization according to genders or noun classes.
# Nounclass1 <-> Masculine gender; Nounclass2 <-> Feminine gender.
# Add 'repeatOrdinal...Nounclass' strings with suffix 3, 4 and so on for
# languages with more than two noun classes for weekdays. In this case
# must be added corresponding rule strings with 'Nounclass...' suffix and
# corresponding values "nounclass..." must be written in
# 'repeatDetailsDayxNounclass' strings.
repeatOrdinal1Nounclass1=the first
repeatOrdinal2Nounclass1=the second
repeatOrdinal3Nounclass1=the third
repeatOrdinal4Nounclass1=the fourth
repeatOrdinal5Nounclass1=the fifth
repeatOrdinal-1Nounclass1=the last
repeatOrdinal1Nounclass2=the first
repeatOrdinal2Nounclass2=the second
repeatOrdinal3Nounclass2=the third
repeatOrdinal4Nounclass2=the fourth
repeatOrdinal5Nounclass2=the fifth
repeatOrdinal-1Nounclass2=the last
# LOCALIZATION NOTE (yearlyNthOn):
# Edit recurrence window -> Recurrence pattern -> Yearly repeat rules
@ -115,24 +180,40 @@ repeatDetailsOrdinal-1=last
# e.g. "every 3 years on December 14"
yearlyNthOn=every %1$S %2$S;every #3 years on %1$S %2$S
# LOCALIZATION NOTE (yearlyNthOnNthOf):
# LOCALIZATION NOTE (yearlyNthOnNthOfNounclass...):
# Edit recurrence window -> Recurrence pattern -> Yearly repeat rules
# %1$S - ordinal
# Translate these strings according to noun class/gender of weekday (%2$S)
# set in 'repeadDetailsDay...Nounclass' strings.
# Nounclass1 <-> Masculine gender; Nounclass2 <-> Feminine gender.
# Add others strings with suffix 3, 4,... for others noun classes if your
# language need them. In this case, corresponding strings must be added for
# others rule strings with 'Nounclass...' suffix and corresponding values
# "nounclass..." must be written in 'repeatDetailsDayxNounclass' strings.
# %1$S - ordinal with article and noun class/gender corresponding to weekday
# %2$S - weekday
# %3$S - month
# #4 - number
# #4 - yearly interval
# e.g. "the second Monday of every March"
# e.g "every 3 years the second Monday of March"
yearlyNthOnNthOf=the %1$S %2$S of every %3$S;every #4 years on the %1$S %2$S of %3$S
yearlyNthOnNthOfNounclass1=%1$S %2$S of every %3$S;every #4 years on %1$S %2$S of %3$S
yearlyNthOnNthOfNounclass2=%1$S %2$S of every %3$S;every #4 years on %1$S %2$S of %3$S
# LOCALIZATION NOTE (yearlyNthOfNth):
# LOCALIZATION NOTE (yearlyOnEveryNthOfNthNounclass1):
# Edit recurrence window -> Recurrence pattern -> Yearly repeat rules
# Translate these strings according to noun class/gender of weekday (%1$S)
# set in 'repeadDetailsDay...Nounclass' strings.
# Nounclass1 <-> Masculine gender; Nounclass2 <-> Feminine gender.
# Add others strings with suffix 3, 4,... for others noun classes if your
# language need them. In this case, corresponding strings must be added for
# others rule strings with 'Nounclass...' suffix and corresponding values
# "nounclass..." must be written in 'repeatDetailsDayxNounclass' strings.
# %1$S - weekday
# %2$S - month
# #3 - number
# #3 - yearly interval
# e.g. "every Thursday of March"
# e.g "every 3 years on every Thursday of March"
yearlyOnEveryNthOfNth=every %1$S of %2$S;every #3 years on every %1$S of %2$S
yearlyOnEveryNthOfNthNounclass1=every %1$S of %2$S;every #3 years on every %1$S of %2$S
yearlyOnEveryNthOfNthNounclass2=every %1$S of %2$S;every #3 years on every %1$S of %2$S
repeatDetailsMonth1=January
repeatDetailsMonth2=February
@ -149,12 +230,12 @@ repeatDetailsMonth12=December
# LOCALIZATION NOTE (repeatCount):
# Edit recurrence window -> Recurrence details link on Event/Task dialog window
# %1%$ - repeatDetailsRule...(see above). This is the first line of the link
# %1%$ - A rule string (see above). This is the first line of the link
# %2%$ - event start date (e.g. mm/gg/yyyy)
# %3$S - event start time (e.g. hh:mm (PM/AM))
# %4$S - event end time (e.g. hh:mm (PM/AM))
# #5 - event occurence times: number
# e.g. with repeatDetailsRuleMonthly3:
# e.g. with monthlyNthOfEvery:
# "Occurs the first Sunday of every 3 month
# only on 1/1/2009"
# from 5:00 PM to 6:00 PM"
@ -165,10 +246,10 @@ repeatCount=Occurs %1$S\neffective %2$S for #5 time\nfrom %3$S to %4$S.;Occurs %
# LOCALIZATION NOTE (repeatCountAllDay):
# Edit recurrence window -> Recurrence details link on Event/Task dialog window
# %1%$ - repeatDetailsRule...(see above). This is the first line of the link
# %1%$ - A rule string (see above). This is the first line of the link
# %2%$ - event start date (e.g. mm/gg/yyyy)
# #3 - event occurence times: number
# e.g. with repeatDetailsRuleMonthly3:
# e.g. with monthlyNthOfEvery:
# "Occurs the first Sunday of every 3 month
# only on 1/1/2009"
# "Occurs the first Sunday of every 3 month
@ -177,41 +258,44 @@ repeatCountAllDay=Occurs %1$S\neffective %2$S for #3 time.;Occurs %1$S\neffectiv
# LOCALIZATION NOTE (repeatDetailsUntil):
# Edit recurrence window -> Recurrence details link on Event/Task dialog window
# %1%$ - repeatDetailsRule...(see above). This is the first line of the link
# %1%$ - A rule string (see above). This is the first line of the link
# %2%$ - event start date (e.g. mm/gg/yyyy)
# %3$S - event end date (e.g. mm/gg/yyyy)
# %4$S - event start time (e.g. hh:mm (PM/AM))
# %5$S - event end time (e.g. hh:mm (PM/AM))
# e.g. with repeatDetailsRuleWeekly2:
# "Occurs every other week on Sunday and Friday
# e.g. with weeklyNthOn:
# "Occurs every 2 weeks on Sunday and Friday
# effective 1/1/2009 until 1/1/2010
# from 5:00 PM to 6:00 PM"
repeatDetailsUntil=Occurs %1$S\neffective %2$S until %3$S\nfrom %4$S to %5$S.
# LOCALIZATION NOTE (repeatDetailsUntilAllDay):
# Edit recurrence window -> Recurrence details link on Event/Task dialog window
# %1%$ - repeatDetailsRule...(see above). This is the first line of the link
# %1%$ - A rule string (see above). This is the first line of the link
# %2%$ - event start date (e.g. mm/gg/yyyy)
# %3$S - event end date (e.g. mm/gg/yyyy)
# e.g. with repeatDetailsRuleMonthly6 and all day event:
# e.g. with monthlyDayOfNth and all day event:
# "Occurs day 3 of every 5 month
# effective 1/1/2009 until 1/1/2010"
repeatDetailsUntilAllDay=Occurs %1$S\neffective %2$S until %3$S.
# LOCALIZATION NOTE (repeatDetailsInfinite):
# Edit recurrence window -> Recurrence details link on Event/Task dialog window
# %1%$ - repeatDetailsRule...(see above). This is the first line of the link
# %1%$ - A rule string (see above). This is the first line of the link
# %2%$ - event start date (e.g. mm/gg/yyyy)
# %3$S - event start time (e.g. hh:mm (PM/AM))
# %4$S - event end time (e.g. hh:mm (PM/AM))
# e.g. with repeatDetailsRuleMonthly6:
# e.g. with monthlyDayOfNth:
# "Occurs day 3 of every 5 month
# effective 1/1/2009
# from 5:00 PM to 6:00 PM"
repeatDetailsInfinite=Occurs %1$S\neffective %2$S\nfrom %3$S to %4$S.
# LOCALIZATION NOTE (repeatDetailsInfiniteAllDay):
# Edit recurrence window -> Recurrence details link on Event/Task dialog window
# %1%$ - repeatDetailsRule...(see above). This is the first line of the link
# %1%$ - A rule string (see above). This is the first line of the link
# %2%$ - event start date (e.g. mm/gg/yyyy)
# e.g. with repeatDetailsRuleMonthly6 and all day event:
# e.g. with monthlyDayOfNth and all day event:
# "Occurs day 3 of every 5 month
# effective 1/1/2009"
repeatDetailsInfiniteAllDay=Occurs %1$S\neffective %2$S.
@ -240,8 +324,8 @@ removeCalendarsText=Do you really want to remove %1$S attachments?
# Recurrence Dialog Widget Order
# LOCALIZATION NOTE: You can change the order of below params
# Edit recurrence window -> Recurrence pattern -> Repeat monthly
# %1$S - ordinal, %2$S - weekday
# e.g. "First Saturday"
# %1$S - ordinal with article, %2$S - weekday
# e.g. "the First Saturday"
monthlyOrder=%1$S %2$S
# Edit recurrence window -> Recurrence pattern -> Repeat yearly
@ -251,7 +335,7 @@ monthlyOrder=%1$S %2$S
yearlyOrder=%1$S %3$S %2$S
# Edit recurrence window -> Recurrence pattern -> Repeat yearly
# %1$S - ordinal, %2$S - weekday, %3$S - of, %4$S - month
# e.g. "First Saturday of September"
# %1$S - ordinal with article, %2$S - weekday, %3$S - of, %4$S - month
# e.g. "the First Saturday of September"
# If you don't need %3$S in your locale - please put this on the third place.
yearlyOrder2=%1$S %2$S %3$S %4$S