Bug 18629 - Translatability: Fix problems with web installer 17.05
Summary: Translatability: Fix problems with web installer 17.05
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Installation and upgrade (web-based installer) (show other bugs)
Version: master
Hardware: All All
: P5 - low normal (vote)
Assignee: Marc Véron
QA Contact: Testopia
URL:
Keywords:
Depends on: 18665
Blocks:
  Show dependency treegraph
 
Reported: 2017-05-18 17:11 UTC by Marc Véron
Modified: 2018-06-04 20:10 UTC (History)
6 users (show)

See Also:
Change sponsored?: ---
Patch complexity: ---
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:


Attachments
Bug 18629 - Web installer 17.05 not properly translatable (1.62 KB, patch)
2017-05-19 09:21 UTC, Marc Véron
Details | Diff | Splinter Review
Bug 18629 - Web installer 17.05 not properly translatable (8.02 KB, patch)
2017-05-24 05:50 UTC, Marc Véron
Details | Diff | Splinter Review
Bug 18629 - Translatability: Fix problems with web installer 17.05 (14.18 KB, patch)
2017-05-26 11:49 UTC, Marc Véron
Details | Diff | Splinter Review
Bug 18629 - Translatability: Fix problems with web installer 17.05 (15.06 KB, patch)
2017-05-26 12:30 UTC, Marc Véron
Details | Diff | Splinter Review
Bug 18629 - Translatability: Fix problems with web installer 17.05 (15.10 KB, patch)
2017-05-27 05:23 UTC, Marc Véron
Details | Diff | Splinter Review
Bug 18629 - Translatability: Fix problems with web installer 17.05 (15.15 KB, patch)
2017-05-28 09:19 UTC, Alex Buckley
Details | Diff | Splinter Review
Bug 18629: (followup) Plain text "Continue..." instead of BLOCK (6.17 KB, patch)
2017-06-14 07:08 UTC, Marc Véron
Details | Diff | Splinter Review
Bug 18629 - Translatability: Fix problems with web installer 17.05 (15.24 KB, patch)
2017-08-30 19:42 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 18629: (followup) Plain text "Continue..." instead of BLOCK (6.26 KB, patch)
2017-08-30 19:42 UTC, Jonathan Druart
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Marc Véron 2017-05-18 17:11:37 UTC Comment hidden (obsolete)
Comment 1 Marc Véron 2017-05-19 08:23:16 UTC Comment hidden (obsolete)
Comment 2 Marc Véron 2017-05-19 09:21:00 UTC Comment hidden (obsolete)
Comment 3 Marc Véron 2017-05-19 10:14:29 UTC Comment hidden (obsolete)
Comment 4 Marc Véron 2017-05-24 04:18:47 UTC Comment hidden (obsolete)
Comment 5 Marc Véron 2017-05-24 05:50:05 UTC Comment hidden (obsolete)
Comment 6 Marc Véron 2017-05-26 11:30:44 UTC
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. The result in translations is much less than ideal, and it makes a bad impression not only for new Koha users or for libraries interested in Koha.
Comment 7 Marc Véron 2017-05-26 11:49:48 UTC Comment hidden (obsolete)
Comment 8 Marc Véron 2017-05-26 12:30:03 UTC Comment hidden (obsolete)
Comment 9 Marc Véron 2017-05-27 05:23:21 UTC
Created attachment 63759 [details] [review]
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).

(Amended to remove some superfluous chomps 2017-06-27 mv)
Comment 10 Alex Buckley 2017-05-28 07:54:10 UTC
Hi Marc

When running
perl translate create aa-AA I keep getting:

>Warning: Can't determine original templates' charset, defaulting to UTF-8
>Warning: Charset Out defaulting to UTF-8
>Removing empty file /home/vagrant/kohaclone/misc/translator/po/aa-AA-staff-prog.po
>I UTF-8 O UTF-8 at /home/vagrant/kohaclone/misc/translator/tmpl_process3.pl line 345.
>msgmerge: error while opening "/home/vagrant/kohaclone/misc/translator/po/aa-AA-staff-prog.po" for reading: No such file or directory

The equivalent output happens for all of the other aa-AA files.

Do you have any ideas as to why this may be happening? as I cannot find any useful answers online
Comment 11 Marc Véron 2017-05-28 08:15:49 UTC
(In reply to Alex Buckley from comment #10)
> Hi Marc
> 
> When running
> perl translate create aa-AA I keep getting:
> 
> >Warning: Can't determine original templates' charset, defaulting to UTF-8
> >Warning: Charset Out defaulting to UTF-8
> >Removing empty file /home/vagrant/kohaclone/misc/translator/po/aa-AA-staff-prog.po
> >I UTF-8 O UTF-8 at /home/vagrant/kohaclone/misc/translator/tmpl_process3.pl line 345.
> >msgmerge: error while opening "/home/vagrant/kohaclone/misc/translator/po/aa-AA-staff-prog.po" for reading: No such file or directory
> 
> The equivalent output happens for all of the other aa-AA files.
> 
> Do you have any ideas as to why this may be happening? as I cannot find any
> useful answers online

On my vm, I do:
marc@debian8vm:~/koha/misc/translator$ perl translate create aa-AA
I get the same warnings about the charset and the message about revoming an emty file
However I do not get the error about opening a file.
Does the folder /home/vagrant/kohaclone/misc/translator/po exist?
Comment 12 Alex Buckley 2017-05-28 08:17:20 UTC
yes the folder /home/vagrant/kohaclone/misc/translator/po does exist
Comment 13 Marc Véron 2017-05-28 08:21:21 UTC
(In reply to Alex Buckley from comment #12)
> yes the folder /home/vagrant/kohaclone/misc/translator/po does exist

Maybe an issue with permissions?
Comment 15 Alex Buckley 2017-05-28 08:45:52 UTC
Hi Marc

Thanks for the suggestions. So the permissions are fine with the po directory having the following correct permissions:
drwxr-xr-x 

Whilst I can install existing languages using the command:

sudo env KOHA_CONF=/etc/koha/sites/kohadev/koha-conf.xml PERL5LIB=/home/vagrant/kohaclone perl translate install fr-FR

To install French for example, which worked successfully
Comment 16 Marc Véron 2017-05-28 08:57:29 UTC
What happens if you do the following?

sudo env KOHA_CONF=/etc/koha/sites/kohadev/koha-conf.xml
PERL5LIB=/home/vagrant/kohaclone perl translate create aa-AA
Comment 17 Alex Buckley 2017-05-28 09:02:20 UTC
Ah brilliant thanks Marc 

Although it is displaying the same output as before (see below) the files have actually been created this time. Thanks very much I will test your patches now

>Warning: Can't determine original templates' charset, defaulting to UTF-8
>Warning: Charset Out defaulting to UTF-8
>Removing empty file /home/vagrant/kohaclone/misc/translator/po/aa-AA-staff-prog.po
>I UTF-8 O UTF-8 at /home/vagrant/kohaclone/misc/translator/tmpl_process3.pl line 345.
Comment 18 Alex Buckley 2017-05-28 09:19:06 UTC
Created attachment 63768 [details] [review]
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).

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

Followed test plan worked as intended
Signed-off-by: Alex Buckley <alexbuckley@catalyst.net.nz>
Comment 19 Jonathan Druart 2017-06-13 19:35:54 UTC
I do not understand how using txt_continue is helping translators:

Before the patch:
 msgid "Continue to the next step"

After the patch:
 msgid "%s %sContinue to the next step%s %s"
Comment 20 Marc Véron 2017-06-14 06:53:32 UTC
(In reply to Jonathan Druart from comment #19)
> I do not understand how using txt_continue is helping translators:
> 
> Before the patch:
>  msgid "Continue to the next step"
> 
> After the patch:
>  msgid "%s %sContinue to the next step%s %s"

My intention was to have repeating test at one place, but you are right, the result in the po file is not what we want, and isolating with div tags does not work here.
Comment 21 Marc Véron 2017-06-14 07:08:22 UTC
Created attachment 64274 [details] [review]
Bug 18629: (followup) Plain text "Continue..." instead of BLOCK

Remove
[% BLOCK txt_continue %]Continue to the next step[% END %]
...and restore original text

See comment #19 and comment #20
Comment 22 Marc Véron 2017-06-14 07:09:55 UTC
Hope it's OK to set back to SO.
Comment 23 Jonathan Druart 2017-06-14 12:49:01 UTC
Marc, if you plan to provide new patches to fix translations I think it would be good to have the "before" and "after" msgid, it would be much more easier to understand what to test.
Comment 24 Jonathan Druart 2017-06-14 13:09:21 UTC
Before and after:
  msgid "Database name : "

=> OK

Before:
  msgid "%s (probably OK if blank)"

After:
  msgid "(probably okay if blank)"

=> This may remove flexibility in some languages?
Comment 25 Marc Véron 2017-06-19 21:22:10 UTC
(In reply to Jonathan Druart from comment #24)
> Before and after:
>   msgid "Database name : "
> 
> => OK
> 
> Before:
>   msgid "%s (probably OK if blank)"
> 
> After:
>   msgid "(probably okay if blank)"
> 
> => This may remove flexibility in some languages?

I do not think that this is a big issue.
Comment 26 Jonathan Druart 2017-08-30 19:42:01 UTC
Created attachment 66648 [details] [review]
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).

(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>
Comment 27 Jonathan Druart 2017-08-30 19:42:06 UTC
Created attachment 66649 [details] [review]
Bug 18629: (followup) Plain text "Continue..." instead of BLOCK

Remove
[% BLOCK txt_continue %]Continue to the next step[% END %]
...and restore original text

See comment #19 and comment #20

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Comment 28 Jonathan Druart 2017-08-30 19:58:00 UTC
Pushed to master for 17.11, thanks to everybody involved!
Comment 29 Fridolin Somers 2017-09-29 13:38:59 UTC
Enhancement Bug 18665 not pushed to 17.05.x