From 9cce44c5cb6a418e5e2af3b86176986415649735 Mon Sep 17 00:00:00 2001 From: Bernardo Gonzalez Kriegel Date: Sat, 14 Mar 2020 21:00:24 -0300 Subject: [PATCH] Bug 24870: Translate installer data label This patch enable the translation of the labels 'Mandatory' or 'Optional' present at install time for groups of installer files. To test: 1) Try install using de-DE language, at step3 verify 'Mandatory' and 'Optional' labels for marc21 or other data checklist Do not close this window! 2) Apply this patch 3) Update de-DE translation files, reinstall lang files cd misc/translator ./translate update de-DE ./translate install de-DE 4) Reload page at step3, now 'Mandatory' label is translated to 'Pflichtfeld' 5) Verify strings in translation file Search for ^msgid \"Mandatory\" ^msgid \"Optional\" in po/de-DE-staff-prog.po. Signed-off-by: Jonathan Druart Signed-off-by: Martin Renvoize Signed-off-by: Joy Nelson (cherry picked from commit 1adc4986e9d2f715f44ef4b99b5dece79845f885) Signed-off-by: Lucas Gass (cherry picked from commit 42bc9671ca47272258cecde2abccdef521a58b56) Signed-off-by: Hayley Mapley --- C4/Installer.pm | 4 ++-- .../intranet-tmpl/prog/en/modules/installer/step3.tt | 10 ++++++++-- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/C4/Installer.pm b/C4/Installer.pm index b62f8431af..1b21660cc1 100644 --- a/C4/Installer.pm +++ b/C4/Installer.pm @@ -169,7 +169,7 @@ sub marc_framework_sql_list { sort { $a->{'fwkname'} cmp $b->{'fwkname'} } @frameworklist; $cell{"frameworks"} = \@fwks; - $cell{"label"} = ucfirst($requirelevel); + $cell{"label"} = ($requirelevel =~ /(mandatory|requi|oblig|necess)/i)?'mandatory':'optional'; $cell{"code"} = lc($requirelevel); push @fwklist, \%cell; } @@ -245,7 +245,7 @@ sub sample_data_sql_list { my @fwks = sort { $a->{'fwkname'} cmp $b->{'fwkname'} } @frameworklist; $cell{"frameworks"} = \@fwks; - $cell{"label"} = ucfirst($requirelevel); + $cell{"label"} = ($requirelevel =~ /(mandatory|requi|oblig|necess)/i)?'mandatory':'optional'; $cell{"code"} = lc($requirelevel); push @levellist, \%cell; } diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/installer/step3.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/installer/step3.tt index 9f37a5abc1..d6bcaedd76 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/installer/step3.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/installer/step3.tt @@ -88,7 +88,10 @@ Defaulting to the frameworks supplied for English (en) [% END %] [% FOREACH frameworksloo IN frameworksloop %] -

[% frameworksloo.label | html %]

+ [%- SWITCH frameworksloo.label -%] + [%- CASE 'mandatory' -%]

Mandatory

+ [%- CASE 'optional' -%]

Optional

+ [%- END -%]
@@ -125,7 +128,10 @@ [% END %] [% FOREACH levelloo IN levelloop %] -

[% levelloo.label | html %]

+ [%- SWITCH levelloo.label -%] + [%- CASE 'mandatory' -%]

Mandatory

+ [%- CASE 'optional' -%]

Optional

+ [%- END -%]
-- 2.39.5