Bug 24871 - Add new *-installer-*.po translation files
Summary: Add new *-installer-*.po translation files
Status: Pushed to master
Alias: None
Product: Koha
Classification: Unclassified
Component: I18N/L10N (show other bugs)
Version: master
Hardware: All All
: P5 - low normal (vote)
Assignee: Bernardo Gonzalez Kriegel
QA Contact: Jonathan Druart
URL:
Keywords:
Depends on:
Blocks: 24897 24972
  Show dependency treegraph
 
Reported: 2020-03-15 21:07 UTC by Bernardo Gonzalez Kriegel
Modified: 2020-05-08 20:40 UTC (History)
5 users (show)

See Also:
Change sponsored?: ---
Patch complexity: ---
Who signed the patch off:
Text to go in the release notes:
Version(s) released in:
20.05.00


Attachments
Bug 24871: xz compressed patch (256.75 KB, application/octet-stream)
2020-03-15 22:08 UTC, Bernardo Gonzalez Kriegel
Details
Bug 24871: xz compressed patch (262.21 KB, application/x-xz)
2020-04-21 22:45 UTC, Victor Grousset/tuxayo
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Bernardo Gonzalez Kriegel 2020-03-15 21:07:49 UTC
After Bug 24262 we need new translation files,

*-installer-MARC21.po for MARC21 installer files (Bug 24593 and Bug 24584)
*-installer.po for common files (Bug 24583 and Bug 24584)
Comment 1 Bernardo Gonzalez Kriegel 2020-03-15 22:08:55 UTC
Created attachment 100709 [details]
Bug 24871: xz compressed patch

Bug 24871: Add new *-installer*.po translation files
  
This patch simply adds new po files for each supported
language.

The are not created on update, so the need to add this files.

To test:
1) Update your preferred language
2) Check missing *installer*po files
3) Create new translation files:
   cd /misc/translation
   ./translate create xx-YY

   check *installer*po files
4) Apply patch
5) Repeat 1, verify installer files are updated
   see last modification time

Pre-filled translations for some languages
(https://translate.koha-community.org/projects/marc21/)
Comment 2 Jonathan Druart 2020-03-19 13:48:38 UTC
Should not we remove the files for LANG that are in installer/data/mysql/?
Thinking about fr-FR, there is no need (yet) to translate them, they won't be used.
Comment 3 Bernardo Gonzalez Kriegel 2020-03-19 14:28:47 UTC
(In reply to Jonathan Druart from comment #2)
> Should not we remove the files for LANG that are in installer/data/mysql/?
> Thinking about fr-FR, there is no need (yet) to translate them, they won't
> be used.

Yes you are right, no need of them if lang dir exists.
But if new bugs are filed to remove dirs they will be needed.
For example Bug 24897 for es-ES.

Perhaps we can wait until late April, at that moment I can remove all unneeded files in another bug.
Comment 4 Victor Grousset/tuxayo 2020-04-21 00:13:47 UTC
> 1) Update your preferred language

You mean with this?
koha-translate --update XX

> 2) Check missing *installer*po files

What does this mean?

> cd /misc/translation

You mean misc/translator/ right?

> 5) Repeat 1, verify installer files are updated
   see last modification time

Does it means checking the files there?
/koha-tmpl/intranet-tmpl/prog/XX/modules/installer

Sorry for the basic questions.
Comment 5 Victor Grousset/tuxayo 2020-04-21 00:46:09 UTC
Question about koha-testing-docker: (and maybe KohaDevBox) does anyone know from which user to run the translation commands?

like koha-translate --install XX

from the user kohadev-koha it lacks a permission
mkdir /usr/share/koha/misc/translator/po/eo: Permission denied at /usr/share/koha/misc/translator/LangInstaller.pm line 708.

from root, it doesn't find /usr/share/koha/misc/bin/clear_cache.pl
Comment 6 Bernardo Gonzalez Kriegel 2020-04-21 01:14:26 UTC
Hi Victor, sorry if the test plan was not clear

(In reply to Victor Grousset/tuxayo from comment #4)
> > 1) Update your preferred language
> 
> You mean with this?
> koha-translate --update XX

No, that command updates installed translations.
The meaning was to do:
cd misc/translator; ./translate update XX

> 
> > 2) Check missing *installer*po files
> 
> What does this mean?

It means that there are no XX-*-installer.po after an update of an existing language-
Updates process does not create missing files, only updates existing ones.
The only way to 'create' the files is using 'create' option of translate command, but that fails if some of the files are present.
The purpose of this patch is to add those files

> 
> > cd /misc/translation
> 
> You mean misc/translator/ right?

Yes, of course, my bad.

> 
> > 5) Repeat 1, verify installer files are updated
>    see last modification time
> 
> Does it means checking the files there?
> /koha-tmpl/intranet-tmpl/prog/XX/modules/installer

No, just run "./translate update XX" and verify that all
XX-*.po are updated

> 
> Sorry for the basic questions.

No problem, thank you :)
Comment 7 Victor Grousset/tuxayo 2020-04-21 02:54:28 UTC
Thanks for the clarifications.

> 4) Apply patch
> 5) Repeat 1, verify installer files are updated
>   see last modification time

Actually I missed 4) and the files are still updated. Does it mean that the test plan is missing something?
Comment 8 Bernardo Gonzalez Kriegel 2020-04-21 10:45:27 UTC
(In reply to Victor Grousset/tuxayo from comment #7)
> Actually I missed 4) and the files are still updated. Does it mean that the
> test plan is missing something?

Take for example language 'eo', current master, wo/patch
Number of PO files = 8
ls misc/translator/po/eo-*po | wc -l

After doing language update, number = 8
(cd misc/translator/; ./translate update eo); ls misc/translator/po/eo-*.po | wc -l

Re-creating the language, number = 10
(cd misc/translator/; rm -f po/eo-*.po; ./translate create eo); ls misc/translator/po/eo-*.po | wc -l

New files are eo-installer-MARC21.po and eo-installer.po

This bug only adds those files for each language.

Test plan is not perfect, but simply shows that language update does not create new files(1,2), create process does(3), and patch adds(4) files for each language that are updated(5) after applying it.

Thanks for testing
Comment 9 Victor Grousset/tuxayo 2020-04-21 22:45:48 UTC
Created attachment 103426 [details]
Bug 24871: xz compressed patch
Comment 10 Victor Grousset/tuxayo 2020-04-21 22:46:30 UTC
Author: Bernardo González Kriegel <gonzalez@di.unc.edu.ar>
Date:   Sun Mar 15 18:15:32 2020 -0300

    Bug 24871: Add new *-installer*.po translation files
    
    This patch simply adds new po files for each supported
    language.
    
    The are not created on update, so the need to add this files.
    
    To test:
    
    1) Count the number of po files of your preferred language (replace XX)
         ls misc/translator/po/XX-*po | wc -l
    2) You should have 8 of them
    3) Update it and recount
         (cd misc/translator/; ./translate update XX); ls misc/translator/po/XX-*.po | wc -l
    4) still 8, it means that the update process doesn't add new po files
    5) Re-create the language
         (cd misc/translator/; rm -f po/XX-*.po; ./translate create XX);
    6) recount: ls misc/translator/po/XX-*po | wc -l
    7) It's 10
    8) note: it means that the creation process adds new po files
    9) restore to a clean state
       git restore misc/translator/po/
       rm misc/translator/po/eo-installer-MARC21.po misc/translator/po/eo-installer.po
    10) manually apply the patch (because it's too big to be directly here)
        1) download
        2) extact the xz file
        3) apply it
        4) git am 0001-Bug-24871-Add-new-installer-.po-translation-files.patch-1
    11) check the modification time of the installer .po files of your preferred language
          ls -l misc/translator/po/XX-installer*
    12) note: this also checks for their presence, which is what this patch
          actually does, only adding the installer po files
    13) Update your preferred language
          (cd misc/translator/; ./translate update XX);
    14) check the modification time
          ls -l misc/translator/po/XX-installer*
    15) It should have been updated, so everything still works correcly :D
    
    Pre-filled translations for some languages
    (https://translate.koha-community.org/projects/marc21/)
    
    Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Comment 11 Victor Grousset/tuxayo 2020-04-21 22:50:54 UTC
> Take for example language 'eo', current master, wo/patch

That's a fine example for me.
Tio estas bona ekzemplo por mi. ;)

Thanks for the clarifications, it work :D.
I tried to reflect the explanations in the test plan. Here are the changes:

== Previous test plan ==
1) Update your preferred language
2) Check missing *installer*po files
3) Create new translation files:
   cd /misc/translation
   ./translate create xx-YY

   check *installer*po files
4) Apply patch
5) Repeat 1, verify installer files are updated
   see last modification time

== current test plan ==
1) Count the number of po files of your preferred language (replace XX)
     ls misc/translator/po/XX-*po | wc -l
2) You should have 8 of them
3) Update it and recount
     (cd misc/translator/; ./translate update XX); ls misc/translator/po/XX-*.po | wc -l
4) still 8, it means that the update process doesn't add new po files
5) Re-create the language
     (cd misc/translator/; rm -f po/XX-*.po; ./translate create XX);
6) recount: ls misc/translator/po/XX-*po | wc -l
7) It's 10
8) note: it means that the creation process adds new po files
9) restore to a clean state
   git restore misc/translator/po/
   rm misc/translator/po/eo-installer-MARC21.po misc/translator/po/eo-installer.po
10) manually apply the patch (because it's too big to be directly here)
    1) download
    2) extact the xz file
    3) apply it
    4) git am 0001-Bug-24871-Add-new-installer-.po-translation-files.patch-1
11) check the modification time of the installer .po files of your preferred language
      ls -l misc/translator/po/XX-installer*
12) note: this also checks for their presence, which is what this patch
      actually does, only adding the installer po files
13) Update your preferred language
      (cd misc/translator/; ./translate update XX);
14) check the modification time
      ls -l misc/translator/po/XX-installer*
15) It should have been updated, so everything still works correcly :D
Comment 12 Bernardo Gonzalez Kriegel 2020-04-21 23:49:13 UTC
(In reply to Victor Grousset/tuxayo from comment #11)
> > Take for example language 'eo', current master, wo/patch
> 
> That's a fine example for me.
> Tio estas bona ekzemplo por mi. ;)
> 

I know :)

Thank you!
Comment 13 Jonathan Druart 2020-04-24 08:26:25 UTC
Signed off patches are on https://gitlab.com/joubu/Koha/-/commits/bug_24871

Passing QA.
Comment 14 Martin Renvoize 2020-04-27 10:18:21 UTC
Nice work everyone!

Pushed to master for 20.05
Comment 15 Joy Nelson 2020-05-08 20:40:11 UTC
24262 was not backported to 19.11.x  I do not believe these are needed in 19.11.x either.  not backported