Bug 34788: (follow-up): Fix translations

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
This commit is contained in:
Matt Blenkinsop 2024-05-10 14:14:54 +00:00 committed by Katrin Fischer
parent 2ab4b20aaa
commit af6a0b78b7
Signed by: kfischer
GPG key ID: 0EF6E2C03357A834
3 changed files with 34 additions and 29 deletions

View file

@ -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}
};

View file

@ -28,7 +28,7 @@
<td>[% report.failed_imports | html %]</td>
</tr>
</table>
<a href="/cgi-bin/koha/erm/eholdings/local/packages/[% report.package_id | $raw %]">Click here to see the package</a>
<a href="/cgi-bin/koha/erm/eholdings/local/packages/[% report.package_id | $raw %]">Package</a>
[% ELSIF job.status == 'started' %]
<p id="jobactionlabel"></p>
[% END %]
@ -57,10 +57,12 @@
[% SWITCH m.code %]
[% CASE 'title_already_exists' %]
<span><strong>[% m.title | html %]</strong> already exists and was not created.</span>
[% CASE 'no_title_found' %]
<span><strong>Title [% m.title_id | html %]</strong> did not have a publication title and was not imported.</span>
[% CASE 'title_failed' %]
<span><strong>[% m.title | html %]</strong> failed to import - [% m.error_message | html %][% IF m.title_id %][% m.title_id | html %][% END %]</span>
[% CASE 'job_failed' %]
<span>Job failed - [% m.error_message | html %]</span>
<span><strong>Title [% m.title_id | html %]</strong> failed to import with the following error: [% m.error_message | html %]</span>
[% CASE 'no_rows' %]
<span>No valid rows were found in this file. Please check the file formatting.</span>
[% END %]
</div>
[% END %]

View file

@ -12,8 +12,8 @@
)
}}
<ol>
<li>Column headings row</li>
<li>Title data row</li>
<li>{{ $__("Column headings row") }}</li>
<li>{{ $__("Title data row") }}</li>
</ol>
</li>
</ul>
@ -141,36 +141,41 @@ export default {
let message = ""
if (success.job_ids) {
if (success.job_ids.length > 1) {
message += this.$__(
"<p style='font-weight: normal; font-size: medium; margin-top: 1em;'>Your file was too large to process in one job, the file has been split into %s jobs to meet the maximum size limits.</p>"
).format(success.job_ids.length)
message += `<p style='font-weight: normal; font-size: medium; margin-top: 1em;'>${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)}</p>`
}
success.job_ids.forEach((job, i) => {
message += this.$__(
'<li>Job %s for uploaded file has been queued, <a href="/cgi-bin/koha/admin/background_jobs.pl?op=view&id=%s" target="_blank">click here</a> to check its progress.</li>'
).format(i + 1, job)
message += `<li>${this.$__(
"Job %s for uploaded file has been queued"
).format(
i + 1,
job
)}, <a href="/cgi-bin/koha/admin/background_jobs.pl?op=view&id=%s" target="_blank">${this.$__(
"see progress"
)}</a></li>`
})
this.setMessage(message, true)
}
if (success.warnings.invalid_columns) {
message += this.$__(
"<p style='font-weight: normal; font-size: medium; margin-top: 1em;'>Information:</p>"
)
message += this.$__(
"<p>Additional columns were detected in your report, please see the list below:</p>"
)
message += `<p style='font-weight: normal; font-size: medium; margin-top: 1em;'>${this.$__(
"Information:"
)}</p>`
message += `<p>${this.$__(
"Additional columns were detected in your report, please see the list below:"
)}</p>`
success.warnings.invalid_columns.forEach(column => {
message += this.$__(`<li>%s</li>`).format(column)
message += `<li>${column}</li>`
})
message += this.$__(
"<p style='margin-top: 0.1em;'>The data in these columns will not be imported.</p>"
)
message += `<p style='margin-top: 0.1em;'>${this.$__(
"The data in these columns will not be imported."
)}</p>`
this.setMessage(message, true)
}
if (success.invalid_filetype) {
message += this.$__(
"<p>The file must be in .tsv or .csv format, please convert your file and try again.</p>"
)
message += `<p>${this.$__(
"The file must be in .tsv or .csv format, please convert your file and try again."
)}</p>`
setWarning(message)
}
},