Hello all,

I just commented the following to ticket #874

The translation of the parameters in the calls of ACL:create_token(
name, description, group, crud) are not handled identically
througout the code. In the svn code sometime the strings, which are
passed as group parameter, are translated with _t(...). For instance
the default tokens which are created in acl.php:

The tokens for content and comments are created like this:
> 
> // content tokens
> self::create_token( 'own_posts', _t('Permissions on one\'s own posts'), 
> _t('Content'), true );
> self::create_token( 'post_any', _t('Permissions to all posts'), 
> _t('Content'), true );
> foreach ( Post::list_active_post_types() as $name => $posttype ) {
>       self::create_token( 'post_' . Utils::slugify($name), _t('Permissions to 
> posts of type "%s"', array($name) ), _t('Content'), true );
> }
> 
> // comments tokens
> self::create_token( 'comment', 'Make comments on any post', _t('Comments') );

You can see _t('Content') and _t('Comments') !!!

other tokens are created like this:
>
> // super user token
> self::create_token( 'super_user', 'Permissions for super users', 'Super User' 
> );
> 
> // admin tokens
> self::create_token( 'manage_all_comments', _t('Manage comments on all 
> posts'), 'Administration' );
> // ....

'Super User' and 'Administration' are not translated with _t() !!!

1. I do not understand the habari code as far that I can say, what
is the propper way to handle the group parameter and its translation.

2. Another thing I am thinking about is, if it is a good idea to
__store these translated texts in the database__ ... this is also
done for the description parameter!!!!

I installed habari on my server with german language! I chose the
language at installation time! So the description of the tokens is
stored in german language in the database. If I now change the
langauge of habari in administration options, then these texts are
still shown in german, because the translation onyl works from
english to the chosen target language!

So! there is more to do, ...

The Milestone where the translations should be fixed is given as
0.9. But I think that this should be done as soon as possible,
because there is more to do than only changing the "hardcoded
strings" ... and using the gettext functions.


There is another thing which is very HARD to translate. In the
source code there are some sentences which are put together from
serverel parts ... all these parts are passed to the gettext
functions separately.

This as very hard to translate. For instance if there is the string
"%s comments" ... this would be in german the "%s Kommentare"!
But on one place this text is put together with other parts and the
word _t(' with ') (german " mit "). In this special case in german
you have to use the dative! This means the result of "%s comments"
has to be translated with "%s Kommentaren" in order to get the
accurate case "... mit x Kommentaren".

On the other Hand all same english texts are always translated the
same way, because there is only one translation for it in the
language catalog. If "%s Kommentare" is used serveral times in
different contents it maybe should translated in different cases.

My suggestion: Whole sentences never should put together from
several parts, which are translated separately. If this is not
possible, the information sould be output as a list or as a table,
where normally the nominative case is used.


Another thing in translating are some "words" which are used like
constants. For instance some statuses like "published", "scheduled",
"draft" ... and sometimes theses constants are used to create
output. But this never should be translated, because they are
constants ... but in this case these constants also never should be
used for creating output!

There are more such text constants (i.e. "read", "edit", "delete",
"create", "deny", "allow", "deny", ...).

These constants never should be used to create output. But currently
they are used for creating output!

What could be solution? Maybe there should be an localized version
for each constant. ... or something like an display name! But the
translations (localized names) should never be stored in the
database, because if the language of the site is switched these
texts will not be translated again (see my example above)!


Hopefully you understand my english! Sometimes I use wrong
vocabulary or wrong tenses.
And hopefully these suggestions are helpful to you.

greetings from Bavari in Germany,
cu, guido
(helpy)

--~--~---------~--~----~------------~-------~--~----~
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