[Bug 24262] New: Translate installer data in YAML format
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24262 Bug ID: 24262 Summary: Translate installer data in YAML format Change sponsored?: --- Product: Koha Version: master Hardware: All OS: All Status: NEW Severity: enhancement Priority: P5 - low Component: I18N/L10N Assignee: koha-bugs@lists.koha-community.org Reporter: bgkriegel@gmail.com QA Contact: testopia@bugs.koha-community.org CC: frederic@tamil.fr This complements Bug 13897, adding ability to translate YAML files in installer dirs. -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24262 Bernardo Gonzalez Kriegel <bgkriegel@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Assignee|koha-bugs@lists.koha-commun |bgkriegel@gmail.com |ity.org | Depends on| |13897 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13897 [Bug 13897] Use YAML files for installer data -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24262 --- Comment #1 from Bernardo Gonzalez Kriegel <bgkriegel@gmail.com> --- Created attachment 96538 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=96538&action=edit Bug 24262: Translate installer data in YAML format This patch adds the ability to: 1) Create new translation files from yaml installer files 2) Create installer directory for a given language It will not create a installer directory if it already exists. New (possible) translation files: xx-YY-installer.po xx-YY-installer-MARC21.po xx-YY-installer-UNIMARC.po Needs Bug 13897 (for yaml files) and Bug 18688 (for warnings) To test: 1) Apply patches from Bug 13897 and Bug 18688. 2) Apply this patch 3) Go to misc/translation 4) Create new translation files for a language $ ./translate create xx-YY check new file 'xx-YY-installer.po' 5) Copy ../../installer/data/mysql/en/optional/auth_val.yml into ../../installer/data/mysql/en/marcflavour/marc21/mandatory/ and ../../installer/data/mysql/en/marcflavour/unimarc/mandatory/ remove po/xx-YY*, then repeat creation check new files 'xx-YY-installer.po', 'xx-YY-installer-MARC21.po' and 'xx-YY-installer-UNIMARC.po' remove all new files 6) Create for xx-YY again and try update $ ./translate create xx-YY edit ../../installer/data/mysql/en/optional/auth_val.yml and change one char in one of the translatable values, also edit 'xx-YY-installer.po', translate the same string (in msgstr). Do an update $ ./translate update xx-YY check in 'xx-YY-installer.po' a fuzzy value for the translated value and the preservation of the translation Fix the translation, or add a new one. 7) Create an install dir for xx-YY ./translate install xx-YY Check new dir '../../installer/data/mysql/xx-YY/' Check files on it $ tree ../../installer/data/mysql/xx-YY/ and compare with ../../installer/data/mysql/en/ All installation files must be present 8) Try a new Koha install using this language in the usual way. Check in authorised_values for the translated string. 9) Try create an install dir for an existing language (eg. es-ES, de-DE or fr-FR ) Install dir is ignored and not changed. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24262 Bernardo Gonzalez Kriegel <bgkriegel@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |Needs Signoff Depends on| |18688 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18688 [Bug 18688] Warnings about UTF-8 charset when creating a new language -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24262 Bernardo Gonzalez Kriegel <bgkriegel@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #96538|0 |1 is obsolete| | --- Comment #2 from Bernardo Gonzalez Kriegel <bgkriegel@gmail.com> --- Created attachment 96540 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=96540&action=edit Bug 24262: Translate installer data in YAML format This patch adds the ability to: 1) Create new translation files from yaml installer files 2) Create installer directory for a given language It will not create a installer directory if it already exists. New (possible) translation files: xx-YY-installer.po xx-YY-installer-MARC21.po xx-YY-installer-UNIMARC.po Needs Bug 13897 (for yaml files) and Bug 18688 (for warnings) To test: 1) Apply patches from Bug 13897 and Bug 18688. 2) Apply this patch 3) Go to misc/translation 4) Create new translation files for a language $ ./translate create xx-YY check new file 'xx-YY-installer.po' 5) Copy ../../installer/data/mysql/en/optional/auth_val.yml into ../../installer/data/mysql/en/marcflavour/marc21/mandatory/ and ../../installer/data/mysql/en/marcflavour/unimarc/mandatory/ remove po/xx-YY*, then repeat creation check new files 'xx-YY-installer.po', 'xx-YY-installer-MARC21.po' and 'xx-YY-installer-UNIMARC.po' remove all new files 6) Create for xx-YY again and try update $ ./translate create xx-YY edit ../../installer/data/mysql/en/optional/auth_val.yml and change one char in one of the translatable values, also edit 'xx-YY-installer.po', translate the same string (in msgstr). Do an update $ ./translate update xx-YY check in 'xx-YY-installer.po' a fuzzy value for the translated value and the preservation of the translation Fix the translation, or add a new one. 7) Create an install dir for xx-YY ./translate install xx-YY Check new dir '../../installer/data/mysql/xx-YY/' Check files on it $ tree ../../installer/data/mysql/xx-YY/ and compare with ../../installer/data/mysql/en/ All installation files must be present 8) Try a new Koha install using this language in the usual way. Check in authorised_values for the translated string. 9) Try create an install dir for an existing language (eg. es-ES, de-DE or fr-FR ) Install dir is ignored and not changed. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24262 Bernardo Gonzalez Kriegel <bgkriegel@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #96540|0 |1 is obsolete| | --- Comment #3 from Bernardo Gonzalez Kriegel <bgkriegel@gmail.com> --- Created attachment 96593 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=96593&action=edit Bug 24262: Translate installer data in YAML format This patch adds the ability to: 1) Create new translation files from yaml installer files 2) Create installer directory for a given language It will not create a installer directory if it already exists. New (possible) translation files: xx-YY-installer.po xx-YY-installer-MARC21.po xx-YY-installer-UNIMARC.po Needs Bug 13897 (for yaml files) and Bug 18688 (for warnings) To test: 1) Apply patches from Bug 13897 and Bug 18688. 2) Apply this patch 3) Go to misc/translation 4) Create new translation files for a language $ ./translate create xx-YY check new file 'xx-YY-installer.po' 5) Copy ../../installer/data/mysql/en/optional/auth_val.yml into ../../installer/data/mysql/en/marcflavour/marc21/mandatory/ and ../../installer/data/mysql/en/marcflavour/unimarc/mandatory/ remove po/xx-YY*, then repeat creation check new files 'xx-YY-installer.po', 'xx-YY-installer-MARC21.po' and 'xx-YY-installer-UNIMARC.po' remove all new files 6) Create for xx-YY again and try update $ ./translate create xx-YY edit ../../installer/data/mysql/en/optional/auth_val.yml and change one char in one of the translatable values, also edit 'xx-YY-installer.po', translate the same string (in msgstr). Do an update $ ./translate update xx-YY check in 'xx-YY-installer.po' a fuzzy value for the translated value and the preservation of the translation Fix the translation, or add a new one. 7) Create an install dir for xx-YY ./translate install xx-YY Check new dir '../../installer/data/mysql/xx-YY/' Check files on it $ tree ../../installer/data/mysql/xx-YY/ and compare with ../../installer/data/mysql/en/ All installation files must be present 8) Try a new Koha install using this language in the usual way. Check in authorised_values for the translated string. 9) Try create an install dir for an existing language (eg. es-ES, de-DE or fr-FR ) Install dir is ignored and not changed. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24262 --- Comment #4 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- Comment on attachment 96593 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=96593 Bug 24262: Translate installer data in YAML format Review of attachment 96593: --> (https://bugs.koha-community.org/bugzilla3/page.cgi?id=splinter.html&bug=24262&attachment=96593) ----------------------------------------------------------------- ::: misc/translator/LangInstaller.pm @@ +937,4 @@
$self->install_prefs(); $self->install_messages(); $self->remove_pot(); + $self->install_installer();
Should not it be placed after remove_pot? @@ +971,4 @@
$self->create_prefs(); $self->create_messages(); $self->remove_pot(); + $self->create_installer();
Same here. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24262 --- Comment #5 from Bernardo Gonzalez Kriegel <bgkriegel@gmail.com> --- Hola Jonathan! (In reply to Jonathan Druart from comment #4)
...
$self->install_prefs(); $self->install_messages(); $self->remove_pot(); + $self->install_installer();
Should not it be placed after remove_pot?
The order is not relevant in this case, it can be at the beginning, end or middle. The new functions works independently of the old ones, with different target dirs. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24262 Bernardo Gonzalez Kriegel <bgkriegel@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #96593|0 |1 is obsolete| | --- Comment #6 from Bernardo Gonzalez Kriegel <bgkriegel@gmail.com> --- Created attachment 96626 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=96626&action=edit Bug 24262: Translate installer data in YAML format This patch adds the ability to: 1) Create new translation files from yaml installer files 2) Create installer directory for a given language It will not create a installer directory if it already exists. New (possible) translation files: xx-YY-installer.po xx-YY-installer-MARC21.po xx-YY-installer-UNIMARC.po Needs Bug 13897 (for yaml files) To test: 1) Apply patches from Bug 13897 2) Apply this patch 3) Go to misc/translation 4) Create translation files for a NEW language $ ./translate create xx-YY check new file 'xx-YY-installer.po' 5) Copy ../../installer/data/mysql/en/optional/auth_val.yml into ../../installer/data/mysql/en/marcflavour/marc21/mandatory/ and ../../installer/data/mysql/en/marcflavour/unimarc/mandatory/ remove po/xx-YY*, then repeat creation check new files 'xx-YY-installer.po', 'xx-YY-installer-MARC21.po' and 'xx-YY-installer-UNIMARC.po' remove all new files 6) Create for xx-YY again and try update $ ./translate create xx-YY edit ../../installer/data/mysql/en/optional/auth_val.yml and change one char in one of the translatable values, also edit 'xx-YY-installer.po', translate the same string (in msgstr). Do an update $ ./translate update xx-YY check in 'xx-YY-installer.po' a fuzzy value for the translated value and the preservation of the translation Fix the translation, or add a new one. 7) Create an install dir for xx-YY ./translate install xx-YY Check new dir '../../installer/data/mysql/xx-YY/' Check files on it $ tree ../../installer/data/mysql/xx-YY/ and compare with ../../installer/data/mysql/en/ All installation files must be present 8) Try a new Koha install using this language in the usual way. Check in authorised_values table for the translated string. 9) Try create an install dir for an existing language (eg. es-ES, de-DE or fr-FR ), eg. ./translate install de-DE Install dir is detected and not changed, a note is printed. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24262 Bernardo Gonzalez Kriegel <bgkriegel@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Depends on|18688 | Patch complexity|--- |Small patch Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18688 [Bug 18688] Warnings about UTF-8 charset when creating a new language -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24262 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Keywords| |rel_20_05_target CC| |martin.renvoize@ptfs-europe | |.com -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24262 Bernardo Gonzalez Kriegel <bgkriegel@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Blocks| |24594 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24594 [Bug 24594] Rewrite MARC21 mandatory data to YAML -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24262 Bernardo Gonzalez Kriegel <bgkriegel@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Blocks| |24593 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24593 [Bug 24593] Rewrite MARC21 optional data to YAML -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24262 Bernardo Gonzalez Kriegel <bgkriegel@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Blocks| |24584 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24584 [Bug 24584] Rewrite optional installation files to YAML -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24262 Bernardo Gonzalez Kriegel <bgkriegel@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Blocks| |24583 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24583 [Bug 24583] Rewrite mandatory installation files to YAML -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24262 Bernardo Gonzalez Kriegel <bgkriegel@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #96626|0 |1 is obsolete| | --- Comment #7 from Bernardo Gonzalez Kriegel <bgkriegel@gmail.com> --- Created attachment 98506 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=98506&action=edit Bug 24262: Translate installer data in YAML format This patch adds the ability to: 1) Create new translation files from yaml installer files 2) Create installer directory for a given language It will not create a installer directory if it already exists. New (possible) translation files: xx-YY-installer.po xx-YY-installer-MARC21.po xx-YY-installer-UNIMARC.po Needs Bug 13897 (for yaml files) NOTE: updated version adding ability to process multiline fields, discard small ( < 2) strings, and discard strings with pure html, TT or punctuation. To test: 1) Apply patches from Bug 13897 2) Apply this patch 3) Go to misc/translation 4) Create translation files for a NEW language $ ./translate create xx-YY check new file 'xx-YY-installer.po' 5) Copy ../../installer/data/mysql/en/optional/auth_val.yml into ../../installer/data/mysql/en/marcflavour/marc21/mandatory/ and ../../installer/data/mysql/en/marcflavour/unimarc/mandatory/ remove po/xx-YY*, then repeat creation check new files 'xx-YY-installer.po', 'xx-YY-installer-MARC21.po' and 'xx-YY-installer-UNIMARC.po' remove all new files 6) Create for xx-YY again and try update $ ./translate create xx-YY edit ../../installer/data/mysql/en/optional/auth_val.yml and change one char in one of the translatable values, also edit 'xx-YY-installer.po', translate the same string (in msgstr). Do an update $ ./translate update xx-YY check in 'xx-YY-installer.po' a fuzzy value for the translated value and the preservation of the translation Fix the translation, or add a new one. 7) Create an install dir for xx-YY ./translate install xx-YY Check new dir '../../installer/data/mysql/xx-YY/' Check files on it $ tree ../../installer/data/mysql/xx-YY/ and compare with ../../installer/data/mysql/en/ All installation files must be present 8) Try a new Koha install using this language in the usual way. Check in authorised_values table for the translated string. 9) Try create an install dir for an existing language (eg. es-ES, de-DE or fr-FR ), eg. ./translate install de-DE Install dir is detected and not changed, a note is printed. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24262 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- QA Contact|testopia@bugs.koha-communit |jonathan.druart@bugs.koha-c |y.org |ommunity.org CC| |jonathan.druart@bugs.koha-c | |ommunity.org -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24262 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #98506|0 |1 is obsolete| | --- Comment #8 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Created attachment 99396 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=99396&action=edit Bug 24262: Translate installer data in YAML format This patch adds the ability to: 1) Create new translation files from yaml installer files 2) Create installer directory for a given language It will not create a installer directory if it already exists. New (possible) translation files: xx-YY-installer.po xx-YY-installer-MARC21.po xx-YY-installer-UNIMARC.po Needs Bug 13897 (for yaml files) NOTE: updated version adding ability to process multiline fields, discard small ( < 2) strings, and discard strings with pure html, TT or punctuation. To test: 1) Apply patches from Bug 13897 2) Apply this patch 3) Go to misc/translation 4) Create translation files for a NEW language $ ./translate create xx-YY check new file 'xx-YY-installer.po' 5) Copy ../../installer/data/mysql/en/optional/auth_val.yml into ../../installer/data/mysql/en/marcflavour/marc21/mandatory/ and ../../installer/data/mysql/en/marcflavour/unimarc/mandatory/ remove po/xx-YY*, then repeat creation check new files 'xx-YY-installer.po', 'xx-YY-installer-MARC21.po' and 'xx-YY-installer-UNIMARC.po' remove all new files 6) Create for xx-YY again and try update $ ./translate create xx-YY edit ../../installer/data/mysql/en/optional/auth_val.yml and change one char in one of the translatable values, also edit 'xx-YY-installer.po', translate the same string (in msgstr). Do an update $ ./translate update xx-YY check in 'xx-YY-installer.po' a fuzzy value for the translated value and the preservation of the translation Fix the translation, or add a new one. 7) Create an install dir for xx-YY ./translate install xx-YY Check new dir '../../installer/data/mysql/xx-YY/' Check files on it $ tree ../../installer/data/mysql/xx-YY/ and compare with ../../installer/data/mysql/en/ All installation files must be present 8) Try a new Koha install using this language in the usual way. Check in authorised_values table for the translated string. 9) Try create an install dir for an existing language (eg. es-ES, de-DE or fr-FR ), eg. ./translate install de-DE Install dir is detected and not changed, a note is printed. Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24262 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Signed Off --- Comment #9 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Followed the test plan and all looks good to me.. Signing off -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24262 --- Comment #10 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- OK.. I'm loving this work.. I just had a moment of inspiration though.. what about upgrades? Currently, we add to both an atomicupdate file (which gets put into updatedatabase) and add nearly the same code into various .SQL files (now becoming .yaml files) for install time. I'm now wondering if as a further bug we could add a function into updatedatabase to walk through the tree of yaml files to install translated missing default data at the end of any run of updatedatabase and save ourselves from having to write the atomicupdate and the yaml file for such DB changes? -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24262 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Blocks| |24712 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24712 [Bug 24712] Use YAML files for some of the update data -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24262 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Keywords| |RM_priority -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24262 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |katrin.fischer@bsz-bw.de --- Comment #11 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- (In reply to Martin Renvoize from comment #10)
OK.. I'm loving this work..
I just had a moment of inspiration though.. what about upgrades?
Currently, we add to both an atomicupdate file (which gets put into updatedatabase) and add nearly the same code into various .SQL files (now becoming .yaml files) for install time. I'm now wondering if as a further bug we could add a function into updatedatabase to walk through the tree of yaml files to install translated missing default data at the end of any run of updatedatabase and save ourselves from having to write the atomicupdate and the yaml file for such DB changes?
I think this might get a little too complicated. For example libraries might have removed sample data on purpose, changed or reconfigured it. It would be hard to differentiate. We will want to add a new notice on update, but should respect if a library deleted it etc. (hope I understood correctly). So I think having different mechanisms (triggered for new and for a specific update) would be better. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24262 --- Comment #12 from Bernardo Gonzalez Kriegel <bgkriegel@gmail.com> --- Created attachment 100194 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=100194&action=edit Bug 24262: (followup) admit null values on labels This patch adds handling of null values on translatable labels. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24262 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Passed QA -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24262 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #99396|0 |1 is obsolete| | Attachment #100194|0 |1 is obsolete| | --- Comment #13 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- Created attachment 100344 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=100344&action=edit Bug 24262: Translate installer data in YAML format This patch adds the ability to: 1) Create new translation files from yaml installer files 2) Create installer directory for a given language It will not create a installer directory if it already exists. New (possible) translation files: xx-YY-installer.po xx-YY-installer-MARC21.po xx-YY-installer-UNIMARC.po Needs Bug 13897 (for yaml files) NOTE: updated version adding ability to process multiline fields, discard small ( < 2) strings, and discard strings with pure html, TT or punctuation. To test: 1) Apply patches from Bug 13897 2) Apply this patch 3) Go to misc/translation 4) Create translation files for a NEW language $ ./translate create xx-YY check new file 'xx-YY-installer.po' 5) Copy ../../installer/data/mysql/en/optional/auth_val.yml into ../../installer/data/mysql/en/marcflavour/marc21/mandatory/ and ../../installer/data/mysql/en/marcflavour/unimarc/mandatory/ remove po/xx-YY*, then repeat creation check new files 'xx-YY-installer.po', 'xx-YY-installer-MARC21.po' and 'xx-YY-installer-UNIMARC.po' remove all new files 6) Create for xx-YY again and try update $ ./translate create xx-YY edit ../../installer/data/mysql/en/optional/auth_val.yml and change one char in one of the translatable values, also edit 'xx-YY-installer.po', translate the same string (in msgstr). Do an update $ ./translate update xx-YY check in 'xx-YY-installer.po' a fuzzy value for the translated value and the preservation of the translation Fix the translation, or add a new one. 7) Create an install dir for xx-YY ./translate install xx-YY Check new dir '../../installer/data/mysql/xx-YY/' Check files on it $ tree ../../installer/data/mysql/xx-YY/ and compare with ../../installer/data/mysql/en/ All installation files must be present 8) Try a new Koha install using this language in the usual way. Check in authorised_values table for the translated string. 9) Try create an install dir for an existing language (eg. es-ES, de-DE or fr-FR ), eg. ./translate install de-DE Install dir is detected and not changed, a note is printed. Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24262 --- Comment #14 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- Created attachment 100345 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=100345&action=edit Bug 24262: (followup) admit null values on labels This patch adds handling of null values on translatable labels. Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24262 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Version(s)| |20.05.00 released in| | Status|Passed QA |Pushed to master -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24262 --- Comment #15 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Nice work everyone! Pushed to master for 20.05 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24262 Joy Nelson <joy@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |joy@bywatersolutions.com --- Comment #16 from Joy Nelson <joy@bywatersolutions.com> --- enhancement not backported to 19.11.x -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24262 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Keywords|rel_20_05_candidate, | |RM_priority | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24262 Jonathan Druart <jonathan.druart+koha@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Blocks| |32356 --- Comment #17 from Jonathan Druart <jonathan.druart+koha@gmail.com> --- Bernardo, do yo remember why you added that?
It will not create a installer directory if it already exists.
379 if ( -d $langdir ) { 380 say "$self->{lang} installer dir $langdir already exists.\nDelete it if you want to recreate it." if $self->{verbose}; 381 return; 382 } On upgrade we want to update the directory. Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32356 [Bug 32356] fr-FR installer dir /kohadevbox/koha/installer/data/mysql/fr-FR already exists. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24262 --- Comment #18 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- (In reply to Jonathan Druart from comment #17)
Bernardo, do yo remember why you added that?
It will not create a installer directory if it already exists.
379 if ( -d $langdir ) { 380 say "$self->{lang} installer dir $langdir already exists.\nDelete it if you want to recreate it." if $self->{verbose}; 381 return; 382 }
On upgrade we want to update the directory.
I agree, we want/need to update the files on update. I don't think we could/should handle this differently than other files that are overwritten. -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org