From d63ead1073035e8c15cff05d5d9823018f1f995a Mon Sep 17 00:00:00 2001 From: Caroline Cyr La Rose Date: Thu, 6 Feb 2025 16:36:19 -0500 Subject: [PATCH] Bug 39045: Add translation context to ERM data providers status (active/inactive) This patch adds translation context to 'Active' and 'Inactive' when used as the status of ERM data providers. This patch needs the patch in bug 39061 in order to work properly. To test: 1. Enable the ERMModule system preference 1.1. Go to Administration > System preferences 1.2. Search for ERMMdoule 1.3. Choose 'Enable' 1.4. Click 'Save all E-resource management preferences' 2. Go to E-resource management 3. Click 'Data providers' 4. Click 'New data provider' --> There should be a Harvester status field with Active and Inactive options 5. Click 'Create manually' 6. Fill out the mandatory fields 7. Click 'Submit' --> There should be a Status field with value 'Active' 8. Click 'Data providers" --> The status in the column should be 'Active' 9. Click 'Edit' 10. Change Harvester status to Inactive 11. Click 'Submit' --> There should be a Status field with value 'Inactive' 12. Click 'Data providers" --> The status in the column should be 'Inactive' 13. Apply patch 14. Update translations ktd --shell gulp po:update --lang fr-CA 15. View the fr-CA-messages.po file --> There should be entries with 'ERM data provider status' in msgctxt 16. Optionally, translate the strings (remember to remove the fuzzy flag, if any) 17. Install new translations ktd --root --shell koha-translate --install fr-CA --dev kohadev 18. Enable the new language in Administration > System preferences > StaffInterfaceLanguages 19. Repeat step 1-12 --> Translations should be whatever you put in the po file Signed-off-by: Owen Leonard --- .../ERM/UsageStatisticsDataProviderDetails.vue | 4 ++-- .../ERM/UsageStatisticsDataProvidersFormAdd.vue | 16 ++++++++++++++-- .../ERM/UsageStatisticsDataProvidersList.vue | 6 ++++-- 3 files changed, 20 insertions(+), 6 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/js/vue/components/ERM/UsageStatisticsDataProviderDetails.vue b/koha-tmpl/intranet-tmpl/prog/js/vue/components/ERM/UsageStatisticsDataProviderDetails.vue index c418dd201f9..02f5b760eba 100644 --- a/koha-tmpl/intranet-tmpl/prog/js/vue/components/ERM/UsageStatisticsDataProviderDetails.vue +++ b/koha-tmpl/intranet-tmpl/prog/js/vue/components/ERM/UsageStatisticsDataProviderDetails.vue @@ -19,8 +19,8 @@ {{ usage_data_provider.active - ? $__("Active") - : $__("Inactive") + ? $__p("ERM data provider status", "Active") + : $__p("ERM data provider status", "Inactive") }} diff --git a/koha-tmpl/intranet-tmpl/prog/js/vue/components/ERM/UsageStatisticsDataProvidersFormAdd.vue b/koha-tmpl/intranet-tmpl/prog/js/vue/components/ERM/UsageStatisticsDataProvidersFormAdd.vue index aebcf54092a..849e12a557a 100644 --- a/koha-tmpl/intranet-tmpl/prog/js/vue/components/ERM/UsageStatisticsDataProvidersFormAdd.vue +++ b/koha-tmpl/intranet-tmpl/prog/js/vue/components/ERM/UsageStatisticsDataProvidersFormAdd.vue @@ -421,8 +421,20 @@ export default { initialized: false, previous_route: "", statuses: [ - { description: this.$__("Active"), value: 1 }, - { description: this.$__("Inactive"), value: 0 }, + { + description: this.$__p( + "ERM data provider status", + "Active" + ), + value: 1, + }, + { + description: this.$__p( + "ERM data provider status", + "Inactive" + ), + value: 0, + }, ], registry_data: [], valid_report_types: [...this.authorisedValues.av_report_types], diff --git a/koha-tmpl/intranet-tmpl/prog/js/vue/components/ERM/UsageStatisticsDataProvidersList.vue b/koha-tmpl/intranet-tmpl/prog/js/vue/components/ERM/UsageStatisticsDataProvidersList.vue index 4d08a1da13a..e8b9c6ab7b2 100644 --- a/koha-tmpl/intranet-tmpl/prog/js/vue/components/ERM/UsageStatisticsDataProvidersList.vue +++ b/koha-tmpl/intranet-tmpl/prog/js/vue/components/ERM/UsageStatisticsDataProvidersList.vue @@ -328,8 +328,10 @@ export default { { title: __("Status"), render: function (data, type, row, meta) { - const status = row.active ? "Active" : "Inactive"; - return status; + const status = row.active + ? __p("ERM data provider status", "Active") + : __p("ERM data provider status", "Inactive") + return status }, searchable: true, orderable: true, -- 2.39.5