Skip to content

Commit 9d76c8c

Browse files
committed
fix(l10n): add context for translators (second vs. seconds)
Signed-off-by: Richard Steinmetz <[email protected]>
1 parent 7de5bde commit 9d76c8c

File tree

2 files changed

+7
-23
lines changed

2 files changed

+7
-23
lines changed

src/components/Editor/Repeat/RepeatFirstLastSelect.vue

Lines changed: 5 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717

1818
<script>
1919
import { NcSelect } from '@nextcloud/vue'
20+
import { getTranslatedOrdinalNumber } from '../../../filters/recurrenceRuleFormat.js'
2021
2122
export default {
2223
name: 'RepeatFirstLastSelect',
@@ -41,28 +42,10 @@ export default {
4142
},
4243
computed: {
4344
options() {
44-
return [{
45-
label: this.$t('calendar', 'first'),
46-
value: 1,
47-
}, {
48-
label: this.$t('calendar', 'second'),
49-
value: 2,
50-
}, {
51-
label: this.$t('calendar', 'third'),
52-
value: 3,
53-
}, {
54-
label: this.$t('calendar', 'fourth'),
55-
value: 4,
56-
}, {
57-
label: this.$t('calendar', 'fifth'),
58-
value: 5,
59-
}, {
60-
label: this.$t('calendar', 'second to last'),
61-
value: -2,
62-
}, {
63-
label: this.$t('calendar', 'last'),
64-
value: -1,
65-
}]
45+
return [1, 2, 3, 4, 5, -2, -1].map((ordinal) => ({
46+
label: getTranslatedOrdinalNumber(ordinal),
47+
value: ordinal,
48+
}))
6649
},
6750
selected() {
6851
return this.options.find(option => option.value === this.bySetPosition)

src/filters/recurrenceRuleFormat.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -185,12 +185,13 @@ function getTranslatedMonths(byMonthList) {
185185
* @param {number} bySetPositionNum The by-set-position number to get the translation of
186186
* @return {string}
187187
*/
188-
function getTranslatedOrdinalNumber(bySetPositionNum) {
188+
export function getTranslatedOrdinalNumber(bySetPositionNum) {
189189
switch (bySetPositionNum) {
190190
case 1:
191191
return t('calendar', 'first')
192192

193193
case 2:
194+
// TRANSLATORS This refers to the second item in a series, not to the unit of time
194195
return t('calendar', 'second')
195196

196197
case 3:

0 commit comments

Comments
 (0)