From 71c28bcf801f5ed410d5b24c590fd25f506d4291 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20V=C3=A9ron?= Date: Fri, 26 May 2017 13:32:06 +0200 Subject: [PATCH] Bug 18629 - Translatability: Fix problems with web installer 17.05 The new web installer for 17.05 has a great new design - but it has a lot of translatability issues. Some strings are not picked for translations, some expose the content of tt directives, and others are splitted by html tags, resulting in small text fragments that are not easy to translate. This patch weeds out such translation problems for step1.tt, step2.tt and step3.tt To test: - Apply patch (on top of Bug 18665 because of html tags inside of tt directives in step2.tt) - Prepare a fresh install (drop database, create database) - Walk through the installation process and verify that it works as before - Verify that string changes (in English) make sense - Create a translation( cd misc/translator, then perl translate create aa-AA) then: vim po/aa-AA-staff-prog.po and search for: /installer\/step Verify that strings for step1.tt, step2.tt, step3.tt are not fragmented, do not contain [%%, and are easily translatable (make sense without having to search in source files for context). --- .../prog/en/modules/installer/step1.tt | 8 ++--- .../prog/en/modules/installer/step2.tt | 39 +++++++++++----------- .../prog/en/modules/installer/step3.tt | 18 +++++----- 3 files changed, 34 insertions(+), 31 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/installer/step1.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/installer/step1.tt index 10e5589..b11eea4 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/installer/step1.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/installer/step1.tt @@ -1,3 +1,4 @@ +[% BLOCK txt_continue %]Continue to the next step[% END %] [% INCLUDE 'doc-head-open.inc' %] Koha › Web installer › [% UNLESS ( language ) %] Choose your language [% END %] @@ -46,8 +47,7 @@ [% END %] </select> </div> - - <p><input value="Continue to the next step" class="btn btn-primary" type="submit" /></p> + <p><input value="[%- INCLUDE txt_continue -%]" class="btn btn-primary" type="submit" /></p> </form> [% END %] @@ -55,7 +55,7 @@ [% UNLESS ( checkmodule ) %] [% IF ( missing_modules ) %] <h2>Web installer › Perl modules missing</h2> - <p>Some Perl modules are missing. <span class="label label-danger">Required</span> modules <b>must</b> be installed before you may continue.<br /> + <p>Some Perl modules are missing. <span class="label label-danger">Important: </span>Required modules must be installed before you may continue.<br /> <ul> [% FOREACH missing_module IN missing_modules %] <li><strong>[% missing_module.name %]</strong> [% IF ( missing_module.require ) %]<span class="label label-danger">Required</span>[% END %] @@ -88,7 +88,7 @@ <form name="checkmodules" role="form" action="install.pl"> <input type="hidden" name="step" value="2" /> - <p> <input value="Continue to the next step" class="btn btn-primary" type="submit" /> </p> + <p> <input value="[%- INCLUDE txt_continue -%]" class="btn btn-primary" type="submit" /> </p> </form> [% END # IF checkmodule%] [% END # IF language %] diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/installer/step2.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/installer/step2.tt index ba44fd4..9b2cb78 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/installer/step2.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/installer/step2.tt @@ -1,3 +1,5 @@ +[% USE HtmlTags %] +[% BLOCK txt_continue %]Continue to the next step[% END %] [% INCLUDE 'doc-head-open.inc' %]<title>Koha › Web installer › Database settings [% INCLUDE 'installer-doc-head-close.inc' %] @@ -11,11 +13,11 @@

Web installer › Database settings

Database settings:

[% IF ( dbconnection ) %] @@ -24,23 +26,23 @@ [% IF ( checkdatabasecreated ) %] [% ELSE %] -

user [% user %] doesn't have enough privilege on database [% dbname %]

-

Ask for or make a change in the user's privileges. Need help? See [% IF ( mysql ) %] - +

User [% user | $HtmlTags tag=>'code' %] doesn't have enough privilege on database [% dbname | $HtmlTags tag=>'code'%].

+

Ask for or make a change in the user's privileges. User [% user | $HtmlTags tag=>'code' %] must have USAGE, INSERT, UPDATE, DELETE, DROP and CREATE privileges on database [% dbname | $HtmlTags tag=>'code' -%].

+

Need help? See manual for [% IF ( mysql ) %] + MySQL [% ELSE %] - + PostgreSQL [% END %] - this page. User [% user %] must have USAGE, INSERT, UPDATE, DELETE, DROP and CREATE privileges on [% dbname %]

[% END %] [% ELSE %] - +

Please create the database before continuing.

[% END %] [% ELSE %] @@ -48,23 +50,22 @@
-

Please correct these errors and start the installer again. +

Please correct these errors. Then start the installer again. [% END %] [% UNLESS ( error ) %] -

+

[% END %] [% ELSE %]
-

+

[% END # / IF dbconnection %] 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 34d5e7d..5df2e14 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/installer/step3.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/installer/step3.tt @@ -1,3 +1,4 @@ +[% BLOCK txt_continue %]Continue to the next step[% END %] [% INCLUDE 'doc-head-open.inc' %] Koha › Web installer › @@ -32,7 +33,10 @@ [% END %] -[% IF ( finish ) %][% END %] +[% IF ( finish ) %] + [%- metacontent= '10; url=/cgi-bin/koha/installer/onboarding.pl' -%] + +[% END %] [% INCLUDE 'installer-doc-head-close.inc' %] @@ -44,9 +48,7 @@ [% IF ( finish ) %]

Web installer › Installation complete

Congratulations, installation complete

-

- If this page does not redirect in 10 seconds, start onboarding process. -

+

This page will redirect in 10 seconds. If not, click here to start onboarding process.

[% END %] [% IF ( choosemarc ) %] @@ -69,7 +71,7 @@

[% END %] [% END %] -

+

[% END # / IF choosemarc %] @@ -198,7 +200,7 @@

Database tables created

-

+

[% END %] [% END # / IF importdatastructure %] @@ -209,7 +211,7 @@
-

+

[% END # / proposeimport %] @@ -221,7 +223,7 @@ [% ELSE %]

Web installer › Install basic configuration settings

We are ready to do some basic configuration.

-

Continue to the next step

+

[%- INCLUDE txt_continue -%]

[% END %] [% END # / IF default %] -- 2.1.4