Group name is translated in general but not in context

Permalink Browser Info Environment
Hi Guys,

the group name "Administrators" is translated in user groups (in my case german: "Administratoren"). but not translated in some context e.g. in "Site Access" or in "View User" (see attached images).

I hope it's the right here place to spotlight this ;)

Regards

Torsten

2 Attachments


Status: Minor
tsilbermann
View Best Answer
mkly replied on at Permalink Reply
mkly
Hello,
Indeed there are actually a quite a few places Group Names are not translated. I believe the only place was actually added around version 5.5 oddly enough with this commit

https://github.com/concrete5/concrete5/commit/a7eacbdee8bd126ecb1164...

Since then, as I'm sure you are aware there has been much discussion about how we go about translating dynamic data.

/concrete/single_pages/dashboard/users/search.php
/concrete/single_pages/dashboard/users/groups.php
/concrete/single_pages/dashboard/system/permissions/site.php
/concrete/elements/permission/keys/assign_user_groups.php:
/concrete/elements/permission/keys/access_user_search.php
/concrete/core/controllers/single_pages/dashboard/users/add_group.php
/concrete/core/controllers/single_pages/dashboard/users/groups.php
/concrete/core/models/permission/access/entity/types/group_combination.php
/concrete/core/models/permission/access/entity/types/group.php

That was just a quick grep, but these do not appear to be translating the group name. That said, it does appear to go along with what was discussed earlier about attribute names etc, that this should change.

I'd love to hear some insight from some of our more international community members on how we'd like to deal with with(tc() etc for context "GroupName"?).

Best Wishes,
Mike
mlocati replied on at Permalink Reply
mlocati
Having translated grup names would be great.
I'd go for tc with a 'GroupName' context.
Extending the Localizer package would easily add support for this.
PS The Localizer it's still under review in the PRB, but you can find it also here:
http://github.com/mlocati
mlocati replied on at Best Answer Permalink Reply
mlocati
tsilbermann replied on at Permalink Reply
tsilbermann
Wow this was fast. Thanks a lot Michele (when do you sleep? :).
mlocati replied on at Permalink Reply
mlocati
Sleep... Once I knew what that word means... ;)

BTW: there's still something to fix, namely about the GroupSearch::filterByKeywords method...
mkly replied on at Permalink Reply
mkly
Hi @mlocati,
That was quite fast. I'm not sure about the Group::add() code? Why are we trying to translate that into the database? I thought we wanted to stay away from that? Are we just hoping that it will always be set to en_US?

Just to let you know that this will end up waiting until the next release as we kind of ran out of time on it with the additional changes beyond just the view wrapping.

Best Wishes,
Mike
mlocati replied on at Permalink Reply
mlocati
Indeed: data must be saved in en_US to the database.
I added tc() to Group::add because it's the only way we can extract translatable strings to be sent to Transifex.
As I said on GitHub (https://github.com/concrete5/concrete5/pull/1313#discussion_r6000310... ), I tested a fresh 5.6.2 installation with locale it_IT, and groups have been saved in en_US anyway. By tomorrow I'll do another fresh install to check again this and track if and when concrete5 resets (correctly) the locale to en_US when running setup routines.
mlocati replied on at Permalink Reply
mlocati
I confirm that, even if I'm installing concrete5 with a different locale (it_IT in my case), just before the Group:add calls (in starting_point_package.php) the result of Localization::activeLocale() is 'en_US'.

concrete5 Environment Information

5.6.3

Browser User-Agent String

Mozilla/5.0 (Macintosh; Intel Mac OS X 10_8_4) AppleWebKit/536.30.1 (KHTML, like Gecko) Version/6.0.5 Safari/536.30.1