From b01208c1bcac609b32404c29b58d14ec44e43d53 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 --- .../ERM/UsageStatisticsDataProviderDetails.vue | 4 ++-- .../ERM/UsageStatisticsDataProvidersFormAdd.vue | 16 ++++++++++++++-- .../ERM/UsageStatisticsDataProvidersList.vue | 4 +++- 3 files changed, 19 insertions(+), 5 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 86434d2486..7fcd3061fb 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 5cbad96300..f3cbf0f9a6 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.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 b0421f8cf7..e0f60f3859 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 @@ -326,7 +326,9 @@ export default { { title: __("Status"), render: function (data, type, row, meta) { - const status = row.active ? "Active" : "Inactive" + const status = row.active + ? __p("ERM data provider status", "Active") + : __p("ERM data provider status", "Inactive") return status }, searchable: true, -- 2.43.0