From 418c00cd5e864d496fa11dbe06e547aee86212df Mon Sep 17 00:00:00 2001 From: Prashant-thakur77 Date: Mon, 17 Aug 2026 02:31:15 +0530 Subject: [PATCH 1/2] Refactor LanguageFilter to KMultiSelect --- .../Channel/components/LanguageFilter.vue | 132 +++++------------- 1 file changed, 36 insertions(+), 96 deletions(-) diff --git a/contentcuration/contentcuration/frontend/channelList/views/Channel/components/LanguageFilter.vue b/contentcuration/contentcuration/frontend/channelList/views/Channel/components/LanguageFilter.vue index 5c6e2d6d12..075b7422e2 100644 --- a/contentcuration/contentcuration/frontend/channelList/views/Channel/components/LanguageFilter.vue +++ b/contentcuration/contentcuration/frontend/channelList/views/Channel/components/LanguageFilter.vue @@ -1,73 +1,25 @@ - - - From 3d58905b4678fa587a8a2f395fabe0378bcced57 Mon Sep 17 00:00:00 2001 From: Prashant-thakur77 Date: Thu, 20 Aug 2026 19:28:06 +0530 Subject: [PATCH 2/2] Use shared KMultiSelect strings from commonStrings --- .../Channel/components/LanguageFilter.vue | 40 ++++++++++--------- 1 file changed, 22 insertions(+), 18 deletions(-) diff --git a/contentcuration/contentcuration/frontend/channelList/views/Channel/components/LanguageFilter.vue b/contentcuration/contentcuration/frontend/channelList/views/Channel/components/LanguageFilter.vue index 075b7422e2..7b8e008e56 100644 --- a/contentcuration/contentcuration/frontend/channelList/views/Channel/components/LanguageFilter.vue +++ b/contentcuration/contentcuration/frontend/channelList/views/Channel/components/LanguageFilter.vue @@ -20,6 +20,8 @@ import KMultiSelect from 'kolibri-design-system/lib/candidate/multiselect/KMultiSelect'; import LanguagesMap, { LanguagesList } from 'shared/leUtils/Languages'; + import { commonStrings } from 'shared/strings/commonStrings'; + import { communityChannelsStrings } from 'shared/strings/communityChannelsStrings'; const publicLanguages = Object.entries(window.publicLanguages || {}).map(([langId, count]) => { const baseLanguage = LanguagesMap.get(langId); @@ -61,17 +63,28 @@ }, }, messages() { + const { + openMenuAction$, + closeMenuAction$, + optionsClickableLabel$, + allOptionsSelectedLabel$, + allOptionsDeselectedLabel$, + optionDeselectedLabel$, + optionSelectedLabel$, + optionRemovedLabel$, + } = commonStrings; + const { clearAllAction$ } = communityChannelsStrings; return { - clearText: () => this.$tr('clearText'), - open: () => this.$tr('openMenu'), - close: () => this.$tr('closeMenu'), - clickable: () => this.$tr('optionsClickable'), - allOptionsSelected: () => this.$tr('allOptionsSelected'), - allOptionsDeselected: () => this.$tr('allOptionsDeselected'), - optionDeselected: () => this.$tr('optionDeselected'), + clearText: clearAllAction$, + open: openMenuAction$, + close: closeMenuAction$, + clickable: optionsClickableLabel$, + allOptionsSelected: allOptionsSelectedLabel$, + allOptionsDeselected: allOptionsDeselectedLabel$, + optionDeselected: optionDeselectedLabel$, itemsSelected: ({ count }) => this.$tr('itemsSelected', { count }), - selected: ({ label }) => this.$tr('languageSelected', { label }), - removed: ({ label }) => this.$tr('languageRemoved', { label }), + selected: optionSelectedLabel$, + removed: optionRemovedLabel$, cleared: ({ count }) => this.$tr('selectionsCleared', { count }), }; }, @@ -79,16 +92,7 @@ $trs: { languageLabel: 'Languages', noMatchingLanguageText: 'No language matches the search', - clearText: 'Clear all', - openMenu: 'Open menu', - closeMenu: 'Close menu', - optionsClickable: 'Options are clickable', - allOptionsSelected: 'All options selected', - allOptionsDeselected: 'No options selected', - optionDeselected: 'Option deselected', itemsSelected: '{count, plural, one {# language selected} other {# languages selected}}', - languageSelected: 'Selected {label}', - languageRemoved: 'Removed {label}', selectionsCleared: '{count, plural, one {Cleared # selection} other {Cleared # selections}}', }, };