Hi Martin,
yes of course, I'm interested in making the localization pull tool
public...
I have written this tool because I had to create localized templates
and I didn' t know that such a tool was still present in Turbine 3.
However I had a look at Turbine 3's localization pull tool and I think
(ok... I'm not sure) that my tool has very different features.
These are the main features (and concepts) of my localization pull tool:
a) a web application can have the language (Locale) set at four
different levels:
1) user temporary language: a language chosen by the user for the
current session (setTemp)
2) user permanent language: a language chosen by the user as a
default language (setPerm)
3) application (context): usually only the admin can set this level
4) default value from the TurbineResources.properties (the one set by
the standard loc service)
if the tool finds a temporary language then uses it; if not, try to
get and use the permanent language; and so on... and this process is
hidden by the tool: from within a template you has only to call a
$loc.text("USER")
b) you can set ($loc.setPage("LOGIN")) at template level a prefix for
the keys searched in the bundle.
c) you can use four different $loc.text(..) methods: some of them
return specified default values if the keys are not found, some of them
use a different key prefix.
d) if a key is not found a very usefull debug message is provided in
place of the missing label (no more template errors): the debug message
can be configured in the TR.properties file and is in the form
ERROR_MESSAGE(key_not_found)
As an example of b), c), d):
$loc.setPage("LOGIN") ---> this sets the prefix for the keys
..... some templates stuff ....
$loc.text("USER") --------> will search the key LOGIN_USER in the
bundle
$loc.textd("PASSWORD", "Enter password") ---> if LOGIN_PASSWORD is not
found, prints "Enter password"
$loc.text("GENERAL", "OK") ---> will search the key GENERAL_OK in the
bundle
$loc.text("MISSING") ---> will print something like: Key not found
(LOGIN_MISSING)
All this stuff works pretty well (I'm using it) but it is a work in
progress (i.e. I would like to add other features such as log messages
in the form LOGIN_MISSING= for every key that is not found, that could
be very usefull for completing the bundle... cut and paste rule!) and
maybe is not everywhere well written and documented.
If someone is interested I will be happy to send everything!
Sorry for the long message and good work!
Jacopo
> are you interessted in making your localization pull tool public?
> maybe we can add it to turbine cvs
> at least i can add it to jyve ;-)
>
> martin
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]