1

I'm building a new Worpress site with NextGen Gallery. I need it to be multilingual, so I'm using qTranslate-X plugin for translations. But I can not figure out, how to translate NextGen galleries.

I have checked the options 'ngg_album', 'ngg_gallery', 'ngg_pictures' in the qTranslate Configuration. But I can not find, where the translations of these items can be done.

Have I missed something? Can anybody help me to translate NextGen galleries?

Thanks in advance!

1 Answers1

0

The way I woud try to accomplish this is:

1.) Create a custom NextGen template. According to documentation, you need to:

  • Make a copy of the file called gallery.php located here: /wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/view

  • Make a new folder called nggallery in your theme folder: /wp-content/themes/[theme you have activated]/nggallery

  • Place your copy of the file called gallery.php here

  • Rename "gallery.php" to "gallery-templatename.php"

  • To use, use this shortcode: [ nggallery id=1 template=templatename ]

2.) Now in the gallery-templatename.php template, modify the

echo $gallery->slideshow_link_text to _e($gallery->slideshow_link_text).

3.) All that is left is to use qTranslate language tags in gallery title like [:en]English text[:de]German Text. For more information about these language tags, check qTranslate documentation.

user8230352
  • 1,775
  • 1
  • 9
  • 13
  • Thank you for the answer. Gallery title and Alt text are essential for me. I've tried to use tags in the gallery title field, but it didn't work. For example, if I set gallery title to [:lt]Tekstas[:en]Text[:], all this string is displayed as gallery title, tags are not used. I've tried brackets [] and {} - in both cases tags are not recognized and are displayed as text. When using , tags are simply removed after gallery save... – Jolanta Michailova Sep 05 '17 at 06:47
  • Did you try to use a custom template and modified it with _e() functions? – user8230352 Sep 05 '17 at 07:09
  • Yes. This helped :) Thank you! I had to modify the "album-compact.php" and "gallery.php", since I was using both of them. I've put _e() functions for gallery title, image title and alt text. Sorry, my first comment was too quick. Now I understand, how it works :) Is there any possibility to fix the url of the gallery? Now I have "/:ltTekstas:enText:" in the url, which is not very nice. – Jolanta Michailova Sep 05 '17 at 07:50
  • Do you mean anchor text or URL itself? For anchor text, you can try to add _e() for "echo $gallery->slideshow_link_text". Not sure how to do that with URL though. – user8230352 Sep 05 '17 at 08:35
  • I mean URL itself. Thanks anyway. – Jolanta Michailova Sep 05 '17 at 08:54