Just upgraded our Koha container to 14.04 and noticing the
misc/translator/translate doesn't work. This is because of a missing
package gettext.
This patch makes ./translate die with a helpful suggestion to install
gettext if xgettext-program is missing.
Signed-off-by: Frederic Demians <f.demians@tamil.fr>
I can reproduce the bug by desinstalling 'gettext' package on a Debian
box. I confirm that without this patch, 'translate' command fails
miserably. Suggesting to install gettext package is welcomed.
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Jesse Weaver <jweaver@bywatersolutions.com>
This patch renames translation files for Bengali
language, from ben-* to bn-IN-*.
Also adds India as region
To test:
1) Apply the patch
2) Run updatedatabase
3) Install Bengali language
cd misc/translator
perl translate install bn-IN
enable
Check correct description
4) Create and install a fake Bengali variant
cd misc/translator
perl translate create bn-XX
perl translate install bn-XX
enable both variants
Check correct rendering of region
Results comply with expected test plan outcome. Signed off for bn-IN
Signed-off-by: Indranil Das Gupta (L2C2 Technologies) <indradg@gmail.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
This patch gives a partial solution for this problem.
It ignores strings like "[% something %]", but not
"[% IF ( value ) %][% value %][% END %]"
We get 100+ strings less to translate
To test:
1) Update translation files for your preferred language
2) Apply the patch
3) Update again
4) Compare, you must find 100+ strings removed from
translation files
eg.
-msgid "[% SEARCH_RESULT.biblionumber |url %]"
-msgid "[% accepteddate | $KohaDates %]"
-msgid "[% amountoutstanding | format('%.2f') %]"
-msgid "[% authtypetext |html %]"
-msgid "[% barcode_llx |html %]"
-msgid "[% barcode_lly |html %]"
-msgid "[% biblio.quantity.length ? biblio.quantity : 1 %]"
-msgid "[% billingdate | $KohaDates %]"
-msgid "[% borname |html %]"
...
Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Verified all strings removed from the po files were
pure TT.
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
This patch implements separate PO files for
different MARC dialects.
It depends on correct filenames, i.e. it will build PO
files using files with/without "unimarc|normarc|marc21"
on their names.
Changes:
A) LangInstaller.pm
Added definitions to create or update xx-YY-{MARCFLAVOR}.po,
minor change to create and install procedure, and modification
of install procedure to handle multiple target dirs.
Updated documentation.
B) Standarization of filenames
STAFF po file is now xx-YY-staff-prog.po
MARC dialects po files are xx-YY-marc-{MARCFLAVOUR}.po
To test:
1) Update po files for your preferred language, ej. nn-NO
cd misc/translator
perl translate update nn-NO
2) Do some copying/renaming
cp po/nn-NO-i-staff-t-prog-v-3006000.po po/nn-NO-marc-UNIMARC.po
cp po/nn-NO-i-staff-t-prog-v-3006000.po po/nn-NO-marc-NORMARC.po
cp po/nn-NO-i-staff-t-prog-v-3006000.po po/nn-NO-marc-MARC21.po
mv po/nn-NO-i-staff-t-prog-v-3006000.po po/nn-NO-staff-prog.po
(most MARC dialect strings are on staff, so we use that as basis)
3) Apply the patch
4) Update again to fix translation files, verbose
perl translate update nn-NO -v
5) Install language, verbose, verify translations
perl translate install nn-NO -v
6) Create translation files
rm po/nn-NO*
perl translate create nn-NO
we must have this list:
po/nn-NO-marc-MARC21.po
po/nn-NO-marc-NORMARC.po
po/nn-NO-marc-UNIMARC.po
po/nn-NO-opac-bootstrap.po
po/nn-NO-pref.po
po/nn-NO-staff-help.po
po/nn-NO-staff-prog.po
Additional tests:
7) Number of msgids
7.a) Before patch and after upgrade, extract and count msgids
for i in $(ls po/nn-NO-*po); \
do msginit -i $i -o nn-old.po --no-translator --no-wrap --locale=nn_NO; \
egrep ^msgid nn-old.po >> old; \
done
sort old | uniq | tee s-old | wc -l > n-old
s-old: have all msgids
n-old: number of msgids
7.b) After patch and after creation of new files
Repeat procedure, diferent files (s-new, n-new)
7.c) Compare (diff s-old snew), they are the same
(save for a strange UNIMARC char in my case, but
it's present on corresponding PO file)
8) Installed dirs/files
8.a) List of EN dirs/files
cd koha-tmpl
find | egrep "/en/" > en
8.b) List of nn-NO dirs/files. After patch and language install
cd koha-tmpl
find | egrep "/nn-NO/" | sed 's|/nn-NO/|/en/|' > nn
8.c) Compare (diff en nn), they are the same
Signed-off-by: Magnus Enger <magnus@enger.priv.no>
Followed the steps outlined by Bernardo, and everything works as
expected. I think the most important points are that "perl translate
create nn-NO" produces the right files, and translating anything in
them, then doing "translate install" makes the translations show
up in the interface. The numbers msgids in the nn-NO correspond
well wit the number of msgids in other sets of .po files.
I bet y'all will be happy when you don't have to see the stupid
Norwegian strings when you translate! ;-)
Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
Signed-off-by: Chris Nighswonger <cnighswonger@foundations.edu>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
http://bugs.koha-community.org/show_bug.cgi?id=9987
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
This patch set as fuzzy some strings on translation files
that are incorrectly translated
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
Makes translations work.
I left the code logic intact, and simply removed "text" from the regex.
Text input field values are now translated, no other logical changes are introduced.
Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>
Test:
1) Update, install and enable es-ES language
2) Go to Reports > Acquisition wizard
3) On page bottom, there is a text field with the word 'Export'
4) Switch language, the word is not translated
5) Apply the patch
6) Update and install again es-ES language
7) Reload page, text now reads 'Exportar'
No koha-qa errors.
Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
A dir creation was uncommented (by me), the effect is
create a lang dir on 'update', which is no needed.
To test:
1) Update translation files for a uninstalled language
(cd misc/translator; ./translate update xx-YY)
2) Check new dirs
koha-tmpl/opac-tmpl/bootstrap/xx-YY/
koha-tmpl/intranet-tmpl/prog/xx-YY/
koha-tmpl/intranet-tmpl/prog/en/modules/help/xx-YY/
3) Clean all
git clean -f -d
4) Apply the patch
5) Repeat 1) (i.e. update)
6) Check no new dirs this time
Signed-off-by: Frederic Demians <f.demians@tamil.fr>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Tested according to test plan, works as described.
Passes tests and QA script.
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
Kurdish translation files use a variant of Arabic script,
they need to be displayed as RTL.
Currently that is inferred from language dir name after
translation, and that name use the language tag, so we
need to change it from 'ku' to 'ku-Arab'
To test:
1) Translate to Kurdish
(cd misc translator; ./translate install ku)
2) Enable Kurdish on opac/staff
3) Test staff/opac interface, they are displayed as LTR
which is wrong
4) Disable Kurdish language
5) Do a cleanup (git clean -f -d)
5) Apply the patch
6) Translate again
(cd misc translator; ./translate install ku-Arab)
7) Enable again
8) Test again, this time display is correct (LTR)
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
Easy to test. Well spotted Bernardo.
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Works as described.
Patch removes outdated translation tool documentation
from the misc/translator directory.
Signed-off-by: Magnus Enger <digitalutvikling@gmail.com>
Removing these lines sounds like a good idea. I tested by
applying the patch and checking that the files in question
are gone.
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
This patch makes opac translation files theme independent
A side effect is that current prog translation file is
renamed.
But the renaming is not added, that gives a patch of ~60M!
Current list of languages are now obtained from pref files.
To test:
1) Apply the patch
2) For your preferred language, rename opac prog file
from 'xx-YY-i-opac-t-prog-v-3006000.po' to 'xx-YY-opac-prog.po'
3) Update that language, there must be no errors
cd misc/translation
./translate update xx-YY [-v]
Check updated po files
4) Install any language, there must be no errors
./translate install xx-YY
Check prog theme for that language
5) Create translation files. Remove a language or create new lang files
./translate create zz-WW
ls -l po/zz-WW*po
check there are 3 files (and *~) for opac
6) Check updated pod for LangInstaler.pm and translate script
When PROG/CCSR themes are removed, I'll add a Bug to remove
corresponding files.
Perhaps RM could add a followup to rename all files,
cd misc/translator/po
for old in $(ls *opac-t*); do
new=$(echo $old | sed 's/-i-opac-t-prog-v-3006000/-opac-prog/');
git mv $old $new;
done
Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Works as described, no problems found.
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
This patch modifies LangInstaller.pm to catch strings
on syspref files that have no associated syspref
To test:
1) Update strings for your preffered language
2) Check that the string "you can only choose one source"
is not present on xx-YY-pref.po file
3) Apply the patch
4) Update strings again
5) Check the strig now appears [ and another one :) ]
Doing a diff before and after will show
# Enhanced Content > All
msgid "enhanced_content.pref## <strong>NOTE:</strong> you can only
choose one source of cover images from below, otherwise Koha will show
the images from all sources selected."
msgstr ""
# Local Use
msgid "local_use.pref## Nothing defined yet."
msgstr ""
6) Translate the string
7) Install your language, check Administration > System preferences >
Enhanced content > All
(on your languge) and check the string is now translated
Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
This patch adds options to include/exclude files by matching their names.
Also modifies current code to check only filenames (not dirs)
Checking is case insensitive !!
NOTE: The difference between -f and -m is subtle, but important.
They differs mainly on update,: -f do a merge, -m a replace
To test after patch:
A) Include only 'normarc'
1. create
cd misc/translator
perl tmpl_process3.pl create -i ../../koha-tmpl/opac-tmpl/bootstrap/en -s normarc.po -r -m normarc
- check provenance of strings
egrep "^#:" normarc.po | cut -d":" -f2 | sort | uniq
- only files with normarc in their names must be present
2. update
perl tmpl_process3.pl update -i ../../koha-tmpl/opac-tmpl/bootstrap/en -s normarc.po -r -m normarc
- repeat check
3. install
mkdir test
perl tmpl_process3.pl install -i ../../koha-tmpl/opac-tmpl/bootstrap/en -o ./test -s normarc.po -r -m normarc
- check name of created files
rm -rf test normarc.po
B) Exclude
4. create
perl tmpl_process3.pl create -i ../../koha-tmpl/opac-tmpl/bootstrap/en -s xnormarc.po -r -n normarc
- check provenance
egrep "^#:" xnormarc.po | cut -d":" -f2 | sort | uniq | grep -i normarc
- there must be no results
5. update
perl tmpl_process3.pl update -i ../../koha-tmpl/opac-tmpl/bootstrap/en -s xnormarc.po -r -n normarc
- check provenance
6. install
mkdir test
perl tmpl_process3.pl install -i ../../koha-tmpl/opac-tmpl/bootstrap/en -o ./test -s xnormarc.po -r -n normarc
- check files
find test | grep -i normarc
- there must be no results
You can also try another combination, use for example "-m patron -m user -m bottom" (or use -n)
or mixed "-m marc -n normarc", do create/install and look filenames
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
This patch adds the option to use multiple source
dirs for tmpl_process3.pl on create/update actions.
To test after patch:
A) Old
1. install
cd misc/translator
perl tmpl_process3.pl create -i ../../koha-tmpl/opac-tmpl/bootstrap/en -s bootstrap.po -r
2. update
perl tmpl_process3.pl update -i ../../koha-tmpl/opac-tmpl/bootstrap -s bootstrap.po -r
3. install
mkdir test
perl tmpl_process3.pl install -i ../../koha-tmpl/opac-tmpl/bootstrap -s bootstrap.po -r -o ./test -q
- check same number of files
ls -lR ../../koha-tmpl/opac-tmpl/bootstrap | wc -l
ls -lR ./test | wc -l
rm -f bootstrap.po
B) New
4. create from multiple sources
perl tmpl_process3.pl create -i ../../koha-tmpl/opac-tmpl/prog/en -i ../../koha-tmpl/opac-tmpl/bootstrap/en -i ../../koha-tmpl/opac-tmpl/ccsr/en -s opac.po -r
5. update from multiple source
perl tmpl_process3.pl update -i ../../koha-tmpl/opac-tmpl/prog/en -i ../../koha-tmpl/opac-tmpl/bootstrap/en -i ../../koha-tmpl/opac-tmpl/ccsr/en -s opac.po -r
6. install (must give an error)
perl tmpl_process3.pl install -i ../../koha-tmpl/opac-tmpl/prog/en -i ../../koha-tmpl/opac-tmpl/bootstrap -s opac.po -r -o ./test
7. updated help
perl tmpl_process3.pl --help
Any other functionality must not be affected
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
This patch modifies the update process for PO files,
removing obsoleted strings. Currently they are removed
manually as part of the standar procedure of strings update.
Also backup files (*~) need to be removed manually.
To test:
1. Update translation files for any language, ej. fi-FI
(cd misc/translation; perl translate update fi-FI)
2. Check existence of obsoleted strings
egrep "#~ msg" misc/translator/po/fi-FI-*
3. Check existence of backup files
ls misc/translator/po/fi-FI-*~
4. Reset to HEAD and clean
5. Apply the patch
6. Update again, check there are no more obsoleted
strings nor backup files
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
Since we switched to Template Toolkit we don't need to stick with the
sufix we used for HTML::Template::Pro.
This patch changes the occurences of '.tmpl' in favour of '.tt'.
To test:
- Apply the patch
- Install koha, and verify that every page can be accesed
Regards
To+
P.S. a followup will remove the glue code.
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
Using perl v5.18, the following is warned on updating/installing
templates:
Smartmatch is experimental at ./translate line 54.
Moreover, the following should exist with previous perl versions:
perlcritic xgettext
Subroutine prototypes used at line 29, column 1. See page 194 of PBP.
(Severity: 5)
Subroutine prototypes used at line 44, column 1. See page 194 of PBP.
(Severity: 5)
Subroutine prototypes used at line 60, column 1. See page 194 of PBP.
(Severity: 5)
Subroutine prototypes used at line 72, column 1. See page 194 of PBP.
(Severity: 5)
Subroutine prototypes used at line 89, column 1. See page 194 of PBP.
(Severity: 5)
Variable declared in conditional statement at line 105, column 13.
Declare variables outside of the condition. (Severity: 5)
Subroutine prototypes used at line 127, column 1. See page 194 of PBP.
(Severity: 5)
Subroutine prototypes used at line 136, column 1. See page 194 of PBP.
(Severity: 5)
Variable declared in conditional statement at line 190, column 7.
Declare variables outside of the condition. (Severity: 5)
Subroutine prototypes used at line 237, column 1. See page 194 of PBP.
(Severity: 5)
Bareword file handle opened at line 238, column 5. See pages 202,204 of
PBP. (Severity: 5)
Two-argument "open" used at line 238, column 5. See page 207 of PBP.
(Severity: 5)
Subroutine prototypes used at line 277, column 1. See page 194 of PBP.
(Severity: 5)
Subroutine prototypes used at line 311, column 1. See page 194 of PBP.
(Severity: 5)
Bareword file handle opened at line 350, column 9. See pages 202,204 of
PBP. (Severity: 5)
Two-argument "open" used at line 350, column 9. See page 207 of PBP.
(Severity: 5)
Bareword file handle opened at line 353, column 5. See pages 202,204 of
PBP. (Severity: 5)
Bareword file handle opened at line 359, column 5. See pages 202,204 of
PBP. (Severity: 5)
Two-argument "open" used at line 359, column 5. See page 207 of PBP.
(Severity: 5)
perl -wc xgettext.pl
\1 better written as $1 at TmplTokenizer.pm line 474.
main::token_negligible_p() called too early to check prototype at
xgettext.pl line 52.
xgettext.pl syntax OK
Test plan:
Apply this patch and verify the warnings/errors does not appear anymore
and no regression is found on creating/updating/installing templates.
Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>
Work as described, no koha-qa errros.
Tested with perl v5.18.2
No warnings, no problem detected on create/update/install i18n files
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
Instead of writing
use CGI;
use Koha::I18N;
my $cgi = new CGI;
my $lh = Koha::I18N->get_handle_from_context($cgi, 'intranet');
print $lh->maketext('my translatable text');
you can now write
use Koha::I18N;
print gettext('my translatable text');
Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
CHARSET is now automatically replaced by UTF-8, and 'update' creates the
PO file if it does not exist.
Also do not try to create PO files if POT file creation failed (when
there is no messages to translate for example).
+ add some verbosity
+ add Locale::Maketext and Locale::Maketext::Lexicon to Koha
dependencies
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
You have to use the new module Koha::I18N
Code example:
use Koha::I18N;
use CGI;
my $input = new CGI;
my $lh = Koha::I18N->get_handle_from_context($input, 'intranet');
print $lh->maketext("Localized string!");
PO files are in misc/translator/po/LANG-messages.po.
Creation of PO files are integrated to existing workflow, so to create
PO file for a language, just run in misc/translator:
./translate create LANG
To update:
./translate update LANG
You can then translate the PO with your favorite editor. Strings will be
localized at runtime.
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Works as advertised. Some details needing further attention noted on bug
report.
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
This patch removes several types of strings from the
PO files that cannot be usefully translated, including
ones that consist entirely of punctuation and/or HTML entities.
Test:
1) Update PO files of some lang, xx-YY-*po
cd misc/translator
perl translate update xx-YY
2) Do it again, just in case
3) rm po/xx-YY*po~
4) Extract all msgid's, sorted
cat po/xx-YY*po | egrep "^msgid" | sort | uniq > xx-YY-pre
5) Apply the patch
6) Repeat 1-3
7) Repeat 4 again, other file
cat po/xx-YY*po | egrep "^msgid" | sort | uniq > xx-YY-post
8) Do a diff, inspect results, only strings with %s and \s
diff xx-YY-pre xx-YY-post | less
Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>
Works as described, 380 strings less to 'translate'
No koha-qa errors.
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Tested according to test plan, works as described.
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
The SQL column headers is stored into the columns.def file.
This file is not managed by the translation script.
This patch makes possible the headers translation.
Note: The translation xml tags were added to avoid all lines being put
on a single line.
Test plan:
1/ update your po file
cd misc/translate;
perl translate -f columns update LANG # Replace by another language here
2/ translate header columns (search "columns.def" in your po file).
3/ install the translated columns.def
perl translate -f columns install LANG # Replace by another language here
4/ go on the report module > create a new report > next > next
5/ change the language
on the 3rd step, you should see the column header translated.
Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>
Work as described, no koha-qa errors
[on es-ES about a third of the strings translated!! :-) ]
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Works as described and fixes a long standing translation
problem.
Passes all tests and QA script.
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
This patch enable deletion of temp files used by
tmpl_process3.pl.
Just removed coments on existing code
To test:
1. Do a count of files on /tmp ( ls /tmp | wc -l )
2. Update preferred language
3. Count again, new files on /tmp
4. Apply the patch
5. Update again, check, no new files
Signed-off-by: Mark Tompsett <mtompset@hotmail.com>
NOTE: I watched what temp files were actually in /tmp to make
sure other processes didn't magically increase/decrease
the number.
$ perl translate update {lang code}
generated 10 temporary files for me (2x5 po files). After
removing those ten files, and applying the patch, no
other files were generated.
Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
These lines has been commented by commit
a399dcefad without any apparent good
reason.
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
The problem is with the name of PO files
Currently Koha expect, among other variants, that PO filenames
began with (using as example *-pref.po):
{lang}-pref.po
{lang}-{region}-pref.po
{lang}-{script}-pref.po
{lang}-{script}-{region}-pref.po
and expect 2 chars for lang and region, and 4 for script
So the problem with Thai translation files are that it's names
do not match that convention.
This patch only rename Thai files as th-THA-* to th-TH-*.
In that way language description is right.
translate script use that chars to make dirs, and use dirs to find
description.
To test:
1) Go to I18N/L10N sysprefs
2) Install th-THA language (or simply mkdir koha-tmpl/intranet-tmpl/prog/th-THA)
3) Reload page, wrong description
4) Apply patch
5) Install th-TH language (or simply mkdir koha-tmpl/intranet-tmpl/prog/th-TH)
6) Reload page, right description
7) If you want do "mkdir koha-tmpl/intranet-tmpl/prog/th-Thai", reload,
also right description
To the reporter of this Bug: the rename of the folder is a good
workaround, when this patch is pushed to stable I'll rename Thai
files
Signed-off-by: Mark Tompsett <mtompset@hotmail.com>
This does not correct existing problems which need human
intervention. It does, however, allow for a correct installation
of Thai after the patch is made.
If we really want a patch for fixing an existing install. I
wrote it, but have not tested it.
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
As pointed out by Mark, this does not fix existing installations.
Putting a note in the release notes might be something we can do here.
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Bug 7934 breaks the -f option introduced in bug 9161; this patch
repairs the regression.
While the generation of the command tmpl_process3.pl, a space is
missing if the -x option is given.
The tmpl_process3.pl is called like:
/home/koha/src/misc/translator/tmpl_process3.pl -q update -i
/home/koha/src/koha-tmpl/intranet-tmpl/prog/en/ -s
/home/koha/src/misc/translator/po/fr-FR-i-staff-t-prog-v-3006000.po -r
-x 'help'-f pay.tt
Revised test plan:
1) cd ./misc/translator
2) put a warn at LangInstaller.pm line 375.
3) time ./translate update fr-FR -f pay.tt
-- note the execution time and the output. The options in the
command contain "-x 'help'-f pay.tt"
The -f param is not passed to the script.
The execution time is strangely long.
5) git reset --hard origin/master
6) apply this patch
7) put a warn at LangInstaller.pm line 375.
8) time ./translate update fr-FR -f pay.tt
-- verify the output and the execution time is now corrected.
Signed-off-by: Mark Tompsett <mtompset@hotmail.com>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Passes all tests and QA script.
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
This patch modifies LangInstaller.pm to enable separation
of translation for Staff UI and Staff Help files.
It's a move that make sense, Help strings accounts for
44% of total word count for Staff, and as stated on
Comment #1, it could enable a different workflow on
translation work.
It's more a hack than an elegant solution, but it works.
Feel free to suggest another approach.
To test:
We need to test complete functionality, i.e. create and update
translation files and install translation, and verify that no
string is missing.
1) Before applying the patch, we need some data from staff file.
Pick your language, say de_DE, and
cd misc/translator/
perl translate update de-DE
msginit -i po/de-DE-i-staff-t-prog-v-3006000.po -o de-old.po --no-translator --no-wrap --locale=de_DE
egrep ^msgid de-old.po | sort | tee s-old | wc -l > number-old
We have the file s-old with all strings, and the number of strings on number-old
2) Apply the patch
3) New help file is called de-DE-staff-help.po, so create one
cp'ing old staff on new help
cp po/de-DE-i-staff-t-prog-v-3006000.po po/de-DE-staff-help.po
4) Make a new update, and analize
perl translate update de-DE
msginit -i po/de-DE-i-staff-t-prog-v-3006000.po -o de-new.po --no-translator --no-wrap --locale=de_DE
msginit -i po/de-DE-staff-help.po -o de-help.po --no-translator --no-wrap --locale=de_DE
egrep ^msgid de-new.po | sort | tee s-new | wc -l > number-new
egrep ^msgid de-help.po | sort | tee s-help | wc -l > number-help
cat s-new s-help | sort | uniq | tee s-all | wc -l > number-all
cat s-new s-help | sort | uniq -d | tee s-dup | wc -l > number-dup
Ideally what we need to found is:
diff s-old s-all = zero lines (old strings vs new strings)
In my test I got one line, but it's a false positive (the string "• " is present on new staff)
On numbers,
number-old - number-new - nummber-help + number-dup = 0
or
number-old - number-all = 0
(in my test again I have 1 as result, same string. Also there are 137
repeated lines between new staff and help)
All this tells me that all string to translate are preserved
5) Install translation
perl translate install de-DE
Enable language on staff, and check that help files are translated
6) Finally, create translation files
rm po/de-DE-*
perl translate create de-DE
verify that all files are created. Tests of 4) can be repeated.
7) Verify that no strings from help are present on staff UI file
egrep help po/de-DE-i-staff-t-prog-v-3006000.po
Only results came from help-top and bottom, and a few "help" on staff strings
Signed-off-by: Fridolyn SOMERS <fridolyn.somers@biblibre.com>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Tested according to test plan. Checked various pages in OPAC,
staff and intranet, translation was ok.
Passes QA script and tests.
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Without this patch, the -f param (for the translate script) add the
modified line in the po file BUT comment all lines from others files.
This patch concat the generated file with the previous one and merge
them. This way produce a pretty po file with all our strings :)
+ Modification in LangInstaller.pm to fix a bug when the -f param was not
given.
Test plan:
1/ Update your po file :
cd misc/translator
perl translate update fr-FR
git commit -a -m"TMP PO"
2/ Modification on 2 files:
ie.
catalogue/advsearch.tt:32 <h1>Advanced search Foo</h1>
catalogue/issuehistory.tt:38 <th>Patron Bar</th>
3/ Update your po file with only the first file:
perl translate update fr-FR -f advsearch.tt
4/ Edit your po file and check that only the foo string is present (or
git diff).
5/ Update your po file with only the second file:
perl translate update fr-FR -f issuehistory
6/ Edit your po file and check that 2 strings are present (or git diff).
7/ Change the translation for these 2 strings and delete the fuzzy
lines.
8/ Install the first file for your language:
perl translate install fr-FR -f advsearch.tt
9/ Edit your translated file and verify the string is translated. Check
that the issuehistory.tt file is not changed.
10/ Same for issuehistory:
perl translate install fr-FR -f issuehistory
11/ stash your modification in your tt files (or reset --hard):
git stash
12/ Check in your po file that the 2 strings are commented (git diff).
13/ To finish, install all template files and check that they are
replaced correctly:
perl translate install fr-FR
Signed-off-by: Frédéric Demians <f.demians@tamil.fr>
I have squashed the both follow-up patches.
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
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>
With this patch, header is created when creating a new syspref .po file
for a new language (translate create), and is added if it doesn't
already exist when updating an existing language (translate update).
To test:
(1) Create a new language syspref file:
./translate create -p xx-XX
Check that there is an header
(2) Update an existing syspref file without header:
./translate update fr-FR
Check that fr-FR-pref.po has a header
(3) Update an existing syspref file with header:
Modify fr-FR-pref.po. Add an email, or whatever.
./translate update fr-FR
Check that fr-FR-pref.po has a header with the manual modification
Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>
Comment: Work as described. No errors.
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
All tests and QA script pass.
Also tested that updated pref files can still be installed correctly.
Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Comment on second patch.
Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
Patch removes misc/translator/stats.pl that is no
longer used and references deleted script
update.pl in same directory.
Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
Signed-off-by: Magnus Enger <magnus@enger.priv.no>
"perldoc misc/translator/translate" looks good and now mentions
the -v option.
Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
Modify /misc/translator/translate script in order to manage properly alternate
OPAC templates.
To test it with new 'ccsr' template:
- Create the .po file:
./translate create fr-FR
Result: existing .po files are not modified. A new fr-FR-opac-ccsr.po file is
available.
- Install all templates :
./translate install fr-FR
Result: A new koha-tmpl/opac-tmpl/ccsr/fr-FR directory contains translated
templates.
- Update .po files:
./translate update fr-FR
Result: fr-FR .po files are update, include fr-FR-opac-ccsr.po
Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
Fix syntax errors preventing the scripts misc/translator/text-extract2.pl
and misc/cronjobs/thirdparty/TalkingTech_itiva_inbound.pl from compiling.
Remove misc/migration_tools/build6xx.pl entirely since it refers to
columns that no longer exist in the Koha database, and has seemingly
had broken encoding since Koha switched from CVS to git (or before!).
Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
(Severity: 5)
Note: Rebased on master 06/09/2012 by jcamins
Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
This patch deal with the -v flag that you can put on translate script.
If you run without -v, the process should be silent
if you run with -v, the process should be verbose
Signed-off-by: Frédéric Demians <f.demians@tamil.fr>
I've refactored your patch to handle verbosity directly via a translator
attribute, rather than with parameter which has to be send to each object call
method.
Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
To test:
git checkout 3.6.x
cd misc/translator
./tmpl_process3.pl update -i ../../koha-tmpl/opac-tmpl/prog/en/ \
-s ./po/fr-FR-i-opac-t-prog-v-3006000.po -r
po/fr-FR-i-opac-t-prog-v-3006000.po contains broken diacritics for NORMARC
strings for example
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
fixes regression caused by bug 6752
use encoding(UTF-8) rather than utf-8 for stricter
encoding
Marking output as ':utf8' only flags the data as utf8
using :encoding(UTF-8) also checks it as valid utf-8
see binmode in perlfunc for more details
In accordance with the robustness principle input
filehandles have not been changed as code may make
the undocumented assumption that invalid utf-8 is present
in the imput
Fixes errors reported by t/00-testcritic.t
Where feasable some filehandles have been made lexical rather than
reusing global filehandle vars
Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
This is a fairly hacky solution, a counter patch would be more than
welcome
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Updated, translated and installed German po files after applying this patch.
No problems found.
Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
This will re-add any leading spaces, so formatting is not messed
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
- all examples from the bug report are fixed now
- verified system preferences are still translated
- verified xslt displays are still translated
- verified javascript alerts are still translated
- verified switching languages works
Signed-off-by: Ian Walls <ian.walls@bywatersolutions.com>
This test validate Template Toolkit (TT) Koha files.
For the time being an unique validation is done: Test if TT files
contain TT directive within HTML tag. For example:
<li[% IF
This kind of constuction MUST be avoided because it break Koha
translation process.
This patch transform also translation specific modules into C4 modules
in order to be able to use them in test case:
C4::TTPaser
C4::TmplToken
C4::TmplTokenType
This patch is a Perl adaptation of a Haskell script from Frère Sébastien
Marie.
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Notes on testing:
- translate install de-DE - worked ok
- translate update de-DE > translate install de-DE - worked ok
- running the test xt/tt_valid.t - worked ok and pointed out lots of problems.
Found no problems.
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
Display a warning for strings that don't have the same count of %s placeholders
that the English original strings. Don't warn for not translated string and
'fuzzy' string because those strings are not installed, and this is the
translator responsability to examine them.
Based on Frère Sébastien Marie work.
Signed-off-by: Frère Sébastien Marie <semarie-koha@latrappe.fr>
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
For Translator Manager (myself...). A translation installation may fail because
translator hasn't enter properly string parameters (%s). With this patch, the
message ID is displayed not only the parameter.
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
In opac/staff templates .po files, we have comment lines contextualizing
extracted text in templates. Path to template are absolute. For example, we can
have:
#: /home/katrin/kohaclone/koha-tmpl/intranet-tmpl/prog/en/...
modules/cataloguing/addbiblio.tmpl:585
The first part of the pathname is useless. With this patch, we just keep
relative path to tempalte from Koha template main directory. The above example
becomes:
#: intranet-tmpl/prog/en/modules/cataloguing/addbiblio.tmpl:585
To be applied on [3.2]
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
[1] Update all .po files in once with this command:
translate update
[2] For sysprefs, quoted text wasn't properly retrieved from .po file and so
quoted strings wasn't translatable.
[3] The install process (translate -p install de-DE) was rewriting syspref
.po file which isn't required anymore.
MUST be applied to [3.2] to get all syspref proper translation.
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
More podchecker cleanups to eliminate warnings / errors
Signed-off-by: Andrew Elwell <Andrew.Elwell@gmail.com>
Signed-off-by: Galen Charlton <gmcharlt@gmail.com>
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
tmpl_process is patched to handle properly specific XML directives.
UNIMARC XSL files are modified to gain knowledge of HTML entity
which isn't the case by default. It may be necessary to do the same
thing for MARC21 XSL.
Signed-off-by: Galen Charlton <gmcharlt@gmail.com>
* 'bug2505_patches' of git://git.catalyst.net.nz/koha: (24 commits)
Bug 2505 - use strict and warnings in sax_parser_test
Bug 2505 - enable warnings for link_bibs_to_authorities
Bug 2505 - add strict and warnings to perlmodule_ls
Bug 2505 - add strict and warnings to check_sysprefs
Bug 2505 - Add commented use warnings where missing in *.t
Bug 2505 - Add commented use warnings where missing in *.pm
Bug 2505 - Add commented use warnings where missing in the cataloguing/ directory
Bug 2505 - Add commented use warnings where missing in the misc/ directory
Bug 2505 - Add commented use warnings where missing in the tools/ directory
Bug 2505 - Add commented use warnings where missing in the installer/ directory
Bug 2505 - Add commented use warnings where missing in the rotating_collections/ directory
Bug 2505 - Add commented use warnings where missing in the C4/ directory
Bug 2505 - Add commented use warnings where missing in the serials/ directory
Bug 2505 - Add commented use warnings where missing in the catalogue/ directory
Bug 2505 - Add commented use warnings where missing in the sms/ directory
Bug 2505 - Add commented use warnings where missing in the opac/ directory
Bug 2505 - Add commented use warnings where missing in the virtualshelves/ directory
Bug 2505 - Add commented use warnings where missing in the suggestion/ directory
Bug 2505 - Add commented use warnings where missing in the admin/ directory
Bug 2505 - Add commented use warnings where missing in the circ/ directory
...
Conflicts:
C4/Auth_with_cas.pm
acqui/supplier.pl
Signed-off-by: Galen Charlton <gmcharlt@gmail.com>