Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@
import { ResourcesNeededTypes } from 'shared/constants';
import { constantsTranslationMixin } from 'shared/mixins';
import { hasMultipleFieldValues } from 'shared/utils/helpers';
import commonStrings from 'shared/translator';

export default {
name: 'EditAudienceModal',
Expand Down Expand Up @@ -137,19 +138,15 @@
});
})
);
this.$store.dispatch(
'showSnackbarSimple',
this.$tr('editedAudience', { count: this.nodes.length })
);
/* eslint-disable-next-line kolibri/vue-no-undefined-string-uses */
this.$store.dispatch('showSnackbarSimple', commonStrings.$tr('changesSaved'));
this.close();
},
},
$trs: {
editAudienceTitle: 'Edit Audience',
saveAction: 'Save',
cancelAction: 'Cancel',
editedAudience:
'Edited audience for {count, number, integer} {count, plural, one {resource} other {resources}}',
resourcesSelected:
'{count, number, integer} {count, plural, one {resource} other {resources}} selected',
forBeginnersCheckbox: 'For beginners',
Expand All @@ -168,4 +165,4 @@
.modal-subheading {
margin-bottom: 12px;
}
</style>
</style>
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
isDescendantsUpdatable
:title="$tr('editCategories')"
:nodeIds="nodeIds"
:confirmationMessage="$tr('editedCategories', { count: nodeIds.length })"
:confirmationMessage="changesSaved"
@close="() => $emit('close')"
>
<template #input="{ value, inputHandler }">
Expand All @@ -26,6 +26,7 @@

import EditBooleanMapModal from './EditBooleanMapModal.vue';
import CategoryOptions from 'shared/views/contentNodeFields/CategoryOptions';
import commonStrings from 'shared/translator';

export default {
name: 'EditCategoriesModal',
Expand All @@ -39,14 +40,18 @@
required: true,
},
},
computed: {
changesSaved() {
/* eslint-disable-next-line kolibri/vue-no-undefined-string-uses */
return commonStrings.$tr('changesSaved');
},
},
$trs: {
editCategories: 'Edit Categories',
editedCategories:
'Edited categories for {count, number, integer} {count, plural, one {resource} other {resources}}',
},
};

</script>

<style scoped>
</style>
</style>
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
import { mapGetters, mapActions } from 'vuex';
import { getFileDuration } from 'shared/utils/helpers';
import CompletionOptions from 'shared/views/contentNodeFields/CompletionOptions';
import commonStrings from 'shared/translator';

export default {
name: 'EditCompletionModal',
Expand Down Expand Up @@ -120,8 +121,8 @@
};

this.updateContentNode({ id: this.nodeId, ...payload });

this.$store.dispatch('showSnackbarSimple', this.$tr('editedCompletion', { count: 1 }));
/* eslint-disable-next-line kolibri/vue-no-undefined-string-uses */
this.$store.dispatch('showSnackbarSimple', commonStrings.$tr('changesSaved'));
this.close();
},
close() {
Expand All @@ -132,8 +133,6 @@
editCompletion: 'Edit Completion',
saveAction: 'Save',
cancelAction: 'Cancel',
editedCompletion:
'Edited completion for {count, number, integer} {count, plural, one {resource} other {resources}}',
},
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@
import { mapGetters, mapActions } from 'vuex';
import { LanguagesList } from 'shared/leUtils/Languages';
import { ContentKindsNames } from 'shared/leUtils/ContentKinds';
import commonStrings from 'shared/translator';

export default {
name: 'EditLanguageModal',
Expand Down Expand Up @@ -144,11 +145,8 @@
});
})
);

this.$store.dispatch(
'showSnackbarSimple',
this.$tr('editedLanguage', { count: this.nodes.length })
);
/* eslint-disable-next-line kolibri/vue-no-undefined-string-uses */
this.$store.dispatch('showSnackbarSimple', commonStrings.$tr('changesSaved'));
this.close();
},
},
Expand All @@ -157,8 +155,6 @@
languageItemText: '{language} ({code})',
saveAction: 'Save',
cancelAction: 'Cancel',
editedLanguage:
'Edited language for {count, number, integer} {count, plural, one {resource} other {resources}}',
selectLanguage: 'Select / Type Language',
resourcesSelected:
'{count, number, integer} {count, plural, one {resource} other {resources}} selected',
Expand All @@ -177,4 +173,4 @@
height: 250px;
overflow-y: auto;
}
</style>
</style>
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
:title="$tr('editLearningActivitiesTitle')"
:nodeIds="nodeIds"
:validators="learningActivityValidators"
:confirmationMessage="$tr('editedLearningActivities', { count: nodeIds.length })"
:confirmationMessage="changesSaved"
@close="() => $emit('close')"
>
<template #input="{ value, inputHandler }">
Expand All @@ -28,6 +28,7 @@
import EditBooleanMapModal from './EditBooleanMapModal';
import { getLearningActivityValidators } from 'shared/utils/validation';
import LearningActivityOptions from 'shared/views/contentNodeFields/LearningActivityOptions';
import commonStrings from 'shared/translator';

export default {
name: 'EditLearningActivitiesModal',
Expand All @@ -45,11 +46,13 @@
learningActivityValidators() {
return getLearningActivityValidators();
},
changesSaved() {
/* eslint-disable-next-line kolibri/vue-no-undefined-string-uses */
return commonStrings.$tr('changesSaved');
},
},
$trs: {
editLearningActivitiesTitle: 'Edit Learning Activities',
editedLearningActivities:
'Edited learning activities for {count, number, integer} {count, plural, one {resource} other {resources}}',
},
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
isDescendantsUpdatable
:title="$tr('editLevelsTitle')"
:nodeIds="nodeIds"
:confirmationMessage="$tr('editedLevels', { count: nodeIds.length })"
:confirmationMessage="changesSaved"
@close="() => $emit('close')"
>
<template #input="{ value, inputHandler }">
Expand All @@ -26,6 +26,7 @@

import EditBooleanMapModal from './EditBooleanMapModal';
import LevelsOptions from 'shared/views/contentNodeFields/LevelsOptions';
import commonStrings from 'shared/translator';

export default {
name: 'EditLevelsModal',
Expand All @@ -39,10 +40,14 @@
required: true,
},
},
computed: {
changesSaved() {
/* eslint-disable-next-line kolibri/vue-no-undefined-string-uses */
return commonStrings.$tr('changesSaved');
},
},
$trs: {
editLevelsTitle: 'What Levels',
editedLevels:
'Edited levels for {count, number, integer} {count, plural, one {resource} other {resources}}',
},
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
isDescendantsUpdatable
:title="$tr('editResourcesNeededTitle')"
:nodeIds="nodeIds"
:confirmationMessage="$tr('editedResourcesNeeded', { count: nodeIds.length })"
:confirmationMessage="changesSaved"
@close="() => $emit('close')"
>
<template #input="{ value, inputHandler }">
Expand All @@ -26,6 +26,7 @@

import EditBooleanMapModal from './EditBooleanMapModal';
import ResourcesNeededOptions from 'shared/views/contentNodeFields/ResourcesNeededOptions';
import commonStrings from 'shared/translator';

export default {
name: 'EditResourcesNeededModal',
Expand All @@ -39,10 +40,14 @@
required: true,
},
},
computed: {
changesSaved() {
/* eslint-disable-next-line kolibri/vue-no-undefined-string-uses */
return commonStrings.$tr('changesSaved');
},
},
$trs: {
editResourcesNeededTitle: 'What will you need?',
editedResourcesNeeded:
"Edited 'what will you need' for {count, number, integer} {count, plural, one {resource} other {resources}}",
},
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@
import HelpTooltip from 'shared/views/HelpTooltip';
import LicenseDropdown from 'shared/views/LicenseDropdown';
import { getCopyrightHolderValidators, getInvalidText } from 'shared/utils/validation';
import commonStrings from 'shared/translator';

function generateGetterSetter(key) {
return {
Expand Down Expand Up @@ -256,11 +257,8 @@
return this.updateContentNode(payload);
})
);

this.$store.dispatch(
'showSnackbarSimple',
this.$tr('editedAttribution', { count: nodesToEdit.length })
);
/* eslint-disable-next-line kolibri/vue-no-undefined-string-uses */
this.$store.dispatch('showSnackbarSimple', commonStrings.$tr('changesSaved'));
this.close();
},
},
Expand All @@ -281,8 +279,6 @@
mixed: 'Mixed',
saveAction: 'Save',
cancelAction: 'Cancel',
editedAttribution:
'Edited attribution for {count, number, integer} {count, plural, one {resource} other {resources}}',
},
};

Expand Down Expand Up @@ -327,4 +323,4 @@
}
}

</style>
</style>
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@

import { mapActions, mapGetters } from 'vuex';
import { getTitleValidators, getInvalidText } from 'shared/utils/validation';
import commonStrings from 'shared/translator';

export default {
name: 'EditTitleDescriptionModal',
Expand Down Expand Up @@ -85,8 +86,8 @@
title: title.trim(),
description: description.trim(),
});

this.$store.dispatch('showSnackbarSimple', this.$tr('editedTitleDescription'));
/* eslint-disable-next-line kolibri/vue-no-undefined-string-uses */
this.$store.dispatch('showSnackbarSimple', commonStrings.$tr('changesSaved'));
this.close();
},
},
Expand All @@ -96,7 +97,6 @@
descriptionLabel: 'Description',
saveAction: 'Save',
cancelAction: 'Cancel',
editedTitleDescription: 'Edited title and description',
},
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ const MESSAGES = {
longActivityLteOneTwenty: 'Value must be equal or less than 120',
activityDurationTooLongWarning:
'This value is very high. Please make sure this is how long learners should work on the resource for, in order to complete it.',
changesSaved: 'Changes saved',
};

export default createTranslator('sharedVue', MESSAGES);