Skip to content

Commit

Permalink
Update translations app param
Browse files Browse the repository at this point in the history
  • Loading branch information
sunkup authored and raimund-schluessler committed Jan 10, 2024
1 parent 7c2bfed commit 2015ad4
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 25 deletions.
4 changes: 2 additions & 2 deletions src/components/AppSidebar/RepeatItem.vue
Original file line number Diff line number Diff line change
Expand Up @@ -101,9 +101,9 @@ export default {
*/
toggleTitle() {
if (this.showOptions) {
return this.t('calendar', 'Save')
return this.t('tasks', 'Save')
}
return this.t('calendar', 'Edit')
return this.t('tasks', 'Edit')
},
},
methods: {
Expand Down
46 changes: 23 additions & 23 deletions src/filters/recurrenceRuleFormat.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,44 +30,44 @@ import moment from '@nextcloud/moment'
*/
export default (recurrenceRule) => {
if (recurrenceRule.frequency === 'NONE') {
return t('calendar', 'Does not repeat')
return t('tasks', 'Does not repeat')
}

let freqPart = ''
if (recurrenceRule.interval === 1) {
switch (recurrenceRule.frequency) {
case 'DAILY':
freqPart = t('calendar', 'Daily')
freqPart = t('tasks', 'Daily')
break

case 'WEEKLY':
freqPart = t('calendar', 'Weekly')
freqPart = t('tasks', 'Weekly')
break

case 'MONTHLY':
freqPart = t('calendar', 'Monthly')
freqPart = t('tasks', 'Monthly')
break

case 'YEARLY':
freqPart = t('calendar', 'Yearly')
freqPart = t('tasks', 'Yearly')
break
}
} else {
switch (recurrenceRule.frequency) {
case 'DAILY':
freqPart = n('calendar', 'Every %n day', 'Every %n days', recurrenceRule.interval)
freqPart = n('tasks', 'Every %n day', 'Every %n days', recurrenceRule.interval)
break

case 'WEEKLY':
freqPart = n('calendar', 'Every %n week', 'Every %n weeks', recurrenceRule.interval)
freqPart = n('tasks', 'Every %n week', 'Every %n weeks', recurrenceRule.interval)
break

case 'MONTHLY':
freqPart = n('calendar', 'Every %n month', 'Every %n months', recurrenceRule.interval)
freqPart = n('tasks', 'Every %n month', 'Every %n months', recurrenceRule.interval)
break

case 'YEARLY':
freqPart = n('calendar', 'Every %n year', 'Every %n years', recurrenceRule.interval)
freqPart = n('tasks', 'Every %n year', 'Every %n years', recurrenceRule.interval)
break
}
}
Expand All @@ -76,22 +76,22 @@ export default (recurrenceRule) => {
if (recurrenceRule.frequency === 'WEEKLY' && recurrenceRule.byDay.length !== 0) {
const formattedDays = getTranslatedByDaySet(recurrenceRule.byDay)

limitPart = n('calendar', 'on {weekday}', 'on {weekdays}', recurrenceRule.byDay.length, {
limitPart = n('tasks', 'on {weekday}', 'on {weekdays}', recurrenceRule.byDay.length, {
weekday: formattedDays,
weekdays: formattedDays,
})
} else if (recurrenceRule.frequency === 'MONTHLY') {
if (recurrenceRule.byMonthDay.length !== 0) {
const dayOfMonthList = recurrenceRule.byMonthDay.join(', ')

limitPart = n('calendar', 'on day {dayOfMonthList}', 'on days {dayOfMonthList}', recurrenceRule.byMonthDay.length, {
limitPart = n('tasks', 'on day {dayOfMonthList}', 'on days {dayOfMonthList}', recurrenceRule.byMonthDay.length, {
dayOfMonthList,
})
} else {
const ordinalNumber = getTranslatedOrdinalNumber(recurrenceRule.bySetPosition)
const byDaySet = getTranslatedByDaySet(recurrenceRule.byDay)

limitPart = t('calendar', 'on the {ordinalNumber} {byDaySet}', {
limitPart = t('tasks', 'on the {ordinalNumber} {byDaySet}', {
ordinalNumber,
byDaySet,
})
Expand All @@ -100,14 +100,14 @@ export default (recurrenceRule) => {
const monthNames = getTranslatedMonths(recurrenceRule.byMonth)

if (recurrenceRule.byDay.length === 0) {
limitPart = t('calendar', 'in {monthNames}', {
limitPart = t('tasks', 'in {monthNames}', {
monthNames,
})
} else {
const ordinalNumber = getTranslatedOrdinalNumber(recurrenceRule.bySetPosition)
const byDaySet = getTranslatedByDaySet(recurrenceRule.byDay)

limitPart = t('calendar', 'in {monthNames} on the {ordinalNumber} {byDaySet}', {
limitPart = t('tasks', 'in {monthNames} on the {ordinalNumber} {byDaySet}', {
monthNames,
ordinalNumber,
byDaySet,
Expand All @@ -119,11 +119,11 @@ export default (recurrenceRule) => {
if (recurrenceRule.until !== null) {
const untilDate = moment(recurrenceRule.until).format('L')

endPart = t('calendar', 'until {untilDate}', {
endPart = t('tasks', 'until {untilDate}', {
untilDate,
})
} else if (recurrenceRule.count !== null) {
endPart = n('calendar', '%n time', '%n times', recurrenceRule.count)
endPart = n('tasks', '%n time', '%n times', recurrenceRule.count)
}

return [
Expand Down Expand Up @@ -204,25 +204,25 @@ function getTranslatedMonths(byMonthList) {
function getTranslatedOrdinalNumber(bySetPositionNum) {
switch (bySetPositionNum) {
case 1:
return t('calendar', 'first')
return t('tasks', 'first')

case 2:
return t('calendar', 'second')
return t('tasks', 'second')

case 3:
return t('calendar', 'third')
return t('tasks', 'third')

case 4:
return t('calendar', 'fourth')
return t('tasks', 'fourth')

case 5:
return t('calendar', 'fifth')
return t('tasks', 'fifth')

case -2:
return t('calendar', 'second to last')
return t('tasks', 'second to last')

case -1:
return t('calendar', 'last')
return t('tasks', 'last')

default:
return ''
Expand Down

0 comments on commit 2015ad4

Please sign in to comment.