>
> If anybody is able to help I have one other question. As I said, we're
> trying to translate our website into other languages and make it
> easier for volunteers to do the translations without having to read
> over lots of template code.
>
> We have split out all translateable text strings into BLOCKS, which
> commence below the named according to a somewhat uniform naming
> convention (starting with '_txt_'). At this point we can use sed or
> similar to easily extract all these blocks and dump them in an email
> to the translator - the tricky part potentially comes with
> re-combining the new translations (unless one does it by hand).
You really don't want to do this. It becomes a nightmare to maintain
(from personal experience).
Do it right the first time, and use Locale::Maketext::Lexicon.
This distribution includes xgettext.pl, which will parse your TT
templates, your Perl code and your YAML (amongst other formats) and
extract all of your strings into a .PO file.
Your translators can then edit the .PO file with poEdit - they don't see
any code.
It also allows you to handle different forms for singular, plural,
word-order etc:
eg, in a template you could have:
l('I found [quant,_1,file,files,no files at all]', files_found);
which would result in:
files_found == 1 : I found 1 file
files_found == 4 : I found 4 files
files_found == 0 : I found no files at all
It takes a little more preparation to get your system geared up for
this, but saves you MONTHS of maintenance in the long term.
Read (in this order):
-
http://search.cpan.org/~ferreira/Locale-Maketext-1.13/lib/Locale/Maketext/TPJ13.pod
-
http://search.cpan.org/~ferreira/Locale-Maketext-1.13/lib/Locale/Maketext.pod
-
http://search.cpan.org/~drtech/Locale-Maketext-Lexicon-0.77/lib/Locale/Maketext/Extract.pm#DESCRIPTION
-
http://search.cpan.org/~drtech/Locale-Maketext-Lexicon-0.77/lib/Locale/Maketext/Lexicon.pm
I'm the maintainer of Locale::Maketext::Lexicon, and am happy to help if
you have queries.
Clint
_______________________________________________
templates mailing list
[email protected]
http://mail.template-toolkit.org/mailman/listinfo/templates