Until we have solved the packaging of koha template translations, provide a command that manages the installed translations in a proper way.
Created attachment 17411 [details] [review] Bug 10041 - Provide a koha-translate script to aid package users on installing translations Until we have solved the packaging of koha template translations, provide a command that manages the installed translations in a proper way. To test, build a Debian package of current master+the patches from this bug :-D and try the many options running koha-translate --help provide. The command itself can be grabbed from a git checkout with this patch applied to test the script's funcionality. If it (and its docs) fits the package building stuff, I'll test on monday when I can be back on my workstation. Sponsored-by: Universidad Nacional de Córdoba
Testing. 1) -i|u|r without lang code dies with (shift: can't shift that many) perhaps check if langcode and die with a graceful message. Unless you try to mimic what translate script do without lang code, install/update/remove all langs. 2) List all. There are 2 files with "opac" in name (prog|ccsr), so you report twice. Perhaps using $(ls $PO_DIR *-i-opac-t-prog-v-3006000.po)? 3) Install. Could test if all lang files are present? (staf|opac|ccsr|pref) only to report any missing, and then proceed (translate script will complain anyway). 4) Remove ok. Sysprefs language and opaclanguages could reference a removed lang but I think it's harmless. 5) Update. The message if you try to install again a lang is misleading. update option in 'misc/translator/translate' script is not to update translated files but to update translation files (PO). So, if your update is to re-install, do so (install) silently. Or change the message to reflect what you are really doing and allow a re-install. Or remove update option. No koha-qa errors.
Created attachment 17462 [details] [review] Bug 10041 - Provide a koha-translate script to aid package users on installing translations Until we have solved the packaging of koha template translations, provide a command that manages the installed translations in a proper way. To test, build a Debian package of current master+the patches from this bug :-D and try the many options running koha-translate --help provide. The command itself can be grabbed from a git checkout with this patch applied to test the script's funcionality. If it (and its docs) fits the package building stuff, I'll test on monday when I can be back on my workstation. Sponsored-by: Universidad Nacional de Córdoba
(In reply to comment #2) > Testing. > > 1) -i|u|r without lang code dies with (shift: can't shift that many) > perhaps check if langcode and die with a graceful message. > Unless you try to mimic what translate script do without lang code, > install/update/remove all langs. Ok, fixed. > 2) List all. There are 2 files with "opac" in name (prog|ccsr), > so you report twice. > Perhaps using $(ls $PO_DIR *-i-opac-t-prog-v-3006000.po)? I did't notice because the current packages don't ship the ccsr theme. Fixed. > 3) Install. Could test if all lang files are present? (staf|opac|ccsr|pref) > only to report any missing, and then proceed (translate script will > complain anyway). Added the -c|--check switches. The check is performed on update and install commands, and prevents from running if some .PO file is missing. > 4) Remove ok. Sysprefs language and opaclanguages could reference > a removed lang but I think it's harmless. Oh, at least I wrote an 'rm -rf' command that does not fail! > 5) Update. The message if you try to install again a lang is misleading. > update option in 'misc/translator/translate' script is not to > update translated files but to update translation files (PO). > So, if your update is to re-install, do so (install) silently. > Or change the message to reflect what you are really doing > and allow a re-install. > Or remove update option. As I'm focusing on the end user (non-techie) the idea is that new .PO are provided and they can use the script to update the templates. So, different semantics from the 'translate' command. Fixed.
Created attachment 17469 [details] [review] Bug 10041 - Provide a koha-translate script to aid package users on installing translations Until we have solved the packaging of koha template translations, provide a command that manages the installed translations in a proper way. To test, build a Debian package of current master+the patches from this bug :-D and try the many options running koha-translate --help provide. The command itself can be grabbed from a git checkout with this patch applied to test the script's funcionality. If it (and its docs) fits the package building stuff, I'll test on monday when I can be back on my workstation. Sponsored-by: Universidad Nacional de Córdoba
Created attachment 17472 [details] [review] Bug 10041 - Provide a koha-translate script to aid package users on installing translations Until we have solved the packaging of koha template translations, provide a command that manages the installed translations in a proper way. To test, build a Debian package of current master+the patches from this bug :-D and try the many options running koha-translate --help provide. The command itself can be grabbed from a git checkout with this patch applied to test the script's funcionality. If it (and its docs) fits the package building stuff, I'll test on monday when I can be back on my workstation. Sponsored-by: Universidad Nacional de Córdoba
Created attachment 17473 [details] [review] Bug 10041 - Provide a koha-translate script to aid package users on installing translations Until we have solved the packaging of koha template translations, provide a command that manages the installed translations in a proper way. To test, build a Debian package of current master+the patches from this bug :-D and try the many options running koha-translate --help provide. The command itself can be grabbed from a git checkout with this patch applied to test the script's funcionality. If it (and its docs) fits the package building stuff, I'll test on monday when I can be back on my workstation. Sponsored-by: Universidad Nacional de Córdoba
Created attachment 17494 [details] [review] [SIGNED-OFF] Bug 10041 - Provide a koha-translate script to aid package users on installing translations Until we have solved the packaging of koha template translations, provide a command that manages the installed translations in a proper way. To test, build a Debian package of current master+the patches from this bug :-D and try the many options running koha-translate --help provide. The command itself can be grabbed from a git checkout with this patch applied to test the script's funcionality. If it (and its docs) fits the package building stuff, I'll test on monday when I can be back on my workstation. Sponsored-by: Universidad Nacional de Córdoba Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com> Comment: Good adition. Work as described. No errors. Copied to /usr/local/bin. No errors on install, update, remove, list and check.
(In reply to comment #8) > Created attachment 17494 [details] [review] [review] > [SIGNED-OFF] Bug 10041 - Provide a koha-translate script to aid package > Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com> QA-comment: woah, looks good! :) hmmm, one small problem for me - creating a fr-FR language dir failed Tomás, any ideas? see below... # which koha-translate /usr/sbin/koha-translate # koha-translate -l en en-NZ Kore-KR # koha-translate -l -a|grep FR fr-FR # koha-translate -i fr-FR Error: /usr/share/koha/misc/translator/po/fr-FR-opac-ccsr.po not found.
(In reply to comment #9) > (In reply to comment #8) > > Created attachment 17494 [details] [review] [review] [review] > > [SIGNED-OFF] Bug 10041 - Provide a koha-translate script to aid package > > Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com> > > QA-comment: woah, looks good! :) > > hmmm, one small problem for me - creating a fr-FR language dir failed ahh, sorry - my fault here passing QA...
This patch has been pushed to master and 3.12.x.
Pushed to 3.10.x will be in 3.10.6