Bug 18629 - Translatability: Fix problems with web installer 17.05
authorMarc Véron <veron@veron.ch>
Fri, 26 May 2017 11:32:06 +0000 (13:32 +0200)
committerJonathan Druart <jonathan.druart@bugs.koha-community.org>
Wed, 30 Aug 2017 19:43:34 +0000 (16:43 -0300)
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).

(Amended to remove some superfluous chomps 2017-06-27 mv)

Signed-off-by: Alex Buckley <alexbuckley@catalyst.net.nz>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
koha-tmpl/intranet-tmpl/prog/en/modules/installer/step1.tt
koha-tmpl/intranet-tmpl/prog/en/modules/installer/step2.tt
koha-tmpl/intranet-tmpl/prog/en/modules/installer/step3.tt

index 10e5589..d17f323 100644 (file)
@@ -1,3 +1,4 @@
+[% BLOCK txt_continue %]Continue to the next step[% END %]
 [% INCLUDE 'doc-head-open.inc' %]
 <title>Koha &rsaquo; Web installer &rsaquo;
     [% 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 &rsaquo; 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 %]
index ba44fd4..b379a1b 100644 (file)
@@ -1,3 +1,5 @@
+[% USE HtmlTags %]
+[% BLOCK txt_continue %]Continue to the next step[% END %]
 [% INCLUDE 'doc-head-open.inc' %]<title>Koha &rsaquo; Web installer &rsaquo; Database settings</title>
 [% INCLUDE 'installer-doc-head-close.inc' %]
 </head>
                 <h2>Web installer &rsaquo; Database settings</h2>
                 <h3>Database settings:</h3>
                 <ul>
-                    <li><em>Database type : </em> <code>[% dbms %]</code></li>
-                    <li><em>Database name : </em> <code>[% dbname %]</code></li>
-                    <li><em>Database host : </em> <code>[% hostname %]</code></li>
-                    <li><em>Database port : </em> <code>[% port %]</code> (probably okay if blank)</li>
-                    <li><em>Database user : </em> <code>[% user %]</code></li>
+                    <li><em>Database type: </em> [%- dbms | $HtmlTags tag=>'code' -%]</li>
+                    <li><em>Database name: </em> [%- dbname | $HtmlTags tag=>'code' -%]</li>
+                    <li><em>Database host: </em> [%- hostname | $HtmlTags tag=>'code'-%]</li>
+                    <li><em>Database port: </em> [%- port| $HtmlTags tag=>'code' -%] (probably okay if blank)</li>
+                    <li><em>Database user: </em> [%- user | $HtmlTags tag=>'code' -%]</li>
                 </ul>
 
                 [% IF ( dbconnection ) %]
                             <div class="alert alert-success" role="alert"><p>Connection established.</p></div>
                             [% IF ( checkdatabasecreated ) %]
                                 <ul>
-                                    <li>Database <code>[% dbname %]</code> exists.</li>
+                                    <li>Database [% dbname | $HtmlTags tag=>'code'%] exists.</li>
                                 [% IF ( checkgrantaccess ) %]
-                                    <li>User <code>[% user %]</code> has all required privileges on database <code>[% dbname %]</code>.</li>
+                                    <li>User [% user | $HtmlTags tag=>'code' %]  has all required privileges on database [% dbname | $HtmlTags tag=>'code' %].</li>
                                     </ul>
                                 [% ELSE %]
                                     </ul>
-                                    <p class="error">user <code>[% user %]</code> doesn't have enough privilege on database <code>[% dbname %]</code> </p>
-                                    <p class="tip"> Ask for or make a change in the user's privileges. Need help? See [% IF ( mysql ) %]
-                                            <a href="http://dev.mysql.com/doc/refman/4.1/en/grant.html">
+                                    <p class="error">User [% user | $HtmlTags tag=>'code' %] doesn't have enough privilege on database [% dbname | $HtmlTags tag=>'code'%].</p>
+                                    <p class="tip">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' %].</p>
+                                    <p>Need help? See manual for [% IF ( mysql ) %]
+                                            <a href="http://dev.mysql.com/doc/refman/4.1/en/grant.html">MySQL</a>
                                         [% ELSE %]
-                                            <a href="http://www.postgresql.org/docs/8.2/interactive/sql-createrole.html">
+                                            <a href="http://www.postgresql.org/docs/8.2/interactive/sql-createrole.html">PostgreSQL</a>
                                         [% END %]
-                                        this page</a>. User <code>[% user %]</code> must have USAGE, INSERT, UPDATE, DELETE, DROP and CREATE privileges on <code>[% dbname %]</code>
                                     </p>
                                 [% END %]
                             [% ELSE %]
-                                <div class="alert alert-danger" role="alert"><p>No database named <code>[% dbname %]</code> detected.</p></div>
+                                <div class="alert alert-danger" role="alert"><p>No database named [% dbname | $HtmlTags tag=>'code' %] detected.</p></div>
                                 <p>Please create the database before continuing.</p>
                             [% END %]
                         [% ELSE %]
                             <div class="tip">
                                 <ul>
                                     <li>Check that your database is running.</li>
-                                    <li>Check your database settings in <code>koha-conf.xml</code>. </li>
-                                    <li>Check the hostname setting in <code>koha-conf.xml</code>.
-                                    Some database servers require <code>127.0.0.1</code> rather than <code>localhost</code>.</li>
+                                    <li>Check your database settings in [% 'koha-conf.xml' | $HtmlTags Tag=>'code' %].</li>
+                                    <li>Check the hostname setting in [% INCLUDE txt_kohaconf_xml %]. Some database servers require [% '127.0.0.1' | $HtmlTags tag=>'code' %] rather than [% 'localhost' | $HtmlTags tag=>'code' %].</li>
                                 </ul>
                             </div>
-                            <p>Please correct these errors and <a href="/cgi-bin/koha/installer/install.pl">start the installer</a> again.
+                            <p>Please correct these errors. <a href="/cgi-bin/koha/installer/install.pl">Then start the installer again.</a>
                         [% END %]
                         [% UNLESS ( error ) %]
                             <input type="hidden" name="step" value="3" />
-                            <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>
                         [% END %]
                     </form>
                 [% ELSE %]
                     <form name="checkinformation" method="post" action="install.pl">
                         <input type="hidden" name="step" value="2" />
                         <input type="hidden" name="checkdb" value="1" />
-                        <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 dbconnection %]
             </div> <!-- / #installer-step2 -->
index 34d5e7d..a19147f 100644 (file)
@@ -1,3 +1,4 @@
+[% BLOCK txt_continue %]Continue to the next step[% END %]
 [% INCLUDE 'doc-head-open.inc' %]
 
 <title>Koha &rsaquo; Web installer &rsaquo;
      [% END %]
 </title>
 
-[% IF ( finish ) %]<meta http-equiv="refresh" content="10; url=/cgi-bin/koha/installer/onboarding.pl">[% END %]
+[% IF ( finish ) %]
+    [%- metacontent= '10; url=/cgi-bin/koha/installer/onboarding.pl' -%]
+    <meta http-equiv="refresh" content="[% metacontent %]">
+[% END %]
 [% INCLUDE 'installer-doc-head-close.inc' %]
 </head>
 
@@ -44,9 +48,7 @@
                 [% IF ( finish ) %]
                     <h2>Web installer &rsaquo; Installation complete</h2>
                     <h3>Congratulations, installation complete</h3>
-                    <p>
-                        If this page does not redirect in 10 seconds, <a href="/cgi-bin/koha/installer/onboarding.pl">start onboarding process</a>.
-                    </p>
+                    <p>This page will redirect in 10 seconds. <a href="/cgi-bin/koha/installer/onboarding.pl">If not, click here to start onboarding process.</a></p>
                 [% END %]
 
                 [% IF ( choosemarc ) %]
@@ -69,7 +71,7 @@
                                  </p>
                             [% END %]
                         [% END %]
-                        <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 choosemarc %]
 
                 [% IF ( addframeworks ) %]
                     <h2>Web installer &rsaquo; Default data loaded</h2>
                     [% FOREACH lis IN list %]
-                        <h3>[% lis.level FILTER ucfirst %] data added</h3>
+                        [% IF lis.level == 'mandatory' %]
+                            <h3>Mandatory data added</h3>
+                        [% ELSIF lis.level == 'optional' %]
+                            <h3>Optional data added</h3>
+                        [% ELSIF lis.level == 'mysql' %]
+                            <h3>MySQL data added</h3>
+                        [% ELSE %]
+                            <h3>[% lis.level FILTER ucfirst %] data added</h3>
+                        [% END %]
                         <ul>
                             [% FOREACH fwklis IN lis.fwklist %]
                             <li>
                         <div class="alert alert-success"><p>Database tables created</p></div>
                         <form action="install.pl" method="post">
                             <input type="hidden" name="step" value="3" />
-                            <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 %]
                 [% END # / IF importdatastructure %]
                     <form action="install.pl" method="post">
                         <input type="hidden" name="step" value="3" />
                         <input type="hidden" name="op" value="importdatastructure" />
-                        <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 # / proposeimport %]
 
                     [% ELSE %]
                         <h2>Web installer &rsaquo; Install basic configuration settings</h2>
                         <p>We are ready to do some basic configuration.</p>
-                        <p> <a href="install.pl?step=3&amp;op=choosemarc" class="btn btn-primary">Continue to the next step</a> </p>
+                        <p><a href="install.pl?step=3&amp;op=choosemarc" class="btn btn-primary">[% INCLUDE txt_continue %]</a></p>
                     [% END %]
                 [% END # / IF default %]