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 1 reply, has 2 voices.

Last updated by Joanna 3 years, 2 months ago.

Assigned support staff: Joanna.

Author Posts
January 3, 2017 at 7:41 am #1173002

Harold

I am trying to: Translate custom links in a menu, either with string translation or manually.

The original menu is made like this - with parent and children items

MENU ID : 253, called "mobile_menu"

Custom Link
- Page link
- Page link
- Page link
Page link
Page link
Custom link
- Custom link
- Custom link
Custom link

We have something like a dozen languages.
Page links are correctly translated from the beginning.
Custom links are not translated, even if correctly translated in string translation.

For this I've read WPML manual and forums and try all these :
- Deleted then Created the original menu called "mobile_menu"
- WPML > Menu Sync > all menus are created in all languages. Translated except the custom links
- WPML > String Translation > The strings are showing in domain "mobile_menu". We translate everything in domain "mobile_menu".
> WPML > Meny Sync again > nothing much happens, custom links remains untranslated.

In the theme, the menu is displayed like this :

wp_nav_menu(array(
'menu' => 253,
));

The menu shows "correctly" but custom links untranslated.

I also tried this after seing it in the forums:

wp_nav_menu(array(
'menu' => icl_object_id( 253 , 'menu_mobile'),
));

But this way, the menu doesnt show correctly : only the first children links are showing (in every language)! (the 3 page links after the first custom link). Why ?

We also previously tried to edit manually the menus. But when doing this, the items order is messed up every time we save the menu ! Also, the string translation way sounds a lot better ... if only it could work. Can you help ?

Questions :
- Are the custom links supposed to show as translated in back-office after string translation ?

Best Regards,

January 3, 2017 at 3:54 pm #1173619

Joanna

Hello Harold,

First, please make sure that all your plugins (not only WPML related) and your theme are up to date.

I tried to replicate your issue on a clean installation but I couldn't. Everything worked as expected when I followed the steps you mentioned. So it seems that it's an issue specific to your website.

You should be able to see the translated menu on Appearance->Menus after translating custom links on WPML->String Translation and syncing your menus on WPML->WP Menus Sync.

Please do the following:
1. Make a full backup of your website (files and the database).
2. Go to WPML->Support.
3. Scroll down to the bottom and click the "troubleshooting" link.
4. In the "Clean up" section find "Clear the cache in WPML" button. Click it.
5. Find the "Remove ghost entries from the translation tables" button. Click it.
6. Find the "Fix element_type collation" button. Click it.

If that doesn't help, please enable error logging. You can find more info on how to do it and example code for debugging at https://codex.wordpress.org/Debugging_in_WordPress#Example_wp-config.php_for_Debugging
In brief:
1. Log into your FTP.
2. Edit the wp-config.php file.
3. Add the following code:

define( 'WP_DEBUG', true );

define( 'WP_DEBUG_LOG', true );

define( 'WP_DEBUG_DISPLAY', false );
@ini_set( 'display_errors', 0 );

define( 'SCRIPT_DEBUG', true );

4. Save the file.
5. Try to synchronize your menu again at WPML->WP Menus Sync and visit the front-end in the secondary language.
6. Go back to your FTP.
7. In the wp-content folder, you should find the debug.log file where all errors are added.

Paste the content of the debug.log file, if there are any errors listed.

Also, please check if the issue still occurs with all non-WPML plugins deactivated and the default theme active, e.g. Twenty Seventeen? Note that you'll need to re-create your menu for the default theme.
Please also check if the menus get messed up when you edit them with this configuration. By the way, can you tell me what do you mean by "messed up"? Can you elaborate more on the issue?

Regarding the menu being displayed incorrectly, did you possibly translated your pages after menu synchronization? If so, please go to WPML->WP Menu Sync and synchronize your menu again.

I also noticed that your WP Memory Limit is set to 40MB and the WPML's minimum requirement is to have it on 128MB. You can easily increase the memory allocated to PHP. You'll find more info about it at https://codex.wordpress.org/Editing_wp-config.php#Increasing_memory_allocated_to_PHP.
In brief:
1. Log into your FTP.
2. Edit the wp-config.php file.
3. Add the following code:

define( 'WP_MEMORY_LIMIT', '128M' );
define( 'WP_MAX_MEMORY_LIMIT', '256M' );

4. Save the file.

This will most likely not resolve your issue, but it may save you from a headache in the future when you stumble upon some unexpected issues.
All WPML minimum requirements are listed at https://wpml.org/home/minimum-requirements/.

The topic ‘[Closed] Custom Links in menu translated in String Translation, but not translated on sit’ is closed to new replies.