awsmug / multilanguage-buddyPress-with-polylang

This plugin allows you to do a Polylang powered multilanguage WordPress installation with BuddyPress.
15 stars 3 forks source link

Cannot Translate Extended User Profile #3

Open nibinnelson007 opened 7 years ago

nibinnelson007 commented 7 years ago

I cannot translate my custom user profile under User Menu.

Please help me to solve this.

mahype commented 7 years ago

You mean the x-profile fields?

nibinnelson007 commented 7 years ago

Yes Exactly, How Can I Translate x-profile fields?

mahype commented 7 years ago

There is no way in the moment. I have to add this to the code.

nibinnelson007 commented 7 years ago

Ok, Thanks! when can I expect this feature?

nibinnelson007 commented 7 years ago

hi, @mahype any updates?

mahype commented 7 years ago

Hi,

I think this will happen in the next months.

Greetings,

Sven

nibinnelson007 commented 7 years ago

Hi, Thanks @mahype

Cheers!

izsmartcom commented 7 years ago

Hi all,

This is the code I used to translate the X-profile fields -> in function.php :

pll_register_string( "fullname", "Full name", "buddypress_polylang"); // This line add a new translation in the polylang menu. You have to copy/past and modify this line for every field you have

add_filter('bp_get_the_profile_field_name', function($r){ return pll__($r); }); // This line return the translation you added in the polylang menu for any "normal" field (that means only input text)

For checkbox I used this : add_filter('bp_get_the_profile_field_options_checkbox', function($r){ preg_match('@<label ([^>]+)><input ([^>]+)>(.+)@', $r, $matches); return "<label ".$matches[1]."><input ".$matches[2].">".pll__($matches[3]).""; });

Of course i only used these two kind of fields so my code is incomplete.

I hope I helped.

codestylist commented 4 years ago

@mahype Is there any update about this feature? In July 2017 you wrote you expect it is done "in the next months" ;-). Did you manage it? thanks in advance for your work,