0

im trying to set different languages in the caption place but i looks impossible to make it work. I tried putting in the caption:

  • [:en] English text [:de] Deutsch text
  • English text Deutsch text

but when i print it, it would just make a display like this:

[:en] English text [:de] Deutsch text
Deutsch text

So in the first case, it doesn't interprets the shortcode of qtranslate and in the second case it just removes it.

When calling the galley (im using SexyCycle) i call it this way in the post:

<div class="centerColumn col gu3"> <?php print_custom_field('gallery:do_shortcode'); ?> </div>

Then, in the plugin i have this:

if ($caption == 'caption' && trim($attachment->post_excerpt)) { 
            echo $attachment->post_excerpt;
            $ret .= "<{$captiontag} class='gallery-caption'>" . wptexturize( $attachment->post_excerpt) . "</{$captiontag}>";
        }
        else if ($caption == 'desc' && trim($attachment->post_content)) {
            $ret .= "<{$captiontag} class='gallery-caption'>" . wptexturize($attachment->post_content) . "</{$captiontag}>";
        }

any suggestions? Thanks!

davidpenuela
  • 51
  • 1
  • 9

2 Answers2

2

I created a simple fix that allows you to select the language for multimedia files using Wordpress qTranslate plugin

https://github.com/rafaelcalleja/qTranslateMultimediaLanguage

Rcalleja
  • 31
  • 2
1

Solved!
I changed

wptexturize( $attachment->post_excerpt)

for

qtrans_useCurrentLanguageIfNotFoundUseDefaultLanguage($attachment->post_excerpt);

davidpenuela
  • 51
  • 1
  • 9