From a1c0642bb553fae4d0a82682657d4ecba3bb280a Mon Sep 17 00:00:00 2001 From: Sol Fisher Romanoff Date: Sat, 12 Nov 2022 18:35:25 +0200 Subject: [PATCH 1/2] Use correct pluralization in reports tab --- src/components/mod_modal/tabs/reports_tab/report_card.vue | 4 ++-- src/i18n/en.json | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/components/mod_modal/tabs/reports_tab/report_card.vue b/src/components/mod_modal/tabs/reports_tab/report_card.vue index 6cc034b1..e77afa79 100644 --- a/src/components/mod_modal/tabs/reports_tab/report_card.vue +++ b/src/components/mod_modal/tabs/reports_tab/report_card.vue @@ -54,7 +54,7 @@ class="button button-unstyled dropdown-header" @click="toggleStatuses" > - {{ this.statuses.length + ' ' + $t('moderation.reports.statuses') }} + {{ $tc('moderation.reports.statuses', statuses.length - 1, { count: statuses.length }) }} - {{ this.notes.length + ' ' + $t('moderation.reports.notes') }} + {{ $tc('moderation.reports.notes', notes.length - 1, { count: notes.length }) }} Date: Sat, 12 Nov 2022 19:06:39 +0000 Subject: [PATCH 2/2] Ensure we don't fail if translation is disabled --- src/components/settings_modal/tabs/general_tab.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/components/settings_modal/tabs/general_tab.js b/src/components/settings_modal/tabs/general_tab.js index 6e31366b..763a588d 100644 --- a/src/components/settings_modal/tabs/general_tab.js +++ b/src/components/settings_modal/tabs/general_tab.js @@ -105,8 +105,12 @@ const GeneralTab = { return this.$store.getters.mergedConfig.profileVersion }, translationLanguages () { - const langs = this.$store.state.instance.supportedTranslationLanguages || { source: [] } - return langs.source.map(lang => ({ key: lang.code, value: lang.code, label: lang.name })) + const langs = this.$store.state.instance.supportedTranslationLanguages + if (langs && langs.source) { + return langs.source.map(lang => ({ key: lang.code, value: lang.code, label: lang.name })) + } + + return [] }, translationLanguage: { get: function () { return this.$store.getters.mergedConfig.translationLanguage },