Bug 9161: Translate only specific files
authorJonathan Druart <jonathan.druart@biblibre.com>
Wed, 28 Nov 2012 10:04:35 +0000 (11:04 +0100)
committerGalen Charlton <gmc@esilibrary.com>
Fri, 24 May 2013 16:08:25 +0000 (09:08 -0700)
commit65258180761ecd0df91441f01207f18ccc10936e
tree6be7df43ce0ca19d93f9ad1a152fecdeb8bdf33f
parent022e5974a3de505ee5019aaba7f1a80f42eda21c
Bug 9161: Translate only specific files

The previous version of tmpl_process3.pl says in the pod:

  -i, --input=SOURCE          Get or update strings from SOURCE file.
                              SOURCE is a directory if -r is also specified.

But is was not possible to specify one or more files.

This patch allows us to give one or more specific file with the -f
parameter.

for eg.:

perl tmpl_process3.pl install -i /home/koha/koha-tmpl/opac-tmpl/prog/en/modules/
    -o /home/koha/koha-tmpl/opac-tmpl/prog/fr-FR/modules/
    -s /home/koha/misc/translator/po/fr-FR-i-opac-t-prog-v-3006000.po
    -r
    -f opac-account.tt
    -f opac-main.tt

You can specify:
  -f advsearch.tt => translate all files with a filename containing
  'advsearch.tt'
or
  -f search => will translate acqui/histsearch.tt, acqui/z3950_search.tt, etc.

Bug 9161: Followup: Add a -f param for the translate script

Now you can directly call the translate script
(misc/translator/translate) with the -f parameter

eg.:
./translate install|create|update -f search.tt -f main.tt

Signed-off-by: Frédéric Demians <f.demians@tamil.fr>
I've squashed the 3 patches, and reported doc into 'translate' script.
It works as advertised.

Side note: It would be great to extend this functionnality in order to
be able to apply the translation to XSL files stored outside Koha
directories hierarchy. Useful to translate site-specific XSLs defined
with XSLTResultsDisplay, and other sysprefs.

Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
misc/translator/LangInstaller.pm
misc/translator/tmpl_process3.pl
misc/translator/translate