Bugzilla – Attachment 189583 Details for
Bug 41088
Fix translatability for "Add new" and "Remove this" in vue
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 41088: (bug 38201 follow-up) Fix I18N for relationships
b6427a5.patch (text/plain), 15.90 KB, created by
Jonathan Druart
on 2025-11-14 10:11:26 UTC
(
hide
)
Description:
Bug 41088: (bug 38201 follow-up) Fix I18N for relationships
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2025-11-14 10:11:26 UTC
Size:
15.90 KB
patch
obsolete
>From b6427a50f7b1ac06be02c0a0c5ec730d09612817 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Fri, 14 Nov 2025 11:08:47 +0100 >Subject: [PATCH] Bug 41088: (bug 38201 follow-up) Fix I18N for relationships > >"Add new x", "Remove this x" and "There are no x created yet" were not >translatable correctly. > >Test plan: >Add a new agreement, then a new title, and confirm that the 3 strings >are correctly displayed. >Then try to update .po files, translate the strings, and install the >translations and confirm that the strings are correctly translated when >using a translated interface. >--- > .../vue/components/ERM/AgreementResource.vue | 47 +++++++++++++------ > .../ERM/EHoldingsLocalPackageResource.vue | 9 ++-- > .../ERM/EHoldingsLocalTitleResource.vue | 9 ++-- > .../js/vue/components/ERM/LicenseResource.vue | 18 ++++--- > .../js/vue/components/RelationshipWidget.vue | 20 +++----- > .../vue/components/Vendors/VendorResource.vue | 27 +++++++---- > .../prog/js/vue/composables/base-element.js | 2 +- > 7 files changed, 82 insertions(+), 50 deletions(-) > >diff --git a/koha-tmpl/intranet-tmpl/prog/js/vue/components/ERM/AgreementResource.vue b/koha-tmpl/intranet-tmpl/prog/js/vue/components/ERM/AgreementResource.vue >index a1075e8a866..9eb31dbf576 100644 >--- a/koha-tmpl/intranet-tmpl/prog/js/vue/components/ERM/AgreementResource.vue >+++ b/koha-tmpl/intranet-tmpl/prog/js/vue/components/ERM/AgreementResource.vue >@@ -196,10 +196,13 @@ export default { > resourceRelationships: { > resourceProperty: "periods", > }, >- relationshipStrings: { >- nameLowerCase: $__("period"), >+ relationshipI18n: { > nameUpperCase: $__("Period"), >- namePlural: $__("periods"), >+ removeThisMessage: $__("Remove this period"), >+ addNewMessage: $__("Add new period"), >+ noneCreatedYetMessage: $__( >+ "There are no periods created yet" >+ ), > }, > newRelationshipDefaultAttrs: { > type: "object", >@@ -279,10 +282,13 @@ export default { > resourceRelationships: { > resourceProperty: "user_roles", > }, >- relationshipStrings: { >- nameLowerCase: $__("user"), >+ relationshipI18n: { > nameUpperCase: $__("Agreement user"), >- namePlural: $__("users"), >+ removeThisMessage: $__("Remove this user"), >+ addNewMessage: $__("Add new user"), >+ noneCreatedYetMessage: $__( >+ "There are no users created yet" >+ ), > }, > newRelationshipDefaultAttrs: { > type: "object", >@@ -388,10 +394,13 @@ export default { > resourceRelationships: { > resourceProperty: "agreement_licenses", > }, >- relationshipStrings: { >- nameLowerCase: $__("license"), >+ relationshipI18n: { > nameUpperCase: $__("License"), >- namePlural: $__("licenses"), >+ removeThisMessage: $__("Remove this license"), >+ addNewMessage: $__("Add new license"), >+ noneCreatedYetMessage: $__( >+ "There are no licenses created yet" >+ ), > }, > }, > relationshipFields: [ >@@ -491,10 +500,15 @@ export default { > resourceRelationships: { > resourceProperty: "agreement_relationships", > }, >- relationshipStrings: { >- nameLowerCase: $__("related agreement"), >+ relationshipI18n: { > nameUpperCase: $__("Related agreement"), >- namePlural: $__("related agreements"), >+ removeThisMessage: $__( >+ "Remove this related agreement" >+ ), >+ addNewMessage: $__("Add new related agreement"), >+ noneCreatedYetMessage: $__( >+ "There are no related agreements created yet" >+ ), > }, > filters: { > type: "filter", >@@ -578,10 +592,13 @@ export default { > resourceRelationships: { > resourceProperty: "documents", > }, >- relationshipStrings: { >- nameLowerCase: $__("document"), >+ relationshipI18n: { > nameUpperCase: $__("Document"), >- namePlural: $__("documents"), >+ removeThisMessage: $__("Remove this document"), >+ addNewMessage: $__("Add new document"), >+ noneCreatedYetMessage: $__( >+ "There are no documents created yet" >+ ), > }, > newRelationshipDefaultAttrs: { > type: "object", >diff --git a/koha-tmpl/intranet-tmpl/prog/js/vue/components/ERM/EHoldingsLocalPackageResource.vue b/koha-tmpl/intranet-tmpl/prog/js/vue/components/ERM/EHoldingsLocalPackageResource.vue >index c146d1d8bce..10a848defeb 100644 >--- a/koha-tmpl/intranet-tmpl/prog/js/vue/components/ERM/EHoldingsLocalPackageResource.vue >+++ b/koha-tmpl/intranet-tmpl/prog/js/vue/components/ERM/EHoldingsLocalPackageResource.vue >@@ -150,10 +150,13 @@ export default { > resourceRelationships: { > resourceProperty: "package_agreements", > }, >- relationshipStrings: { >- nameLowerCase: $__("agreement"), >+ relationshipI18n: { > nameUpperCase: $__("Agreement"), >- namePlural: $__("agreements"), >+ removeThisMessage: $__("Remove this agreement"), >+ addNewMessage: $__("Add new agreement"), >+ noneCreatedYetMessage: $__( >+ "There are no agreements created yet" >+ ), > }, > fetchOptions: { > type: "boolean", >diff --git a/koha-tmpl/intranet-tmpl/prog/js/vue/components/ERM/EHoldingsLocalTitleResource.vue b/koha-tmpl/intranet-tmpl/prog/js/vue/components/ERM/EHoldingsLocalTitleResource.vue >index 11b0caa0452..eb4cb691fcb 100644 >--- a/koha-tmpl/intranet-tmpl/prog/js/vue/components/ERM/EHoldingsLocalTitleResource.vue >+++ b/koha-tmpl/intranet-tmpl/prog/js/vue/components/ERM/EHoldingsLocalTitleResource.vue >@@ -372,10 +372,13 @@ export default { > resourceRelationships: { > resourceProperty: "resources", > }, >- relationshipStrings: { >- nameLowerCase: $__("package"), >+ relationshipI18n: { > nameUpperCase: $__("Package"), >- namePlural: $__("packages"), >+ removeThisMessage: $__("Remove this package"), >+ addNewMessage: $__("Add new package"), >+ noneCreatedYetMessage: $__( >+ "There are no packages created yet" >+ ), > }, > fetchOptions: { > type: "boolean", >diff --git a/koha-tmpl/intranet-tmpl/prog/js/vue/components/ERM/LicenseResource.vue b/koha-tmpl/intranet-tmpl/prog/js/vue/components/ERM/LicenseResource.vue >index 34396cd13f1..18145004e98 100644 >--- a/koha-tmpl/intranet-tmpl/prog/js/vue/components/ERM/LicenseResource.vue >+++ b/koha-tmpl/intranet-tmpl/prog/js/vue/components/ERM/LicenseResource.vue >@@ -152,10 +152,13 @@ export default { > resourceRelationships: { > resourceProperty: "user_roles", > }, >- relationshipStrings: { >- nameLowerCase: $__("user"), >+ relationshipI18n: { > nameUpperCase: $__("License user"), >- namePlural: $__("users"), >+ removeThisMessage: $__("Remove this user"), >+ addNewMessage: $__("Add new user"), >+ noneCreatedYetMessage: $__( >+ "There are no users created yet" >+ ), > }, > newRelationshipDefaultAttrs: { > type: "object", >@@ -225,10 +228,13 @@ export default { > resourceRelationships: { > resourceProperty: "documents", > }, >- relationshipStrings: { >- nameLowerCase: $__("document"), >+ relationshipI18n: { > nameUpperCase: $__("Document"), >- namePlural: $__("documents"), >+ removeThisMessage: $__("Remove this document"), >+ addNewMessage: $__("Add new document"), >+ noneCreatedYetMessage: $__( >+ "There are no documents created yet" >+ ), > }, > newRelationshipDefaultAttrs: { > type: "object", >diff --git a/koha-tmpl/intranet-tmpl/prog/js/vue/components/RelationshipWidget.vue b/koha-tmpl/intranet-tmpl/prog/js/vue/components/RelationshipWidget.vue >index 0834ecd083a..3ea944e0399 100644 >--- a/koha-tmpl/intranet-tmpl/prog/js/vue/components/RelationshipWidget.vue >+++ b/koha-tmpl/intranet-tmpl/prog/js/vue/components/RelationshipWidget.vue >@@ -8,14 +8,10 @@ > v-bind:key="counter" > > > <legend> >- {{ relationshipStrings.nameUpperCase + " " + (counter + 1) }} >+ {{ relationshipI18n.nameUpperCase + " " + (counter + 1) }} > <a href="#" @click.prevent="deleteResourceRelationship(counter)" > ><i class="fa fa-trash"></i> >- {{ >- $__("Remove this %s").format( >- relationshipStrings.nameLowerCase >- ) >- }}</a >+ {{ relationshipI18n.removeThisMessage }}</a > > > </legend> > <ol> >@@ -37,13 +33,11 @@ > class="btn btn-default add-new-relationship" > @click="addResourceRelationship" > ><font-awesome-icon icon="plus" /> >- {{ $__("Add new %s").format(relationshipStrings.nameLowerCase) }}</a >+ {{ relationshipI18n.addNewMessage }}</a > > >- <span v-else-if="resourceRelationshipCount == 0">{{ >- $__("There are no %s created yet").format( >- relationshipStrings.namePlural >- ) >- }}</span> >+ <span v-else-if="resourceRelationshipCount == 0"> >+ {{ relationshipI18n.noneCreatedYetMessage }} >+ </span> > </fieldset> > </template> > >@@ -113,7 +107,7 @@ export default { > props: { > resourceRelationships: Array, > relationshipFields: Array, >- relationshipStrings: Object, >+ relationshipI18n: Object, > title: String, > apiClient: Object, > newRelationshipDefaultAttrs: Object, >diff --git a/koha-tmpl/intranet-tmpl/prog/js/vue/components/Vendors/VendorResource.vue b/koha-tmpl/intranet-tmpl/prog/js/vue/components/Vendors/VendorResource.vue >index 24b16e98f68..17d9bf1deb8 100644 >--- a/koha-tmpl/intranet-tmpl/prog/js/vue/components/Vendors/VendorResource.vue >+++ b/koha-tmpl/intranet-tmpl/prog/js/vue/components/Vendors/VendorResource.vue >@@ -256,10 +256,13 @@ export default { > resourceRelationships: { > resourceProperty: "aliases", > }, >- relationshipStrings: { >- nameLowerCase: $__("alias"), >+ relationshipI18n: { > nameUpperCase: $__("Alias"), >- namePlural: $__("aliases"), >+ removeThisMessage: $__("Remove this alias"), >+ addNewMessage: $__("Add new alias"), >+ noneCreatedYetMessage: $__( >+ "There are no aliases created yet" >+ ), > }, > newRelationshipDefaultAttrs: { > type: "object", >@@ -286,10 +289,13 @@ export default { > resourceRelationships: { > resourceProperty: "contacts", > }, >- relationshipStrings: { >- nameLowerCase: $__("contact"), >+ relationshipI18n: { > nameUpperCase: $__("Contact"), >- namePlural: $__("contacts"), >+ removeThisMessage: $__("Remove this contact"), >+ addNewMessage: $__("Add new contact"), >+ noneCreatedYetMessage: $__( >+ "There are no contacts created yet" >+ ), > }, > newRelationshipDefaultAttrs: { > type: "object", >@@ -388,10 +394,13 @@ export default { > resourceRelationships: { > resourceProperty: "interfaces", > }, >- relationshipStrings: { >- nameLowerCase: $__("interface"), >+ relationshipI18n: { > nameUpperCase: $__("Interface"), >- namePlural: $__("interfaces"), >+ removeThisMessage: $__("Remove this interface"), >+ addNewMessage: $__("Add new interface"), >+ noneCreatedYetMessage: $__( >+ "There are no interfaces created yet" >+ ), > }, > newRelationshipDefaultAttrs: { > type: "object", >diff --git a/koha-tmpl/intranet-tmpl/prog/js/vue/composables/base-element.js b/koha-tmpl/intranet-tmpl/prog/js/vue/composables/base-element.js >index b54eb0fdd8f..317cb1e2f22 100644 >--- a/koha-tmpl/intranet-tmpl/prog/js/vue/composables/base-element.js >+++ b/koha-tmpl/intranet-tmpl/prog/js/vue/composables/base-element.js >@@ -92,7 +92,7 @@ export function useBaseElement(instancedElement) { > prop.value = propertyValue; > } > } >- if (key === "relationshipStrings") { >+ if (key === "relationshipI18n") { > acc[key] = prop; > } > if (prop.type === "av") { >-- >2.34.1 >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 41088
:
189583
|
189896
|
189907