QTranslate and Wordpress Functions

I use qTranslate on a Wordpress site, but in some cases I have a slight problem with some of its fragments working in Wordpress. For example, when I want to include the "Read more" link in the request, I can simply do:

echo _e('[:en]Read More_[:ru] _'); 

(this suggests that it sounds like an echo, so I may not be right, even if it works).

But I cannot 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 add a translation for them?

+4
source share
1 answer

try the following:

 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)' ); 
+4
source

Source: https://habr.com/ru/post/1433842/


All Articles