4

I'm using qTranslate on a Wordpress site but am having a little trouble working some bits of it into the Wordpress functions in some cases. For example, when I want to include a "Read More link" within a query, I can just do:

echo _e('[:en]Read More_[:ru]читать далее_');

(that said, it looks like it's echoing an echo, so I may not be doing that right, even though it seems to work).

But I can't quite work out the syntax for this:

echo comments_number( '<div class="noComment"></div>No Comments', '<div class="oneComment"></div>One Comment', '<div class="oneComment"></div>% Comments' );

How do I put in the translation for those?

yolise
  • 139
  • 1
  • 2
  • 10
  • Though you have found the solution already. But `_e` function itself echos. You would echo if its `__()` version. – Lenin Oct 21 '13 at 03:45

1 Answers1

4

try this:

echo comments_number(
    qtrans_useCurrentLanguageIfNotFoundUseDefaultLanguage('<div class="noComment"></div>[:en]No Comments[:es]No comentarios'), 
    qtrans_useCurrentLanguageIfNotFoundUseDefaultLanguage('<div class="oneComment"></div>[:en]One Comment[:es]Uno comentario'), 
    qtrans_useCurrentLanguageIfNotFoundUseDefaultLanguage('<div class="oneComment"></div>[:en]% Comments[:es]% comentarios)' 
);
Kuf
  • 17,318
  • 6
  • 67
  • 91
  • Fab. Although it doesn't work quite the way you've done it. I tried it this way: [:en] rather than wrapping it in [lang_en][/lang_en] and it works. Cheers! – yolise Sep 14 '12 at 09:43