katrineB
I have translated the album titles under String Translations. But it's not reflecting on the frontend 🙁
How can I translate the titles. So Danmark is Denmark, Egypten is Egypt and so on - like translated in the strings?
hidden link
Osama Mersal
WPML Supporter since 02/2020
Languages:
English (English )
Arabic (العربية )
Timezone:
Africa/Cairo (GMT+03:00)
Hi,
Thanks for contacting WPML forums support. I'll be glad to help you today.
Please check our guide and follow the mentioned steps. (https://wpml.org/documentation/plugins-compatibility/translating-nextgen-gallery-using-wpml/ )
If this doesn't help, please log in to this Sandbox site and install the NextGen plugins. (hidden link )
After that, please create a gallery and translate it to replicate the issue. If the issue is replicable, please let me know how to reproduce it.
Best regards,
Osama
katrineB
Hi. It's not working. I created a gallery and an album.
Then created a page with the album, on both languages. Translated the string as per the guide - but in the Danish testpage the album title is still English. Please help.
katrineB
Have a look at: hidden link
When you hold the cursor over an album title you can see in the URL that the names have been translated.
Osama Mersal
WPML Supporter since 02/2020
Languages:
English (English )
Arabic (العربية )
Timezone:
Africa/Cairo (GMT+03:00)
Hi,
Thanks for replicating this issue. I'll consult our compatibility team regarding this issue and update you as soon as I get their reply.
Best regards,
Osama
Osama Mersal
WPML Supporter since 02/2020
Languages:
English (English )
Arabic (العربية )
Timezone:
Africa/Cairo (GMT+03:00)
Hi,
Thanks for your patience. Our compatibility team has found a workaround for this issue. Please check the following steps:
1- Open .../wp-content/plugins/nextgen-gallery/templates/CompactAlbum/default-view.php file
2- Look for line 12
3- Replace the following line
foreach ( $galleries as $gallery ) {
With
foreach ( $galleries as $gallery ) {
// WPML Workaround for compsupp-7102
if (class_exists('Sitepress')) {
$string = $gallery->title;
$textdomain = 'WordPress';
$string_name = 'WPML Workaround: '.substr($string, 0, 20);
$wpml_default_lang = apply_filters('wpml_default_language', NULL );
$wpml_current_lang = apply_filters( 'wpml_current_language', NULL );
if ($wpml_default_lang == $wpml_current_lang ) {
do_action( 'wpml_register_single_string', $textdomain, $string_name, $string );
}
// Apply the translation to the string
$gallery->title = apply_filters('wpml_translate_single_string', $string , $textdomain, $string_name);
}
4- Visit the page where you added your Album
5- Go to WPML > String Translation and translate the new string
Please note that you may need to delete the transients in order to see the changes in the front end. You can use a plugin for it.
I've applied the steps to the sandbox site. Kindly check if it works correctly. (hidden link )
Best regards,
Osama