Bugzilla – Attachment 103072 Details for
Bug 24973
Allow to localize and translate system preferences with new yaml based installer
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 24973: Install localized sysprefs
Bug-24973-Install-localized-sysprefs.patch (text/plain), 2.87 KB, created by
Bernardo Gonzalez Kriegel
on 2020-04-16 11:15:59 UTC
(
hide
)
Description:
Bug 24973: Install localized sysprefs
Filename:
MIME Type:
Creator:
Bernardo Gonzalez Kriegel
Created:
2020-04-16 11:15:59 UTC
Size:
2.87 KB
patch
obsolete
>From 4fa05f4fc748208ddf00491bdc57e23f656fc305 Mon Sep 17 00:00:00 2001 >From: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com> >Date: Wed, 15 Apr 2020 18:55:33 -0300 >Subject: [PATCH] Bug 24973: Install localized sysprefs > >This patch changes installation files to >process and install locale_sysprefs.yml > >This file must be present on each install >dir. It complements sysprefs.sql, and is >processed just before it. > >To test for EN >1) Apply the patch >2) Do a normal install > only change to note is a new section > when installer reports installed files > named 'En data added', 'En' for english > and shows locale-syspref.yml >3) Verify no changes on sysprefs values >--- > C4/Installer.pm | 6 ++++-- > installer/install.pl | 5 ++++- > 2 files changed, 8 insertions(+), 3 deletions(-) > >diff --git a/C4/Installer.pm b/C4/Installer.pm >index db247e5243..2bbe9e8b57 100644 >--- a/C4/Installer.pm >+++ b/C4/Installer.pm >@@ -312,6 +312,7 @@ moved to a different method. > > sub load_sql_in_order { > my $self = shift; >+ my $langchoice = shift; > my $all_languages = shift; > my @sql_list = @_; > >@@ -330,6 +331,7 @@ sub load_sql_in_order { > my $global_mandatory_dir = C4::Context->config('intranetdir') . "/installer/data/$self->{dbms}/mandatory"; > > # Make sure some stuffs are loaded first >+ unshift(@fnames, C4::Context->config('intranetdir') . "/installer/data/$self->{dbms}/$langchoice/locale_sysprefs.yml"); > unshift(@fnames, C4::Context->config('intranetdir') . "/installer/data/$self->{dbms}/sysprefs.sql"); > unshift(@fnames, > "$global_mandatory_dir/subtag_registry.sql", >@@ -465,10 +467,10 @@ sub set_languages_syspref { > warn "UPDATE Languages"; > # intranet > my $pref = $self->{'dbh'}->prepare("UPDATE systempreferences SET value=? WHERE variable='language'"); >- $pref->execute("en,$language"); >+ $pref->execute("$language,en"); > # opac > $pref = $self->{'dbh'}->prepare("UPDATE systempreferences SET value=? WHERE variable='opaclanguages'"); >- $pref->execute("en,$language"); >+ $pref->execute("$language,en"); > > C4::Context->clear_syspref_cache(); > } >diff --git a/installer/install.pl b/installer/install.pl >index 5bd3806872..c66158da20 100755 >--- a/installer/install.pl >+++ b/installer/install.pl >@@ -245,9 +245,12 @@ elsif ( $step && $step == 3 ) { > elsif ( $op && $op eq 'addframeworks' ) { > > # 1ST install, 3rd sub-step : insert the SQL files the user has selected >+ my $langchoice = $query->param('fwklanguage'); >+ $langchoice = $query->cookie('KohaOpacLanguage') unless ($langchoice); >+ $langchoice =~ s/[^a-zA-Z_-]*//g; > > my ( $fwk_language, $list ) = >- $installer->load_sql_in_order( $all_languages, >+ $installer->load_sql_in_order( $langchoice, $all_languages, > $query->multi_param('framework') ); > $template->param( > "fwklanguage" => $fwk_language, >-- >2.17.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 24973
:
103071
|
103072
|
103073
|
103074
|
103075
|
104971
|
105032
|
108130
|
108166
|
108946