Skip Navigation

This thread is resolved. Here is a description of the problem and solution.

Problem:
I added some custom menus to buddypress profile navigation and cant translate
Solution:
I added the "buddypress" part to my 'name' like this:

'name'=> __('Badges', 'buddypress' ),

and that fixed it!

This is the technical support forum for WPML - the multilingual WordPress plugin.

Everyone can read, but only WPML clients can post here. WPML team is replying on the forum 6 days per week, 22 hours per day.

This topic contains 4 replies, has 2 voices.

Last updated by atsushiS-3 3 years, 9 months ago.

Assisted by: Bruno Kos.

Author Posts
June 8, 2020 at 6:50 am #6317659

atsushiS-3

Tell us what you are trying to do?
Im trying to translate some custom profile navigation fields I added, but I can't find them in string translations

Is there any documentation that you are following?
yes, https://wordpress.stackexchange.com/questions/16223/add-buddypress-profile-menu-item

Is there a similar example that we can see?

What is the link to your site?

June 9, 2020 at 7:56 am #6327883

Bruno Kos
Supporter

Languages: English (English ) German (Deutsch ) French (Français )

Timezone: Europe/Zagreb (GMT+01:00)

Hi,

Thank you for contacting WPML support!

some custom profile navigation fields I added

Where did you add these? Is it somewhere within the site backend or through coding, such as within this example:
https://wordpress.stackexchange.com/a/30715/19499

If you coded this into a child theme, using text-domains properly, did you try this?
https://wpml.org/documentation/getting-started-guide/theme-localization/#scanning-for-hard-coded-strings

So rescan the theme/plugin after you added the code?

Regards,
Bruno Kos

June 10, 2020 at 12:33 am #6336485

atsushiS-3

Hello, I went to my SFTP, and inside the main theme's functions.php I added the following code:

add_action('bp_setup_nav','profile_tab_myBadges');
function mybadge_screen() {
// Add title and content here - last is to call the members plugin.php template.
add_action('bp_template_title','badgetab_title');
add_action('bp_template_content','badgetab_content');
bp_core_load_template('buddypress/members/single/plugins');
}
function badgetab_title() {
echo 'Badges';
}
function badgetab_content() {
echo '[mycred_badges_progress width=60 height=60 bgcolor="red" type="radial"]';
}

I then rescanned the them and still couldn't find the strings, how do I properly use the text-domains to be able to find them when scanning?

June 10, 2020 at 12:46 am #6336549

atsushiS-3

Hello, I added the "buddypress" part to my 'name' like this:

'name'=> __('Badges', 'buddypress' ),

and that fixed it!

This ticket is now closed. If you're a WPML client and need related help, please open a new support ticket.