Home›Support›English Support›[Resolved] The button label does not change in the blog when languages have been switched
[Resolved] The button label does not change in the blog when languages have been switched
This thread is resolved. Here is a description of the problem and solution.
Problem: In your blog using the Blocksy theme, you are facing an issue where translation labels for links to the profile and log-out are not updating after switching languages, despite being translated in WPML > String Translation. Solution: We recommend adding the following XML code to WPML > Settings > Custom XML Configuration to register the dropdown fields for translation: https://wpml.org/forums/topic/the-button-label-does-not-change-in-the-blog-when-languages-have-been-switched/#post-15839077
If you are using a child theme, adjust the first key name to
<key name="theme_mods_blocksy-child"></key>
. You can find the correct option name from the table wp_options in the database. After adding the code, go to WPML > String Translation and translate the strings there. Check the translation strings in the frontend. For more details, refer to the documentation on translating strings in the wp_options table.
If this solution does not resolve your issue or seems irrelevant due to being outdated or not applicable to your case, we highly recommend checking related known issues at https://wpml.org/known-issues/, verifying the version of the permanent fix, and confirming that you have installed the latest versions of themes and plugins. If further assistance is needed, please open a new support ticket at WPML support forum.
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.
In my blog, I am using the Blocksy theme which is compatible with WPML.
I have a problem with translation labels for links to the profile and log-out. (The attached screenshot should clarify the issue.)
After entering "Log Out" label in the Blocksy (WordPress) dashboard I found it in WPML > String translation. After translating "Log Out" into Polish "Wyloguj się", the label does not change in the blog when languages have been switched.
(Similarly, I should have the "Profile" label translated.)
It could be affected by a third party plugin or a block of code from the child theme that you are using. I suggest you enable a minimal environment as below and recheck this issue:
- Deactivate all plugins except WPML plugins and Blocksy Companion.
- Switch to the main theme Blocksy.
❌ IMPORTANT: Please backup your database and website before proceeding ❌
Just in case, I also sent a description of this problem to Blocksy support.
I have done a lot of investigations. In my opinion, the issue is not caused by the Blocksy Companion plugin or Blocksy Child theme.
First of all other strings from Child Theme are translated without any problem. For example: "Profile & Log Out" <> "Profil & Wyloguj się".
Secondly, in Sandbox you gave me I have installed Blocksy Starter Site with Child Theme and everything is OK.
In addition, I have done procedures I found on your support forum. I mean procedures with "Look for strings while pages are rendered" enabled. But it did not help.
I have disabled each plugin to check if there is any conflict with WPML or Blocksy. No success.
The file functions.php in the child theme on your site has a lot of custom code that modifies some WPML features, not the same as the file on the sandbox site.
I also create a backup file and restore your site on my local host to check the issue. The translation string displayed correctly after switching to the main theme Blocksy, here is the screen record hidden link
add_action( 'wp_enqueue_scripts', function () {
wp_enqueue_style('blocksy-child-style', get_stylesheet_uri());
});
You can see that it only affected the language switcher in the main menu. However, I changed the language using the language switcher in the footer. You can see that the phrase "Log out" is still not translated correctly.
The cause of the problem is somewhere else.
See the attached screenshot.
I'm not sure what's wrong with your child theme. On my local site, I use the plugin https://wordpress.org/plugins/child-theme-configurator/ to create a new standard child theme and re-create the header button.
Then translate the strings in WPML > String Translation, the translation strings are displayed correctly in the frontend.
Can you try to create a new child theme and recheck the issue?
Hi!
Do you have any info for me? Blocksy Support claims they saw a similar issue once. And it was on the WPML side. But they do not remember exactly what it was.
Grzegorz