On Sep 9, 2:15 pm, Guido Erlinger <[email protected]> wrote:
> Hi Rick,
<snip>
> How will you handle the case if the original english text (stored in
> db) is changed in the source code. How will text, which is already
> stored in an existing database, be adapted to these changes, when
> habari is updated to a newer version?
>

To the best of my knowledge, the only strings that are stored in the
database translated at the moment are those associated with the acl
token. I hope we'll be able to run a change on that on an upgrade
after the problem is solved to change them to the untranslated
version. That could entail the user having to deactivate, then
reactivate plugins if they have any plugins that add new content types
or acl tokens. At worst, the user would have to reinstall, but if the
db is backed up to another database, the comments, users, and posts
should be available from it using the habari_import plugin. In that
case, plugins would have to be reactivated and reconfigured.

Creating ACL tokens is one of the places the _u() function may be
useful. For example, an acl token is created by

ACL::create_token( 'token_name', 'token description', 'token_group');

Right now, some of the token descriptions are stored translated, as
are some of the token groups. the token name is never stored
translated, so the tokens act as they are supposed to, but the
descriptions and groups cause problems when they are output in the
improper language. A possible way to solve this would be to call

ACL::create_token('token_name', _u(_t('token description')), _u(_t
('token_group')));

This should store the untranslated version of the token description
and the token group in the database. Then when these strings are
output, do so using _e(), _t(), etc. The string would be output
properly since the string is in the translation catalog, so saying
something like _t($str) would be okay, while only the english version
is stored in the database. At least that's the way I'm imagining it
would work.

Rick

<and more snip>
--~--~---------~--~----~------------~-------~--~----~
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at http://groups.google.com/group/habari-dev
-~----------~----~----~----~------~----~------~--~---

Reply via email to