Skip Navigation

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.

Sun Mon Tue Wed Thu Fri Sat
9:00 – 18:00 9:00 – 18:00 9:00 – 18:00 9:00 – 18:00 9:00 – 18:00 - -
- - - - - - -

Supporter timezone: Africa/Cairo (GMT+03:00)

Tagged: 

This topic contains 5 replies, has 2 voices.

Last updated by Osama Mersal 1 year, 6 months ago.

Assisted by: Osama Mersal.

Author Posts
December 13, 2023 at 7:53 pm #15058687

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

December 14, 2023 at 12:39 pm #15063097

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

December 15, 2023 at 12:38 pm #15072361

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.

December 15, 2023 at 1:46 pm #15073445

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.

December 16, 2023 at 1:50 pm #15077389

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

December 21, 2023 at 4:27 pm #15112193

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

The topic ‘[Closed] Translating NextGen gallery titles’ is closed to new replies.