Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Jerome F’s picture

Title: send Profile2 strings throug t() » send Profile2 strings through t()
Jerome F’s picture

Title: send Profile2 strings through t() » Profile2 translation - localisation - send Profile2 strings through t()

Though, I found that:
Use Drupal core t() function. Not recommended, as it doesn't support updates to existing strings.
Does that mean an other method would be prefered?

Jerome F’s picture

Status: Active » Closed (fixed)

So I have been told that I have to use the beta version not the last dev if I want to be able to translate.
Closing this issue therefore.

Jerome F’s picture

Title: Profile2 translation - localisation - send Profile2 strings through t() » Profile2 translation - being able to tranlsate the profile type label- i18n?
Status: Closed (fixed) » Active

The profile type label is not part of the interface, it's a field. How could we translate that? Is it something I should ask as a feature request in i18n?

Jerome F’s picture

Category: feature » support
Priority: Normal » Minor
Status: Active » Postponed

I've learned a lot about entity translation, variable translations, i18n string translation, and I might be able to solve this.
I postpone this issue untill I'm sure I can't figure this out by myself. Don't want to fill the issue queue with my own TBD stuff.

DropInTheOcean’s picture

Version: 7.x-1.x-dev » 7.x-1.0-beta2

I have a related problem. The translation of field labels do not show up on my site's form (whereas the translations of the values do). I have the i18n module installed.

I've tried clearing all caches (Home » Administration » Configuration » Development » Performance, and refreshing and updating strings (Home » Administration » Configuration » Regional and language » Translate interface (string tab))

Any suggestions on how to solve/diagnose would be most welcome

DropInTheOcean’s picture

With reference to the related problem, above. I found that the labels were duplicated in the 'built-in-interface'. So under "Filter translatable strings", choosing "Built-in-interface" and searching for the strings, I was able to translate the form labels.

Jerome F’s picture

@DropInTheOcean thank you for the feedback

DropInTheOcean’s picture

Hmm.. further to my comment last week, the labels have reverted to the original language (English), and I cannot now change them (Either under the filter Built-in-interface, nor under Fields.

Jerome F’s picture

Yes those duplicated strings don't exist anymor her as well.

DropInTheOcean’s picture

Hi Jerome,

There was an update to i18n on 11 June (1.0-beta7). As far as I can tell, this seems to have solved the problem of the missing label translations. Do you have the same?

Jerome F’s picture

@DropInTheOcean: Hi, thank you for your answer.
I updated i18n and did a string refresh.
There's no way to translate the profile label, I think i18n doesn't handle it at all yet, as you can see in the 3 first attached screenshots there is no UI for profile translation and its label does not appear in the interface translation strings, you can just translate the permissions strings.

EDIT: this part is solved, see next comment:
As you can see in the 4 last attached screenshots, I can translate the field type name in a profile type but not the field label.

EDIT: all the screenshots named Capture... are duplicates - a posting mistake - sorry I thought I had deleted them...

Note, I see that on my test site, Profile is enabled in the Translatable entity types in /admin/config/regional/entity_translation

Jerome F’s picture

I confirm I don't find any way to translate the profile type label.
(side note: However you can translate the string "My @profile-label")

As for the field label translation that was my mistake, the test site did use French as default language and it still needs to be english.

Jerome F’s picture

I submitted a feature request in the title module issue queue, http://drupal.org/node/1189442
The requested feature is to replace the profile type label with a regular field just as it does for nodes or taxonomy terms, so that we can translate it with entity translation.

sw3b’s picture

Subscribe !!!

Jerome F’s picture

here was the answer to the issue in the title module by plach:

The Title module is a workaround for a core feature that did not go into D7 core, Profile 2 too. IMO it makes more sense for Profile 2 to implement Title's field replacement API: Title supports only core entities and augmenting its built-in entity info is a far more ugly solution than implementing a hook for Profile 2. Moreover we would be making a possibily unjustified exception that might lead for any module to ask to be supported. Again Title was meant to be a fix for core, contrib modules can achieve the same results by using a field as label.

clashar’s picture

+1

gaele’s picture

Title: Profile2 translation - being able to tranlsate the profile type label- i18n? » Profile2 translation - being able to translate the profile type label- i18n?
Version: 7.x-1.0-beta2 » 7.x-1.1
Category: support » bug
Priority: Minor » Normal
Status: Postponed » Active

This is still a problem.

fago’s picture

Version: 7.x-1.1 » 7.x-1.x-dev
Status: Active » Postponed

This is most likely going to be handled by #1356978: add basic i18n support - at least our solution will build upon this, thus setting to postponed.

taitai’s picture

Not sure if this is the same bug but I noticed a similar one:

(All 7 versions)
profile2.module, function profile2_user_view: '#title' => $profile->label
should be '#title' => t($profile->label)

Otherwise, you will not be able to translate the label

gaele’s picture

Status: Postponed » Active

Is this fixed?

At least #1356978: add basic i18n support is.

ykyuen’s picture

#20 works. but how about the profile label in the user edit page?

mxr576’s picture

#20 didn't work for me, waiting for a correct solution

Peter Majmesku’s picture

If I want to translate a profile field, I get in field info:
This is a user-defined string. You are not allowed to translate these strings.

Is this message part of this issue?

fraweg’s picture

Same #22 issue for me...

How can I change the label in the edit form?

Thanks for any Help!
Frank

fraweg’s picture

Hello,

has anyone an idea how to translate the label in "/user/%/edit/profile"

Thanks for any Help!
Frank

vflirt’s picture

Hi,

could you post some screenshots. I might be able to help you on that.

Baher’s picture

FileSize
21.16 KB

Hi,

Did you already activate the Profile2 transaltion of the MULTILINGUAL - INTERNATIONALIZATION(i18n) module ?

Baher

Pierre_G’s picture

Here's a dirty solution.
But hey, it's working :)

/*
 * Implements hook_menu_alter()
 */
function MYMODULE_menu_alter(&$items) {
  foreach ($items as $key => $value) {
    if (substr($key, 0, 25) == "user/%user_category/edit/" && isset($items[$key]['title arguments'][0])) {
      $items[$key]['title arguments'][0] = t($items[$key]['title arguments'][0]);
    }
  }
}
tusik’s picture

I have no issues translating the labels, but I want the actual fields to allow for a translation, like for any other entity. Has anyone implementing multilanguae profiles found a solution for that yet?

guy_schneerson’s picture

I am using version 1,3 and got Profile2 translation enabled. I can translate the profile type label however when visiting the user page the label is shown in English

guy_schneerson’s picture

Just tested on the latest dev and same issue

guy_schneerson’s picture

Pierre_G in #29 the result of the menu_alter are cached so it will get stuck on one language. the correct hack is to set $items[$key]['title callback'] to a custom title callback and use a t() in the callback.

vflirt’s picture

Hi,

if you take a look at my post here : https://drupal.org/comment/7467484#comment-7467484
you can see how the menu_alter should be done.
What is done is :
for each user category change the title callback to the custom one and then call _user_categories() which will return the translated label.

If you look at profile2_user_categories() it uses $info->getTranslation('label') for the category name.

Kind Regards,
Dobromir

kopeboy’s picture

Issue summary: View changes

Please fix this... it's simple and it's embarrassing.

To recap: the field label is translated, but the tab (secondary) menu link is not.

Using the latest dev..

joe_carvajal’s picture

Thank you @guy_schneerson!
Your comment #33 did me the trick to do a (custom) workaround about this issue.