I use symfony 1.4.11 with Doctrine. I have site, and it has 3 languages. I use sfDoctrineGuardPlugin 4.0.1 , and I have 3 groups of users. In site I show to each user his group, and I need it show to each user in current language. So I add to sfGuardGroup field i18n behavior, but I do not now, is it good idea? Is there another solution for this? Thank you!
Asked
Active
Viewed 219 times
0
-
What do you mean with _I need it show to each user in current language_ ? Do you want to list users by language or show the name of groups correctly translated to current user's native language ? – domi27 Aug 30 '11 at 05:10
-
correctly translated to current user's native language :) I translated it – denys281 Aug 30 '11 at 07:35
1 Answers
0
An answer depends on how you deal actual with i18n, i mostly prefer messages.xml files !
Anyway i would expect sth like this :
/* actions.class.php */
function executeBla($request){
$this->myUser = Doctrine_Core::getTable("SfGuardUser")->find(ID);
}
/* blaSuccess.php */
use_helper("I18N");
// Users Groups translated
foreach($myUser->getGroupNames() as $group){
echo __($group);
}
You'll find sufficient information in symfony's docu :

domi27
- 6,903
- 2
- 21
- 33
-
I try it ?but it is not work for me, so I add i18n column to the my sfGuardGroup table. And it is work) thank you< for your response. – denys281 Aug 30 '11 at 13:29