From af6a0b78b7d0e73176923d67501ef54511f6d435 Mon Sep 17 00:00:00 2001 From: Matt Blenkinsop Date: Fri, 10 May 2024 14:14:54 +0000 Subject: [PATCH] Bug 34788: (follow-up): Fix translations Signed-off-by: Katrin Fischer --- Koha/BackgroundJob/ImportKBARTFile.pm | 6 +-- .../import_from_kbart_file.inc | 10 ++-- .../ERM/EHoldingsLocalTitlesKBARTImport.vue | 47 ++++++++++--------- 3 files changed, 34 insertions(+), 29 deletions(-) diff --git a/Koha/BackgroundJob/ImportKBARTFile.pm b/Koha/BackgroundJob/ImportKBARTFile.pm index de9d9606ba..d17dcf502f 100644 --- a/Koha/BackgroundJob/ImportKBARTFile.pm +++ b/Koha/BackgroundJob/ImportKBARTFile.pm @@ -85,9 +85,8 @@ sub process { if ( scalar( @{$rows} ) == 0 ) { push @messages, { - code => 'job_failed', + code => 'no_rows', type => 'error', - error_message => 'No valid rows were found in this file. Please check the file formatting.', }; $self->status('failed')->store; } @@ -115,9 +114,8 @@ sub process { my $formatted_title = format_title($new_title); if ( !$formatted_title->{publication_title} ) { push @messages, { - code => 'title_failed', + code => 'no_title_found', type => 'error', - error_message => "No publication_title found for title_id: ", title => '(Unknown)', title_id => $formatted_title->{external_id} }; diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/background_jobs/import_from_kbart_file.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/background_jobs/import_from_kbart_file.inc index 04032e0f43..2cc00b2002 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/includes/background_jobs/import_from_kbart_file.inc +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/background_jobs/import_from_kbart_file.inc @@ -28,7 +28,7 @@ [% report.failed_imports | html %] - Click here to see the package + Package [% ELSIF job.status == 'started' %]

[% END %] @@ -57,10 +57,12 @@ [% SWITCH m.code %] [% CASE 'title_already_exists' %] [% m.title | html %] already exists and was not created. + [% CASE 'no_title_found' %] + Title [% m.title_id | html %] did not have a publication title and was not imported. [% CASE 'title_failed' %] - [% m.title | html %] failed to import - [% m.error_message | html %][% IF m.title_id %][% m.title_id | html %][% END %] - [% CASE 'job_failed' %] - Job failed - [% m.error_message | html %] + Title [% m.title_id | html %] failed to import with the following error: [% m.error_message | html %] + [% CASE 'no_rows' %] + No valid rows were found in this file. Please check the file formatting. [% END %] [% END %] diff --git a/koha-tmpl/intranet-tmpl/prog/js/vue/components/ERM/EHoldingsLocalTitlesKBARTImport.vue b/koha-tmpl/intranet-tmpl/prog/js/vue/components/ERM/EHoldingsLocalTitlesKBARTImport.vue index cc18bb1d18..22b275da86 100644 --- a/koha-tmpl/intranet-tmpl/prog/js/vue/components/ERM/EHoldingsLocalTitlesKBARTImport.vue +++ b/koha-tmpl/intranet-tmpl/prog/js/vue/components/ERM/EHoldingsLocalTitlesKBARTImport.vue @@ -12,8 +12,8 @@ ) }}
    -
  1. Column headings row
  2. -
  3. Title data row
  4. +
  5. {{ $__("Column headings row") }}
  6. +
  7. {{ $__("Title data row") }}
@@ -141,36 +141,41 @@ export default { let message = "" if (success.job_ids) { if (success.job_ids.length > 1) { - message += this.$__( - "

Your file was too large to process in one job, the file has been split into %s jobs to meet the maximum size limits.

" - ).format(success.job_ids.length) + message += `

${this.$__( + "Your file was too large to process in one job, the file has been split into %s jobs to meet the maximum size limits." + ).format(success.job_ids.length)}

` } success.job_ids.forEach((job, i) => { - message += this.$__( - '
  • Job %s for uploaded file has been queued, click here to check its progress.
  • ' - ).format(i + 1, job) + message += `
  • ${this.$__( + "Job %s for uploaded file has been queued" + ).format( + i + 1, + job + )}, ${this.$__( + "see progress" + )}
  • ` }) this.setMessage(message, true) } if (success.warnings.invalid_columns) { - message += this.$__( - "

    Information:

    " - ) - message += this.$__( - "

    Additional columns were detected in your report, please see the list below:

    " - ) + message += `

    ${this.$__( + "Information:" + )}

    ` + message += `

    ${this.$__( + "Additional columns were detected in your report, please see the list below:" + )}

    ` success.warnings.invalid_columns.forEach(column => { - message += this.$__(`
  • %s
  • `).format(column) + message += `
  • ${column}
  • ` }) - message += this.$__( - "

    The data in these columns will not be imported.

    " - ) + message += `

    ${this.$__( + "The data in these columns will not be imported." + )}

    ` this.setMessage(message, true) } if (success.invalid_filetype) { - message += this.$__( - "

    The file must be in .tsv or .csv format, please convert your file and try again.

    " - ) + message += `

    ${this.$__( + "The file must be in .tsv or .csv format, please convert your file and try again." + )}

    ` setWarning(message) } }, -- 2.39.2