Hi,

Profile2 version is 7.x-1.3
Profile2 translation - profile type label is translated, but does not shown.
All enabled modules list and screenshots are in attachment.

Thanks in advance.

Comments

vflirt’s picture

Hi,
this is actually not profile 2 issue but rather drupal core issue.
On the last image "Personal data" is take trough hook_user_categories and although in the hook description it is said that the 'title' returned from this hook should be localized (and as is profile2 doing is useing the translated string as 'title') the hook_menu in user.module is just displaying the title as it comes from the hook without thinking that that language can be changed. I have same problem and in order to make it work properly i hard to :
1) add hook alter for each categories so instead of 'check_plain' as a title callback i set my own function
2) in my own function call again _user_categories() and set the correct title for the current category

/**
 * Implements hook_menu_alter().
 */
function mymodule_menu_alter(&$items) {
  if (($categories = _user_categories()) && (count($categories) > 1)) {
    foreach ($categories as $key => $category) {
      // 'account' is already handled by the MENU_DEFAULT_LOCAL_TASK.
      if ($category['name'] != 'account') {
        $arguments = array(
          $category['name'],
          $items['user/%user_category/edit/' . $category['name']]['title callback'],
          $items['user/%user_category/edit/' . $category['name']]['title arguments'],
        );

        $items['user/%user_category/edit/' . $category['name']]['title callback'] = '_mymodule_user_category_title';
        $items['user/%user_category/edit/' . $category['name']]['title arguments'] = $arguments;

      }
    }
  }
}

function _mymodule_user_category_title($category_name, $function = '', $arguments = array()) {
  $categories = _user_categories();
  foreach ($categories as $key => $category) {
    if ($category['name'] == $category_name) {
      return $category['title'];
    }
  }
  return call_user_func_array($function, $arguments);
}

I hope this helps you :)

Kind Regards,
Dobromir

passengerabcd’s picture

Solution in #1 works for me. Thanks vflirt.

Now I need to find a way to make the translated profile2 label show on the view tab.

passengerabcd’s picture

Just found the hack, replace line 332 of profile2.module with the following:

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

Now you can find the string in translate interface and add your translations.

baher’s picture

Hi,

You have to activate the Profile2 Translation in the MULTILINGUAL - INTERNATIONALIZATION (i18n) module.

Regards
Baher

skyredwang’s picture

I can confirm this bug. Profile2 i18n enabled. Profile label translated, but not showing.

bisonbleu’s picture

Priority: Normal » Major
Issue summary: View changes
StatusFileSize
new37.48 KB
new86.07 KB

I have a similar issue. But I don't think this issue is related to it. So I'll seek a separate issue.

FYI - In my case, I have enabled Provide a separate page for editing profiles at admin/structure/profiles. When this is done, the page title for a user profile (accessible at profile-my_profile/uid) is set to Member Profile and properly translates when i18n is enabled. So I believe the current issue is resolved.

bisonbleu’s picture

Hiding files I uploaded as I cannot delete them.

bisonbleu’s picture

Priority: Major » Normal
Status: Active » Needs review

Setting back to Normal & Needs review.

kopeboy’s picture

@bisonbleu

The field label used in the page is translated, but the tab (secondary) links of the separate edit pages are not.