Hi,

I have a multilingual site using profile2 module, but it appears that we can't translate title in the profile page of users.

To fix that i decided to add the translate methode for the title (line 350 of profile2.module) :

    '#title' => t($profile->label),

I hope it will be helpfull.

Bye ;)

Comments

demoshane’s picture

Priority: Major » Minor
Status: Reviewed & tested by the community » Patch (to be ported)
StatusFileSize
new605 bytes

Here is patch for the issue

fago’s picture

Version: 7.x-1.2 » 7.x-1.x-dev
Status: Patch (to be ported) » Needs work

profile (type) label's should be translated via i18n

finn lewis’s picture

Hi guys!

I've been wrestling with this too, specifically trying to localize the profile2 type labels / titles.

In our use case, we do not want to translate the profile2 content, but we do want to localize the field labels and the profile type labels.
I see there are some changes with regard to i18n in the latest 7.x-1.3 version, but the localization of the profile type labels still does not seem to work.

The patch in #1 above does not appear to be included in 7.x-1.3, and solves half the problem in that it allows localization of the profile type label when viewing the user.

The other part of the equation is when the user is editing their profile2 form. For this I think we need the following in the profile2_user_categories() function (around line 492 of profile2.module):

-        'title' => $info->getTranslation('label'),
+        'title' => t($info->getTranslation('label')),

After clearing cache, I now have localized profile2 labels on view and edit.

I attach a patch against 7.x-1.x-dev which currently applies fine to 7.x-1.3

Hope this helps!

finn lewis’s picture

Status: Needs work » Needs review
baher’s picture

Hello,

Have you already activate the Profile2 translation ? you can see my answer in this post href="https://drupal.org/node/1118362#comment-7825629

Baher

mr.york’s picture

Issue summary: View changes
StatusFileSize
new625 bytes

Activate Profile2 translation module.
And apply this patch.

spleshka’s picture

Status: Needs review » Fixed

@mr.york, thank you for patch. Commited/pushed to 7.x-1.x.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.