Skip to content

Commit

Permalink
Move strnigs to searchAndFilterStrings
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexVelezLl committed Jan 16, 2025
1 parent e952876 commit 68422bf
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 24 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -61,12 +61,12 @@
</template>

<KModal
v-if="isCloseConfirmationOpen"
v-if="isCloseConfirmationModalOpen"
appendToOverlay
:submitText="continueAction$()"
:cancelText="cancelAction$()"
:title="$tr('closeConfirmationTitle')"
@cancel="isCloseConfirmationOpen = false"
@cancel="isCloseConfirmationModalOpen = false"
@submit="closeSidePanel(false)"
>
{{ $tr('closeConfirmationMessage') }}
Expand Down Expand Up @@ -145,7 +145,7 @@
title: '',
goBack: null,
isSaving: false,
isCloseConfirmationOpen: false,
isCloseConfirmationModalOpen: false,
PageNames,
};
},
Expand Down Expand Up @@ -224,7 +224,7 @@
const newResources = this.getNewResources();
const hasNewResources = newResources.length > this.workingResources.length;
if (hasNewResources && verifyHasNewResources) {
this.isCloseConfirmationOpen = true;
this.isCloseConfirmationModalOpen = true;
} else {
this.$router.push({
name: PageNames.LESSON_SUMMARY_BETTER,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,16 +61,16 @@
<span class="row-actions">
<KIconButton
icon="emptyTopic"
:ariaLabel="$tr('openParentFolderLabel')"
:tooltip="$tr('openParentFolderLabel')"
:ariaLabel="openParentFolderLabel$()"
:tooltip="openParentFolderLabel$()"
:disabled="disabled"
@click="navigateToParent(resource)"
/>

<KIconButton
icon="minus"
:ariaLabel="$tr('removeResourceLabel')"
:tooltip="$tr('removeResourceLabel')"
:ariaLabel="removeResourceLabel$()"
:tooltip="removeResourceLabel$()"
:disabled="disabled"
@click="removeResource(resource)"
/>
Expand All @@ -80,7 +80,7 @@
</transition-group>
</DragContainer>
<p v-else>
{{ $tr('emptyResourceList') }}
{{ emptyResourceList$() }}
</p>
</div>

Expand Down Expand Up @@ -114,7 +114,14 @@
setup(props) {
const prevRoute = ref(null);
const { upLabel$, downLabel$, numberOfSelectedResources$ } = searchAndFilterStrings;
const {
upLabel$,
downLabel$,
emptyResourceList$,
removeResourceLabel$,
openParentFolderLabel$,
numberOfSelectedResources$,
} = searchAndFilterStrings;
const { lessonLabel$, sizeLabel$ } = coachStrings;
const instance = getCurrentInstance();
Expand Down Expand Up @@ -148,6 +155,9 @@
downLabel$,
sizeLabel$,
lessonLabel$,
emptyResourceList$,
removeResourceLabel$,
openParentFolderLabel$,
};
},
props: {
Expand Down Expand Up @@ -203,20 +213,6 @@
});
},
},
$trs: {
openParentFolderLabel: {
message: 'Open parent folder',
context: 'Button label to open the parent folder of a resource',
},
removeResourceLabel: {
message: 'Remove resource',
context: 'Button label to remove a resource from the selected resources',
},
emptyResourceList: {
message: 'No resources selected',
context: 'Message displayed when no resources are selected',
},
},
};
</script>
Expand Down
12 changes: 12 additions & 0 deletions packages/kolibri-common/strings/searchAndFilterStrings.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,4 +44,16 @@ export const searchAndFilterStrings = createTranslator('SearchAndFilterStrings',
'{count, number, integer} {count, plural, one {resource selected} other {resources selected}}',
context: 'Indicates the number of resources selected',
},
openParentFolderLabel: {
message: 'Open parent folder',
context: 'Button label to open the parent folder of a resource',
},
removeResourceLabel: {
message: 'Remove resource',
context: 'Button label to remove a resource from the selected resources',
},
emptyResourceList: {
message: 'No resources selected',
context: 'Message displayed when no resources are selected',
},
});

0 comments on commit 68422bf

Please sign in to comment.