@@ -, +, @@ ( cd misc/translation; ./translate install es-ES ) * A new section labeled "Localization data added" with one file, custom.sql * Inspect the value of FrameworksLoaded syspref, last entry must be custom.sql repeat 3/4, install must proceed normally --- C4/Installer.pm | 8 +++++++- .../data/mysql/localization/es-ES/custom.sql | 20 +++++++++++++++++++ installer/install.pl | 5 ++++- .../prog/en/modules/installer/step3.tt | 2 ++ 4 files changed, 33 insertions(+), 2 deletions(-) create mode 100644 installer/data/mysql/localization/es-ES/custom.sql --- a/C4/Installer.pm +++ a/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 = @_; @@ -346,13 +347,18 @@ sub load_sql_in_order { push @fnames, C4::Context->config('intranetdir') . "/installer/data/mysql/account_offset_types.sql"; push @fnames, C4::Context->config('intranetdir') . "/installer/data/mysql/account_credit_types.sql"; push @fnames, C4::Context->config('intranetdir') . "/installer/data/mysql/account_debit_types.sql"; + my $localization_file = C4::Context->config('intranetdir') . + "/installer/data/$self->{dbms}/localization/$langchoice/custom.sql"; + if ( $langchoice ne 'en' and -f $localization_file ) { + push @fnames, $localization_file; + } foreach my $file (@fnames) { # warn $file; undef $/; my $error = $self->load_sql($file); my @file = split qr(\/|\\), $file; $lang = $file[ scalar(@file) - 3 ] unless ($lang); - my $level = $file[ scalar(@file) - 2 ]; + my $level = ( $file =~ /(localization)/ ) ? $1 : $file[ scalar(@file) - 2 ]; unless ($error) { $systempreference .= "$file[scalar(@file)-1]|" unless ( index( $systempreference, $file[ scalar(@file) - 1 ] ) >= 0 ); --- a/installer/data/mysql/localization/es-ES/custom.sql +++ a/installer/data/mysql/localization/es-ES/custom.sql @@ -0,0 +1,20 @@ +-- +-- Custom values that differ from the global defaults +-- +-- This file is part of Koha. +-- +-- Koha is free software; you can redistribute it and/or modify it +-- under the terms of the GNU General Public License as published by +-- the Free Software Foundation; either version 3 of the License, or +-- (at your option) any later version. +-- +-- Koha is distributed in the hope that it will be useful, but +-- WITHOUT ANY WARRANTY; without even the implied warranty of +-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +-- GNU General Public License for more details. +-- +-- You should have received a copy of the GNU General Public License +-- along with Koha; if not, see . + +UPDATE systempreferences SET value = '1' WHERE variable = 'opaclanguagesdisplay'; + --- a/installer/install.pl +++ a/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, --- a/koha-tmpl/intranet-tmpl/prog/en/modules/installer/step3.tt +++ a/koha-tmpl/intranet-tmpl/prog/en/modules/installer/step3.tt @@ -173,6 +173,8 @@

Optional data added

[% ELSIF lis.level == 'mysql' %]

MySQL data added

+ [% ELSIF lis.level == 'localization' %] +

Localization data added

[% ELSE %]

[% lis.level FILTER ucfirst | html %] data added

[% END %] --