From de77f3a719b2d25cef0c504b6d9899128e38a697 Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Wed, 26 Oct 2022 11:58:01 +0200 Subject: [PATCH] Bug 32030: I18N rewrite The previous implementation was using vue-i18n inject localized strings into the Vue app. However it was using json files, and we needed additional overhead to convert from/to PO files. I've also tried vue3-gettext that use PO, but the overhead to work with our workflow was existent as well (see branch joubu/vue3-gettext). vue-i18n-extract was using for extracting, and a specific misc script (misc/translate_json.pl) was also used to generate the json file. They can be removed. Here we are simply reusing our existing workflow, and we will improve it (ie. make it more vue-ish) later if we need it. Signed-off-by: Jonathan Field Signed-off-by: Martin Renvoize Signed-off-by: Kyle M Hall Signed-off-by: Tomas Cohen Arazi --- gulpfile.js | 5 +- .../intranet-tmpl/prog/en/modules/erm/erm.tt | 1 + .../prog/js/vue/locales/de-DE.json | 225 ----------------- .../intranet-tmpl/prog/js/vue/locales/en.json | 228 ------------------ .../prog/js/vue/locales/es-ES.json | 225 ----------------- .../prog/js/vue/locales/fr-FR.json | 225 ----------------- .../intranet-tmpl/prog/js/vue/main-erm.ts | 18 +- misc/translate_json.pl | 46 ---- package.json | 1 - 9 files changed, 13 insertions(+), 961 deletions(-) delete mode 100644 koha-tmpl/intranet-tmpl/prog/js/vue/locales/de-DE.json delete mode 100644 koha-tmpl/intranet-tmpl/prog/js/vue/locales/en.json delete mode 100644 koha-tmpl/intranet-tmpl/prog/js/vue/locales/es-ES.json delete mode 100644 koha-tmpl/intranet-tmpl/prog/js/vue/locales/fr-FR.json delete mode 100644 misc/translate_json.pl diff --git a/gulpfile.js b/gulpfile.js index 82962d94df..f41f53afb8 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -184,10 +184,13 @@ function po_extract_opac () { const xgettext_options = '--from-code=UTF-8 --package-name Koha ' + '--package-version= -k -k__ -k__x -k__n:1,2 -k__nx:1,2 -k__xn:1,2 ' + '-k__p:1c,2 -k__px:1c,2 -k__np:1c,2,3 -k__npx:1c,2,3 -kN__ ' - + '-kN__n:1,2 -kN__p:1c,2 -kN__np:1c,2,3 --force-po'; + + '-kN__n:1,2 -kN__p:1c,2 -kN__np:1c,2,3 ' + + '-k -k$__ -k$__x -k$__n:1,2 -k$__nx:1,2 -k$__xn:1,2 ' + + '--force-po'; function po_extract_messages_js () { const globs = [ + 'koha-tmpl/intranet-tmpl/prog/js/vue/**/*.vue', 'koha-tmpl/intranet-tmpl/prog/js/**/*.js', 'koha-tmpl/opac-tmpl/bootstrap/js/**/*.js', ]; diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/erm/erm.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/erm/erm.tt index ee838dbc72..3e00156a77 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/erm/erm.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/erm/erm.tt @@ -5,6 +5,7 @@ [% USE TablesSettings %] [% USE AuthorisedValues %] [% SET footerjs = 1 %] +[% PROCESS 'i18n.inc' %] [% INCLUDE 'doc-head-open.inc' %] E-Resource management › Koha diff --git a/koha-tmpl/intranet-tmpl/prog/js/vue/locales/de-DE.json b/koha-tmpl/intranet-tmpl/prog/js/vue/locales/de-DE.json deleted file mode 100644 index f3b986b421..0000000000 --- a/koha-tmpl/intranet-tmpl/prog/js/vue/locales/de-DE.json +++ /dev/null @@ -1,225 +0,0 @@ -{ - "/" : "/", - "A license is used several times" : "Eine Lizenz wird mehrfach verwendet", - "A package is used several times" : "Ein Paket wird mehrfach verwendet", - "Access type" : "Zugangsart", - "Add agreement" : "Vereinbarung hinzufügen", - "Add license" : "Lizenz hinzufügen", - "Add new agreement" : "Neue Vereinbarung hinzufügen", - "Add new document" : "Neues Dokument hinzufügen", - "Add new license" : "Neue Lizenz hinzufügen", - "Add new period" : "Neuen Zeitraum hinzufügen", - "Add new related agreement" : "Fügen Sie eine neue zugehörige Vereinbarung hinzu", - "Add new user" : "Neuen Benutzer hinzufügen", - "Add package" : "Paket hinzufügen", - "Add title" : "Titel hinzufügen", - "Add to another package" : "Zu einem anderen Paket hinzufügen", - "Agreement" : "Zustimmung", - "Agreement " : { - "counter" : "Vereinbarung %{counter}", - "id" : "Vereinbarung #%{id}" - }, - "Agreement created" : "Vereinbarung erstellt", - "Agreement deleted" : "Vereinbarung gelöscht", - "Agreement license " : { - "counter" : "Vereinbarungslizenz %{counter}" - }, - "Agreement name" : "Vereinbarungsname", - "Agreement period " : { - "counter" : "Vertragsdauer %{counter}" - }, - "Agreement updated" : "Vereinbarung aktualisiert", - "Agreement user " : { - "counter" : "Vereinbarungsnutzer %{counter}" - }, - "Agreements" : "Vereinbarungen", - "All" : "Alle", - "An agreement is used several times" : "Eine Vereinbarung wird mehrfach verwendet", - "Cancel" : "Absagen", - "Cancellation deadline" : "Kündigungsfrist", - "Cannot import, no package selected" : "Import nicht möglich, kein Paket ausgewählt", - "Close" : "Nah dran", - "Closure reason" : "Schließungsgrund", - "Content type" : "Inhaltstyp", - "Content type: " : "Inhaltstyp:", - "Coverage dates" : "Deckungstermine", - "Coverage depth" : "Abdeckungstiefe", - "Created on" : "Erstellt am", - "Date of first serial issue available online" : "Datum der ersten Serienausgabe online verfügbar", - "Date of last issue available online" : "Datum der letzten online verfügbaren Ausgabe", - "Date the monograph is first published in print" : "Datum der ersten gedruckten Veröffentlichung der Monographie", - "Date the monograph is first published online" : "Datum der ersten Online-Veröffentlichung der Monographie", - "Delete" : "Löschen", - "Delete agreement" : "Vereinbarung löschen", - "Delete license" : "Lizenz löschen", - "Delete package" : "Paket löschen", - "Delete title" : "Titel löschen", - "Description" : "Beschreibung", - "Document " : { - "counter" : "Dokument %{counter}" - }, - "Documents" : "Unterlagen", - "E-Resource management" : "E-Ressourcen-Management", - "EBSCO" : "EBSCO", - "Edit" : "Bearbeiten", - "Edit agreement" : "Vereinbarung bearbeiten", - "Edit agreement " : { - "id" : "Vereinbarung #%{id} bearbeiten" - }, - "Edit license" : "Lizenz bearbeiten", - "Edit license " : { - "id" : "Lizenz #%{id} bearbeiten" - }, - "Edit package" : "Paket bearbeiten", - "Edit package " : { - "id" : "Paket #%{id} bearbeiten" - }, - "Edit title" : "Titel bearbeiten", - "Edit title " : { - "id" : "Titel bearbeiten #%{id}" - }, - "Edition of the monograph" : "Ausgabe der Monographie", - "Embargo information" : "Embargo-Informationen", - "End date" : "Endtermin", - "Ended on" : "Beendet am", - "External ID" : "Externe ID", - "File" : "Datei", - "File description" : "Dateibeschreibung", - "File name" : "Dateiname", - "File type" : "Dateityp", - "Filter" : "Filter", - "First author" : "Erster Autor", - "First editor" : "Erster Redakteur", - "Hide filters" : "Filter ausblenden", - "Home" : "Heim", - "Import from a list" : "Aus einer Liste importieren", - "Import from list" : "Aus Liste importieren", - "Import in progress," : "Import läuft,", - "Is perpetual" : "Ist ewig", - "License" : "Lizenz", - "License " : { - "id" : "Lizenz #%{id}" - }, - "License created" : "Lizenz erstellt", - "License deleted" : "Lizenz gelöscht", - "License info" : "Lizenzinformationen", - "License name" : "Lizenzname", - "License updated" : "Lizenz aktualisiert", - "Licenses" : "Lizenzen", - "Loading" : "Wird geladen", - "Local" : "Lokal", - "Local bibliographic record" : "Lokaler bibliographischer Eintrag", - "Name" : "Name", - "New agreement" : "Neue Vereinbarung", - "New license" : "Neue Lizenz", - "New package" : "Neues Paket", - "New title" : "Neuer Titel", - "No, do not delete" : "Nein, nicht löschen", - "Not selected" : "Nicht ausgewählt", - "Notes" : "Anmerkungen", - "Number of first issue available online" : "Nummer der ersten online verfügbaren Ausgabe", - "Number of first volume available online" : "Nummer des ersten online verfügbaren Bandes", - "Number of last issue available online" : "Nummer der letzten online verfügbaren Ausgabe", - "Number of last volume available online" : "Nummer des letzten online verfügbaren Bandes", - "Number of volume for monograph" : "Nummer des Bandes für die Monographie", - "Online-format identifier" : "Kennung des Online-Formats", - "Only one controlling license is allowed" : "Es ist nur eine kontrollierende Lizenz erlaubt", - "Package" : "Paket", - "Package " : { - "counter" : "Paket %{counter}", - "id" : "Paket #%{id}" - }, - "Package content type" : "Paketinhaltstyp", - "Package created" : "Paket erstellt", - "Package deleted" : "Paket gelöscht", - "Package name" : "Paketnamen", - "Package type" : "Pakettyp", - "Package updated" : "Paket aktualisiert", - "Packages" : "Pakete", - "Period end" : "Perioden Ende", - "Period note" : "Zeitraum beachten", - "Period start" : "Beginn der Periode", - "Periods" : "Perioden", - "Physical location" : "Physischer Standort", - "Please enter a search term" : "Bitte geben Sie einen Suchbegriff ein", - "Print-format identifier" : "Kennung des Druckformats", - "Proxy" : "Proxy", - "Publication title" : "Veröffentlichungstitel", - "Publication type" : "Art der Veröffentlichung", - "Publisher name" : "Name des Herausgebers", - "Related agreement" : "Verbundene Vereinbarung", - "Related agreement " : { - "counter" : "Zugehörige Vereinbarung %{counter}" - }, - "Related agreements" : "Verwandte Vereinbarungen", - "Relationship" : "Beziehung", - "Remove from this package" : "Aus diesem Paket entfernen", - "Remove this agreement" : "Entfernen Sie diese Vereinbarung", - "Remove this document" : "Entfernen Sie dieses Dokument", - "Remove this license" : "Entfernen Sie diese Lizenz", - "Remove this period" : "Entfernen Sie diesen Zeitraum", - "Remove this relationship" : "Entfernen Sie diese Beziehung", - "Remove this user" : "Entfernen Sie diesen Benutzer", - "Renewal priority" : "Erneuerungspriorität", - "Required" : "Erforderlich", - "Resource" : "Ressource", - "Resource " : { - "id" : "Ressource #%{id}" - }, - "Resource identifier" : "Ressourcenkennung", - "Resource information" : "Ressourceninformationen", - "Role" : "Rolle", - "Select a file" : "Wählen Sie eine Datei aus", - "Select user" : "Nutzer wählen", - "Selected" : "Ausgewählt", - "Selection status" : "Auswahlstatus", - "Show agreement" : "Zustimmung zeigen", - "Show filters" : "Filter anzeigen", - "Show license" : "Lizenz zeigen", - "Show package" : "Paket anzeigen", - "Show title" : "Titel anzeigen", - "Start date" : "Anfangsdatum", - "Started on" : "Begann am", - "Status" : "Status", - "Submit" : "Einreichen", - "The E-Resource management module is disabled, turn on 'ERMModule' to use it" : "Das E-Ressourcen-Verwaltungsmodul ist deaktiviert, schalten Sie „ERMModule“ ein, um es zu verwenden", - "There are no agreements created yet" : "Es wurden noch keine Vereinbarungen erstellt.", - "There are no agreements defined" : "Es sind keine Vereinbarungen definiert.", - "There are no licenses created yet" : "Es wurden noch keine Lizenzen erstellt.", - "There are no licenses defined" : "Es sind keine Lizenzen definiert.", - "There are no other agreements created yet" : "Es wurden noch keine anderen Vereinbarungen erstellt.", - "There are no packages created yet" : "Es wurden noch keine Pakete erstellt.", - "There are no packages defined" : "Es sind keine Pakete definiert.", - "There are no titles defined" : "Es sind keine Titel definiert.", - "This agreement is already linked with this package" : "Diese Vereinbarung ist bereits mit diesem Paket verknüpft", - "Title" : "Titel", - "Title " : { - "id" : "Titel #%{id}" - }, - "Title created" : "Titel erstellt", - "Title deleted" : "Titel gelöscht", - "Title identifier" : "Titelkennung", - "Title identifier of any preceding publication title" : "Titelkennung eines vorangegangenen Veröffentlichungstitels", - "Title identifier of the parent publication" : "Titelkennung der übergeordneten Publikation", - "Title updated" : "Titel aktualisiert", - "Title-level URL" : "URL auf Titelebene", - "Titles" : "Titel", - "Titles ({count})" : "Titel ({count})", - "To the following local package" : "Zum folgenden lokalen Paket", - "Type" : "Typ", - "URI" : "URI", - "Update file" : "Update-Datei", - "Uploaded on" : "Hochgeladen am", - "User" : "Benutzer", - "Users" : "Benutzer", - "Vendor" : "Verkäufer", - "Yes, delete" : "Ja, löschen", - "eHoldings" : "eBestände", - "hello" : "hallo", - "language" : "Sprache", - "see job #%s" : "Siehe Job #%s", - "tos" : "zu", - "{count} packages found locally" : "{count} Pakete lokal gefunden", - "{count} titles found locally" : "{count} Titel lokal gefunden" -} - diff --git a/koha-tmpl/intranet-tmpl/prog/js/vue/locales/en.json b/koha-tmpl/intranet-tmpl/prog/js/vue/locales/en.json deleted file mode 100644 index 01d2d897d7..0000000000 --- a/koha-tmpl/intranet-tmpl/prog/js/vue/locales/en.json +++ /dev/null @@ -1,228 +0,0 @@ -{ - "/" : "/", - "A license is used several times" : "A license is used several times", - "A package is used several times" : "A package is used several times", - "Access type" : "Access type", - "Add agreement" : "Add agreement", - "Add license" : "Add license", - "Add new agreement" : "Add new agreement", - "Add new document" : "Add new document", - "Add new license" : "Add new license", - "Add new period" : "Add new period", - "Add new related agreement" : "Add new related agreement", - "Add new user" : "Add new user", - "Add package" : "Add package", - "Add title" : "Add title", - "Add to another package" : "Add to another package", - "Agreement" : "Agreement", - "Agreement " : { - "counter" : "Agreement %{counter}", - "id" : "Agreement #%{id}" - }, - "Agreement created" : "Agreement created", - "Agreement deleted" : "Agreement deleted", - "Agreement license " : { - "counter" : "Agreement license %{counter}" - }, - "Agreement name" : "Agreement name", - "Agreement period " : { - "counter" : "Agreement period %{counter}" - }, - "Agreement updated" : "Agreement updated", - "Agreement user " : { - "counter" : "Agreement user %{counter}" - }, - "Agreements" : "Agreements", - "All" : "All", - "An agreement is used as relationship several times" : "An agreement is used as relationship several times", - "An agreement is used several times" : "An agreement is used several times", - "Cancel" : "Cancel", - "Cancellation deadline" : "Cancellation deadline", - "Cannot import, no package selected" : "Cannot import, no package selected", - "Close" : "Close", - "Closure reason" : "Closure reason", - "Content type" : "Content type", - "Content type: " : "Content type: ", - "Coverage dates" : "Coverage dates", - "Coverage depth" : "Coverage depth", - "Created on" : "Created on", - "Date of first serial issue available online" : "Date of first serial issue available online", - "Date of last issue available online" : "Date of last issue available online", - "Date the monograph is first published in print" : "Date the monograph is first published in print", - "Date the monograph is first published online" : "Date the monograph is first published online", - "Delete" : "Delete", - "Delete agreement" : "Delete agreement", - "Delete license" : "Delete license", - "Delete package" : "Delete package", - "Delete title" : "Delete title", - "Description" : "Description", - "Document " : { - "counter" : "Document %{counter}" - }, - "Documents" : "Documents", - "E-Resource management" : "E-Resource management", - "EBSCO" : "EBSCO", - "Edit" : "Edit", - "Edit agreement" : "Edit agreement", - "Edit agreement " : { - "id" : "Edit agreement #%{id}" - }, - "Edit license" : "Edit license", - "Edit license " : { - "id" : "Edit license #%{id}" - }, - "Edit package" : "Edit package", - "Edit package " : { - "id" : "Edit package #%{id}" - }, - "Edit title" : "Edit title", - "Edit title " : { - "id" : "Edit title #%{id}" - }, - "Edition of the monograph" : "Edition of the monograph", - "Embargo information" : "Embargo information", - "End date" : "End date", - "Ended on" : "Ended on", - "External ID" : "External ID", - "File" : "File", - "File description" : "File description", - "File name" : "File name", - "File type" : "File type", - "Filter" : "Filter", - "Filter by expired" : "Filter by expired", - "First author" : "First author", - "First editor" : "First editor", - "Hide filters" : "Hide filters", - "Home" : "Home", - "Import from a list" : "Import from a list", - "Import from list" : "Import from list", - "Import in progress," : "Import in progress,", - "Is perpetual" : "Is perpetual", - "License" : "License", - "License " : { - "id" : "License #%{id}" - }, - "License created" : "License created", - "License deleted" : "License deleted", - "License info" : "License info", - "License name" : "License name", - "License updated" : "License updated", - "Licenses" : "Licenses", - "Loading" : "Loading", - "Local" : "Local", - "Local bibliographic record" : "Local bibliographic record", - "Name" : "Name", - "New agreement" : "New agreement", - "New license" : "New license", - "New package" : "New package", - "New title" : "New title", - "No, do not delete" : "No, do not delete", - "Not selected" : "Not selected", - "Notes" : "Notes", - "Number of first issue available online" : "Number of first issue available online", - "Number of first volume available online" : "Number of first volume available online", - "Number of last issue available online" : "Number of last issue available online", - "Number of last volume available online" : "Number of last volume available online", - "Number of volume for monograph" : "Number of volume for monograph", - "Online-format identifier" : "Online-format identifier", - "Only one controlling license is allowed" : "Only one controlling license is allowed", - "Package" : "Package", - "Package " : { - "counter" : "Package %{counter}", - "id" : "Package #%{id}" - }, - "Package content type" : "Package content type", - "Package created" : "Package created", - "Package deleted" : "Package deleted", - "Package name" : "Package name", - "Package type" : "Package type", - "Package updated" : "Package updated", - "Packages" : "Packages", - "Period end" : "Period end", - "Period note" : "Period note", - "Period start" : "Period start", - "Periods" : "Periods", - "Physical location" : "Physical location", - "Please enter a search term" : "Please enter a search term", - "Print-format identifier" : "Print-format identifier", - "Proxy" : "Proxy", - "Publication title" : "Publication title", - "Publication type" : "Publication type", - "Publisher name" : "Publisher name", - "Related agreement" : "Related agreement", - "Related agreement " : { - "counter" : "Related agreement %{counter}" - }, - "Related agreements" : "Related agreements", - "Relationship" : "Relationship", - "Remove from this package" : "Remove from this package", - "Remove this agreement" : "Remove this agreement", - "Remove this document" : "Remove this document", - "Remove this license" : "Remove this license", - "Remove this period" : "Remove this period", - "Remove this relationship" : "Remove this relationship", - "Remove this user" : "Remove this user", - "Renewal priority" : "Renewal priority", - "Required" : "Required", - "Resource" : "Resource", - "Resource " : { - "id" : "Resource #%{id}" - }, - "Resource identifier" : "Resource identifier", - "Resource information" : "Resource information", - "Role" : "Role", - "Select a file" : "Select a file", - "Select user" : "Select user", - "Selected" : "Selected", - "Selection status" : "Selection status", - "Show agreement" : "Show agreement", - "Show filters" : "Show filters", - "Show license" : "Show license", - "Show package" : "Show package", - "Show title" : "Show title", - "Start date" : "Start date", - "Started on" : "Started on", - "Status" : "Status", - "Submit" : "Submit", - "The E-Resource management module is disabled, turn on 'ERMModule' to use it" : "The E-Resource management module is disabled, turn on 'ERMModule' to use it", - "There are no agreements created yet" : "There are no agreements created yet.", - "There are no agreements defined" : "There are no agreements defined.", - "There are no licenses created yet" : "There are no licenses created yet.", - "There are no licenses defined" : "There are no licenses defined.", - "There are no other agreements created yet" : "There are no other agreements created yet.", - "There are no packages created yet" : "There are no packages created yet.", - "There are no packages defined" : "There are no packages defined.", - "There are no titles defined" : "There are no titles defined.", - "This agreement is already linked with this package" : "This agreement is already linked with this package", - "Title" : "Title", - "Title " : { - "id" : "Title #%{id}" - }, - "Title created" : "Title created", - "Title deleted" : "Title deleted", - "Title identifier" : "Title identifier", - "Title identifier of any preceding publication title" : "Title identifier of any preceding publication title", - "Title identifier of the parent publication" : "Title identifier of the parent publication", - "Title updated" : "Title updated", - "Title-level URL" : "Title-level URL", - "Titles" : "Titles", - "Titles ({count})" : "Titles ({count})", - "To the following local package" : "To the following local package", - "Type" : "Type", - "URI" : "URI", - "Update file" : "Update file", - "Uploaded on" : "Uploaded on", - "User" : "User", - "Users" : "Users", - "Vendor" : "Vendor", - "Yes, delete" : "Yes, delete", - "eHoldings" : "eHoldings", - "hello" : "hello", - "language" : "language", - "on" : "on", - "see job #%s" : "see job #%s", - "tos" : "tos", - "{count} packages found locally" : "{count} packages found locally", - "{count} titles found locally" : "{count} titles found locally" -} - diff --git a/koha-tmpl/intranet-tmpl/prog/js/vue/locales/es-ES.json b/koha-tmpl/intranet-tmpl/prog/js/vue/locales/es-ES.json deleted file mode 100644 index b877b5c44e..0000000000 --- a/koha-tmpl/intranet-tmpl/prog/js/vue/locales/es-ES.json +++ /dev/null @@ -1,225 +0,0 @@ -{ - "/" : "/", - "A license is used several times" : "Una licencia se usa varias veces", - "A package is used several times" : "Un paquete se usa varias veces.", - "Access type" : "Tipo de acceso", - "Add agreement" : "Agregar acuerdo", - "Add license" : "Agregar licencia", - "Add new agreement" : "Agregar nuevo acuerdo", - "Add new document" : "Agregar nuevo documento", - "Add new license" : "Agregar nueva licencia", - "Add new period" : "Agregar nuevo período", - "Add new related agreement" : "Agregar nuevo acuerdo relacionado", - "Add new user" : "Añadir nuevo usuario", - "Add package" : "Agregar paquete", - "Add title" : "Añadir título", - "Add to another package" : "Agregar a otro paquete", - "Agreement" : "Convenio", - "Agreement " : { - "counter" : "Acuerdo %{contador}", - "id" : "Acuerdo #%{id}" - }, - "Agreement created" : "Acuerdo creado", - "Agreement deleted" : "Acuerdo eliminado", - "Agreement license " : { - "counter" : "Acuerdo de licencia %{counter}" - }, - "Agreement name" : "Nombre del acuerdo", - "Agreement period " : { - "counter" : "Periodo de contrato %{counter}" - }, - "Agreement updated" : "Acuerdo actualizado", - "Agreement user " : { - "counter" : "Acuerdo usuario %{counter}" - }, - "Agreements" : "Acuerdos", - "All" : "Todos", - "An agreement is used several times" : "Un acuerdo se utiliza varias veces.", - "Cancel" : "Cancelar", - "Cancellation deadline" : "Plazo de cancelación", - "Cannot import, no package selected" : "No se puede importar, no se seleccionó ningún paquete", - "Close" : "Cerca", - "Closure reason" : "motivo de cierre", - "Content type" : "Tipo de contenido", - "Content type: " : "Tipo de contenido:", - "Coverage dates" : "Fechas de cobertura", - "Coverage depth" : "Profundidad de cobertura", - "Created on" : "Creado en", - "Date of first serial issue available online" : "Fecha de la primera edición en serie disponible en línea", - "Date of last issue available online" : "Fecha del último número disponible en línea", - "Date the monograph is first published in print" : "Fecha en que la monografía se publica por primera vez en forma impresa", - "Date the monograph is first published online" : "Fecha en que la monografía se publica por primera vez en línea", - "Delete" : "Borrar", - "Delete agreement" : "Eliminar acuerdo", - "Delete license" : "Eliminar licencia", - "Delete package" : "Eliminar paquete", - "Delete title" : "Eliminar título", - "Description" : "Descripción", - "Document " : { - "counter" : "Documento %{contador}" - }, - "Documents" : "Documentos", - "E-Resource management" : "Gestión de recursos electrónicos", - "EBSCO" : "EBSCO", - "Edit" : "Editar", - "Edit agreement" : "Editar acuerdo", - "Edit agreement " : { - "id" : "Editar acuerdo #%{id}" - }, - "Edit license" : "Editar licencia", - "Edit license " : { - "id" : "Editar licencia #%{id}" - }, - "Edit package" : "Editar paquete", - "Edit package " : { - "id" : "Editar paquete #%{id}" - }, - "Edit title" : "Editar título", - "Edit title " : { - "id" : "Editar título #%{id}" - }, - "Edition of the monograph" : "edición de la monografía", - "Embargo information" : "información de embargo", - "End date" : "Fecha final", - "Ended on" : "Terminado el", - "External ID" : "Identificación externa", - "File" : "Expediente", - "File description" : "Descripción del archivo", - "File name" : "Nombre del archivo", - "File type" : "Tipo de archivo", - "Filter" : "Filtrar", - "First author" : "Primer autor", - "First editor" : "primer editor", - "Hide filters" : "Ocultar filtros", - "Home" : "Hogar", - "Import from a list" : "Importar desde una lista", - "Import from list" : "Importar de la lista", - "Import in progress," : "Importación en curso,", - "Is perpetual" : "es perpetuo", - "License" : "Licencia", - "License " : { - "id" : "Licencia #%{id}" - }, - "License created" : "Licencia creada", - "License deleted" : "Licencia eliminada", - "License info" : "Información de licencia", - "License name" : "Nombre de la licencia", - "License updated" : "Licencia actualizada", - "Licenses" : "Licencias", - "Loading" : "Cargando", - "Local" : "Local", - "Local bibliographic record" : "Registro bibliográfico local", - "Name" : "Nombre", - "New agreement" : "Nuevo acuerdo", - "New license" : "Nueva licencia", - "New package" : "Nuevo paquete", - "New title" : "Nuevo título", - "No, do not delete" : "no, no borrar", - "Not selected" : "No seleccionado", - "Notes" : "notas", - "Number of first issue available online" : "Número del primer número disponible en línea", - "Number of first volume available online" : "Número del primer volumen disponible en línea", - "Number of last issue available online" : "Número del último número disponible en línea", - "Number of last volume available online" : "Número del último volumen disponible en línea", - "Number of volume for monograph" : "Número de volumen para monografía", - "Online-format identifier" : "Identificador de formato en línea", - "Only one controlling license is allowed" : "Solo se permite una licencia de control", - "Package" : "Paquete", - "Package " : { - "counter" : "Paquete %{contador}", - "id" : "Paquete #%{id}" - }, - "Package content type" : "Tipo de contenido del paquete", - "Package created" : "Paquete creado", - "Package deleted" : "Paquete eliminado", - "Package name" : "Nombre del paquete", - "Package type" : "Tipo de paquete", - "Package updated" : "Paquete actualizado", - "Packages" : "Paquetes", - "Period end" : "Fin del período", - "Period note" : "Nota de período", - "Period start" : "Inicio del período", - "Periods" : "Períodos", - "Physical location" : "Localizacion fisica", - "Please enter a search term" : "Por favor ingrese un término de búsqueda", - "Print-format identifier" : "Identificador de formato de impresión", - "Proxy" : "Apoderado", - "Publication title" : "Título de la publicación", - "Publication type" : "Tipo de publicación", - "Publisher name" : "Nombre del editor", - "Related agreement" : "Acuerdo relacionado", - "Related agreement " : { - "counter" : "Acuerdo relacionado %{counter}" - }, - "Related agreements" : "Acuerdos relacionados", - "Relationship" : "Relación", - "Remove from this package" : "Eliminar de este paquete", - "Remove this agreement" : "Eliminar este acuerdo", - "Remove this document" : "Eliminar este documento", - "Remove this license" : "Eliminar esta licencia", - "Remove this period" : "Eliminar este período", - "Remove this relationship" : "Eliminar esta relación", - "Remove this user" : "Eliminar este usuario", - "Renewal priority" : "Prioridad de renovación", - "Required" : "Requerido", - "Resource" : "Recurso", - "Resource " : { - "id" : "Recurso #%{id}" - }, - "Resource identifier" : "Identificador de recursos", - "Resource information" : "información de recursos", - "Role" : "Role", - "Select a file" : "Seleccione un archivo", - "Select user" : "Seleccionar usuario", - "Selected" : "Seleccionado", - "Selection status" : "Estado de selección", - "Show agreement" : "Mostrar acuerdo", - "Show filters" : "Mostrar filtros", - "Show license" : "Mostrar licencia", - "Show package" : "Mostrar paquete", - "Show title" : "Mostrar título", - "Start date" : "Fecha de inicio", - "Started on" : "Comenzó en", - "Status" : "Estado", - "Submit" : "Enviar", - "The E-Resource management module is disabled, turn on 'ERMModule' to use it" : "El módulo de gestión de recursos electrónicos está deshabilitado, active 'ERMModule' para usarlo", - "There are no agreements created yet" : "No hay acuerdos creados todavía.", - "There are no agreements defined" : "No hay acuerdos definidos.", - "There are no licenses created yet" : "No hay licencias creadas todavía.", - "There are no licenses defined" : "No hay licencias definidas.", - "There are no other agreements created yet" : "No hay otros acuerdos creados todavía.", - "There are no packages created yet" : "No hay paquetes creados todavía.", - "There are no packages defined" : "No hay paquetes definidos.", - "There are no titles defined" : "No hay títulos definidos.", - "This agreement is already linked with this package" : "Este acuerdo ya está vinculado con este paquete", - "Title" : "Título", - "Title " : { - "id" : "Título #%{id}" - }, - "Title created" : "Título creado", - "Title deleted" : "Título eliminado", - "Title identifier" : "Identificador de título", - "Title identifier of any preceding publication title" : "Identificador de título de cualquier título de publicación anterior", - "Title identifier of the parent publication" : "Identificador del título de la publicación principal", - "Title updated" : "Título actualizado", - "Title-level URL" : "URL de nivel de título", - "Titles" : "Títulos", - "Titles ({count})" : "Títulos ({count})", - "To the following local package" : "Al siguiente paquete local", - "Type" : "Escribe", - "URI" : "URI", - "Update file" : "Actualizar archivo", - "Uploaded on" : "Subido en", - "User" : "Usuario", - "Users" : "Usuarios", - "Vendor" : "Vendedor", - "Yes, delete" : "si, borrar", - "eHoldings" : "eHoldings", - "hello" : "Hola", - "language" : "idioma", - "see job #%s" : "ver trabajo #%s", - "tos" : "tos", - "{count} packages found locally" : "{count} paquetes encontrados localmente", - "{count} titles found locally" : "{count} títulos encontrados localmente" -} - diff --git a/koha-tmpl/intranet-tmpl/prog/js/vue/locales/fr-FR.json b/koha-tmpl/intranet-tmpl/prog/js/vue/locales/fr-FR.json deleted file mode 100644 index 6de3e9fad0..0000000000 --- a/koha-tmpl/intranet-tmpl/prog/js/vue/locales/fr-FR.json +++ /dev/null @@ -1,225 +0,0 @@ -{ - "/" : "/", - "A license is used several times" : "Une licence est utilisée plusieurs fois", - "A package is used several times" : "Un paquet est utilisé plusieurs fois", - "Access type" : "Type d'accès", - "Add agreement" : "Ajouter un accord", - "Add license" : "Ajouter une licence", - "Add new agreement" : "Ajouter un nouvel accord", - "Add new document" : "Ajouter un nouveau document", - "Add new license" : "Ajouter une nouvelle licence", - "Add new period" : "Ajouter une nouvelle période", - "Add new related agreement" : "Ajouter un nouvel accord connexe", - "Add new user" : "Ajouter un nouvel utilisateur", - "Add package" : "Ajouter un forfait", - "Add title" : "Ajouter un titre", - "Add to another package" : "Ajouter à un autre forfait", - "Agreement" : "Accord", - "Agreement " : { - "counter" : "Accord %{counter}", - "id" : "Accord #%{id}" - }, - "Agreement created" : "Accord créé", - "Agreement deleted" : "Accord supprimé", - "Agreement license " : { - "counter" : "Contrat de licence %{counter}" - }, - "Agreement name" : "Nom de l'accord", - "Agreement period " : { - "counter" : "Période d'accord %{counter}" - }, - "Agreement updated" : "Accord mis à jour", - "Agreement user " : { - "counter" : "Utilisateur de l'accord %{counter}" - }, - "Agreements" : "les accords", - "All" : "Tout", - "An agreement is used several times" : "Un accord est utilisé plusieurs fois", - "Cancel" : "Annuler", - "Cancellation deadline" : "Délai d'annulation", - "Cannot import, no package selected" : "Impossible d'importer, aucun package sélectionné", - "Close" : "proche", - "Closure reason" : "Raison de la fermeture", - "Content type" : "Type de contenu", - "Content type: " : "Type de contenu :", - "Coverage dates" : "Dates de couverture", - "Coverage depth" : "Profondeur de couverture", - "Created on" : "Créé sur", - "Date of first serial issue available online" : "Date du premier numéro de série disponible en ligne", - "Date of last issue available online" : "Date du dernier numéro disponible en ligne", - "Date the monograph is first published in print" : "Date à laquelle la monographie est publiée pour la première fois en version imprimée", - "Date the monograph is first published online" : "Date à laquelle la monographie est publiée pour la première fois en ligne", - "Delete" : "Effacer", - "Delete agreement" : "Supprimer l'accord", - "Delete license" : "Supprimer la licence", - "Delete package" : "Supprimer le package", - "Delete title" : "Supprimer le titre", - "Description" : "La description", - "Document " : { - "counter" : "Document %{compteur}" - }, - "Documents" : "Documents", - "E-Resource management" : "Gestion des ressources électroniques", - "EBSCO" : "EBSCO", - "Edit" : "Éditer", - "Edit agreement" : "Modifier l'accord", - "Edit agreement " : { - "id" : "Modifier l'accord #%{id}" - }, - "Edit license" : "Modifier la licence", - "Edit license " : { - "id" : "Modifier la licence # %{id}" - }, - "Edit package" : "Modifier le forfait", - "Edit package " : { - "id" : "Modifier le package #%{id}" - }, - "Edit title" : "Modifier le titre", - "Edit title " : { - "id" : "Modifier le titre # %{id}" - }, - "Edition of the monograph" : "Édition de la monographie", - "Embargo information" : "Informations sur l'embargo", - "End date" : "Date de fin", - "Ended on" : "Terminé le", - "External ID" : "ID externe", - "File" : "Dossier", - "File description" : "Description du fichier", - "File name" : "Nom de fichier", - "File type" : "Type de fichier", - "Filter" : "Filtre", - "First author" : "Premier auteur", - "First editor" : "Premier éditeur", - "Hide filters" : "Masquer les filtres", - "Home" : "Maison", - "Import from a list" : "Importer à partir d'une liste", - "Import from list" : "Importer depuis la liste", - "Import in progress," : "Importation en cours,", - "Is perpetual" : "Est perpétuel", - "License" : "Licence", - "License " : { - "id" : "Licence # %{id}" - }, - "License created" : "Licence créée", - "License deleted" : "Licence supprimée", - "License info" : "Informations sur la licence", - "License name" : "Nom de la licence", - "License updated" : "Licence mise à jour", - "Licenses" : "Licences", - "Loading" : "Chargement", - "Local" : "Local", - "Local bibliographic record" : "Notice bibliographique locale", - "Name" : "Nom", - "New agreement" : "Nouvel accord", - "New license" : "Nouvelle licence", - "New package" : "Nouveau forfait", - "New title" : "Nouveau titre", - "No, do not delete" : "Non, ne supprimez pas", - "Not selected" : "Non séléctionné", - "Notes" : "Remarques", - "Number of first issue available online" : "Numéro du premier numéro disponible en ligne", - "Number of first volume available online" : "Numéro du premier tome disponible en ligne", - "Number of last issue available online" : "Numéro du dernier numéro disponible en ligne", - "Number of last volume available online" : "Numéro du dernier tome disponible en ligne", - "Number of volume for monograph" : "Numéro de volume pour la monographie", - "Online-format identifier" : "Identifiant au format en ligne", - "Only one controlling license is allowed" : "Une seule licence de contrôle est autorisée", - "Package" : "Forfait", - "Package " : { - "counter" : "Forfait %{counter}", - "id" : "Paquet #%{id}" - }, - "Package content type" : "Type de contenu du package", - "Package created" : "Forfait créé", - "Package deleted" : "Forfait supprimé", - "Package name" : "Nom du paquet", - "Package type" : "Type d'emballage", - "Package updated" : "Paquet mis à jour", - "Packages" : "Paquets", - "Period end" : "Fin de période", - "Period note" : "Note d'époque", - "Period start" : "Début de période", - "Periods" : "Périodes", - "Physical location" : "Emplacement physique", - "Please enter a search term" : "Veuillez entrer un terme de recherche", - "Print-format identifier" : "Identifiant du format d'impression", - "Proxy" : "Procuration", - "Publication title" : "Titre de publication", - "Publication type" : "Type de parution", - "Publisher name" : "Nom de l'éditeur", - "Related agreement" : "Accord connexe", - "Related agreement " : { - "counter" : "Accord associé %{counter}" - }, - "Related agreements" : "Accords connexes", - "Relationship" : "Relation", - "Remove from this package" : "Supprimer de ce package", - "Remove this agreement" : "Supprimer cet accord", - "Remove this document" : "Supprimer ce document", - "Remove this license" : "Supprimer cette licence", - "Remove this period" : "Supprimer cette période", - "Remove this relationship" : "Supprimer cette relation", - "Remove this user" : "Supprimer cet utilisateur", - "Renewal priority" : "Priorité de renouvellement", - "Required" : "Obligatoire", - "Resource" : "Ressource", - "Resource " : { - "id" : "Ressource #%{id}" - }, - "Resource identifier" : "Identifiant de ressource", - "Resource information" : "Informations sur les ressources", - "Role" : "Rôle", - "Select a file" : "Sélectionner un fichier", - "Select user" : "Sélectionnez l'utilisateur", - "Selected" : "Choisi", - "Selection status" : "Statut de sélection", - "Show agreement" : "Afficher l'accord", - "Show filters" : "Afficher les filtres", - "Show license" : "Afficher la licence", - "Show package" : "Afficher le forfait", - "Show title" : "Montrer le titre", - "Start date" : "Date de début", - "Started on" : "Commencé sur", - "Status" : "Statut", - "Submit" : "Soumettre", - "The E-Resource management module is disabled, turn on 'ERMModule' to use it" : "Le module de gestion des ressources électroniques est désactivé, activez 'ERMModule' pour l'utiliser", - "There are no agreements created yet" : "Il n'y a pas encore d'accords créés.", - "There are no agreements defined" : "Il n'y a pas d'accords définis.", - "There are no licenses created yet" : "Il n'y a pas encore de licences créées.", - "There are no licenses defined" : "Aucune licence n'est définie.", - "There are no other agreements created yet" : "Il n'y a pas encore d'autres accords créés.", - "There are no packages created yet" : "Il n'y a pas encore de packages créés.", - "There are no packages defined" : "Il n'y a pas de packages définis.", - "There are no titles defined" : "Il n'y a pas de titres définis.", - "This agreement is already linked with this package" : "Cet accord est déjà lié à ce forfait", - "Title" : "Titre", - "Title " : { - "id" : "Titre #%{id}" - }, - "Title created" : "Titre créé", - "Title deleted" : "Titre supprimé", - "Title identifier" : "Identifiant du titre", - "Title identifier of any preceding publication title" : "Identifiant du titre de tout titre de publication précédent", - "Title identifier of the parent publication" : "Identifiant du titre de la publication parente", - "Title updated" : "Titre mis à jour", - "Title-level URL" : "URL au niveau du titre", - "Titles" : "Titres", - "Titles ({count})" : "Titres ({count})", - "To the following local package" : "Vers le package local suivant", - "Type" : "Taper", - "URI" : "URI", - "Update file" : "Fichier de mise à jour", - "Uploaded on" : "Téléchargé le", - "User" : "Utilisateur", - "Users" : "Utilisateurs", - "Vendor" : "Vendeur", - "Yes, delete" : "Oui, supprimer", - "eHoldings" : "eHoldings", - "hello" : "bonjour", - "language" : "Langue", - "see job #%s" : "voir le travail #%s", - "tos" : "tos", - "{count} packages found locally" : "{count} paquets trouvés localement", - "{count} titles found locally" : "{count} titres trouvés localement" -} - diff --git a/koha-tmpl/intranet-tmpl/prog/js/vue/main-erm.ts b/koha-tmpl/intranet-tmpl/prog/js/vue/main-erm.ts index ad259bc2e8..c1361e4f54 100644 --- a/koha-tmpl/intranet-tmpl/prog/js/vue/main-erm.ts +++ b/koha-tmpl/intranet-tmpl/prog/js/vue/main-erm.ts @@ -25,18 +25,16 @@ import { useMainStore } from "./stores/main"; import { useVendorStore } from "./stores/vendors"; import { useAVStore } from "./stores/authorised_values"; -import { createI18n } from "vue-i18n"; +const pinia = createPinia(); -// FIXME How do we load the locale list? -import * as en from "./locales/en.json"; // We could async the load here, see https://vue-i18n.intlify.dev/guide/advanced/lazy.html -import * as de_DE from "./locales/de-DE.json"; -import * as es_ES from "./locales/es-ES.json"; -import * as fr_FR from "./locales/fr-FR.json"; -const languages = { en, "de-DE": de_DE, "es-ES": es_ES, "fr-FR": fr_FR }; -const messages = Object.assign(languages); -const i18n = createI18n({ locale: "en", messages }); +const i18n = { + install: (app, options) => { + app.config.globalProperties.__ = (key) => { + return window["__"](key); + }; + }, +}; -const pinia = createPinia(); const app = createApp(App); const rootComponent = app diff --git a/misc/translate_json.pl b/misc/translate_json.pl deleted file mode 100644 index a074816714..0000000000 --- a/misc/translate_json.pl +++ /dev/null @@ -1,46 +0,0 @@ -use Modern::Perl; - -use File::Slurp qw( read_file ); -use JSON qw( from_json to_json ); -use Encode qw( decode_utf8 ); - -our $lang = $ARGV[0] || 'en'; -my $json = read_file(sprintf 'koha-tmpl/intranet-tmpl/prog/js/vue/locales/%s.json', $lang); -$lang =~ s|-.*||; -my $h = from_json($json); -my $i; my $size = scalar keys %$h; -my $translated = {}; -while (my ($k, $v) = each %$h ){ - warn sprintf "%s - Translating string %s/%s\n", $lang, ++$i, $size; - if ( ref($v) ) { - for my $kk ( keys %$v ) { - ( my $vv = $k ) =~ s|\s*$||; - if ( $kk eq 'counter' ) { - $translated->{$k}->{counter} = translate("$vv \%{counter}"); - } elsif ( $kk eq 'id' ) { - $translated->{$k}->{id} = translate("$vv #\%{id}"); - } else { - die "INVALID structure with key " . $kk; - } - } - } elsif ( $k =~ /^There are no/ ) { - $translated->{$k} = translate("$k."); - } - else { - $translated->{$k} = translate($k); - } -} - -say to_json($translated, {utf8 => 1, pretty => 1, canonical => 1}); - -sub translate { - my ( $string) = @_; - my $translated = $string; - return "/" if $string eq "/"; - if ( $lang ne 'en' ) { - my $cmd = sprintf 'trans --brief :%s "%s"', $lang, $string; - $translated = decode_utf8 qx{$cmd}; - chomp $translated; - } - return $translated; -} diff --git a/package.json b/package.json index adf7147ed7..93faa22143 100644 --- a/package.json +++ b/package.json @@ -37,7 +37,6 @@ "style-loader": "^3.3.1", "vue": "^3.2.31", "vue-flatpickr-component": "^9", - "vue-i18n": "^9.1.10", "vue-router": "^4.0.14", "vue-select": "4.0.0-beta.3" }, -- 2.39.2