patTemplate function that emulates gettext's behaviour
This can be used to create multi-lingual websites.
When the template is read, all texts inside the
Translation tags are extracted and written to a file
You should copy this file and translate all sentences.
When the template is used the next time, the sentences
will be replaced with their respective translations,
according to the language you set with:
$tmpl->setOption( 'lang', 'de' );
You can change this behavior with some specific options:
translationFile: If set, all strings for a
language will be collected in one file with the
specified name (without extension, that's added
translationUseFolders: if set, all files
for a language will be stored in subfolders named
after the language. This option is cumulative
with the translationFile option.
translationAutoCreate: if set, the translation
files will automatically be created if they don't exist
so you do not have to create them manually.
translationUseLocator: per default, a locator
string is added to all new sentences that need to be
translated to help find them amongst the lot. You can
turn this behavior off by setting this to false.
translationLocatorString: per default, the
locator string is 'Translate', but you can change this
to any string you like with this option.