Open nibinnelson007 opened 7 years ago
You mean the x-profile fields?
Yes Exactly, How Can I Translate x-profile fields?
There is no way in the moment. I have to add this to the code.
Ok, Thanks! when can I expect this feature?
hi, @mahype any updates?
Hi,
I think this will happen in the next months.
Greetings,
Sven
Hi, Thanks @mahype
Cheers!
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.
@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,
I cannot translate my custom user profile under User Menu.
Please help me to solve this.