Title: [Plugin: qTranslate] How to add php translation code into another php function
Last modified: August 19, 2016

---

# [Plugin: qTranslate] How to add php translation code into another php function

 *  [dczepiel](https://wordpress.org/support/users/dczepiel/)
 * (@dczepiel)
 * [16 years, 7 months ago](https://wordpress.org/support/topic/plugin-qtranslate-how-to-add-php-translation-code-into-another-php-function/)
 * Hello,
 * I know nothing about php.
    I tried to qTranslate all I could in my php files 
   using the php function provided in FAQ – `<?php _e("<!--:en-->english text<!--:--
   ><!--:de-->german text<!--:-->"); ?>` The problem is when I need to translate
   something that is already inside a php function like below:
 * `<?php comments_number('No Responses', 'One Response', '% Responses' );?>`
 * Is there a way to translate those ‘No responses’, ‘One Response’ etc. ?

Viewing 5 replies - 1 through 5 (of 5 total)

 *  Thread Starter [dczepiel](https://wordpress.org/support/users/dczepiel/)
 * (@dczepiel)
 * [16 years, 7 months ago](https://wordpress.org/support/topic/plugin-qtranslate-how-to-add-php-translation-code-into-another-php-function/#post-1259758)
 * anyone ?
 *  [nouveller](https://wordpress.org/support/users/nouveller/)
 * (@nouveller)
 * [16 years, 7 months ago](https://wordpress.org/support/topic/plugin-qtranslate-how-to-add-php-translation-code-into-another-php-function/#post-1259762)
 * How about…
 *     ```
       <?php 
   
       	$no_responses = __("<!--:en-->english text<!--:--><!--:de-->german text<!--:-->");
   
       	$one_response = __("<!--:en-->english text<!--:--><!--:de-->german text<!--:-->");
   
       	$responses = __("<!--:en-->english text<!--:--><!--:de-->german text<!--:-->");
   
       	comments_number($no_responses, $one_response, '% $responses' );
   
       ?>
       ```
   
 * I think `__()` returns the value where as `_e(` echoes it.
 *  Thread Starter [dczepiel](https://wordpress.org/support/users/dczepiel/)
 * (@dczepiel)
 * [16 years, 7 months ago](https://wordpress.org/support/topic/plugin-qtranslate-how-to-add-php-translation-code-into-another-php-function/#post-1259821)
 * this looks pretty hard and I am not sure if that was the solution I was looking
   for but I will give it a try.
 * I hoped there is a way to just insert the <!–:en–>english text<!–:–><!–:de–>german
   text<!–:–> part into an existing php function to make it work and be translated.
 * But thanks !
 *  [WebTechGlobal](https://wordpress.org/support/users/webtechglobal/)
 * (@webtechglobal)
 * [16 years, 5 months ago](https://wordpress.org/support/topic/plugin-qtranslate-how-to-add-php-translation-code-into-another-php-function/#post-1259924)
 * I’ve never seen translation used in that way.
 * Are you using the POT and MO files?
 * The whole point of the __() and putting text in it is to tell wordpress that 
   string should be translated. It then looks into the MO files for the alternative
   doesnt it?
 * If your way works then great but it looks like far too much work.
 * WebTechGlobal
 *  [WebTechGlobal](https://wordpress.org/support/users/webtechglobal/)
 * (@webtechglobal)
 * [16 years, 5 months ago](https://wordpress.org/support/topic/plugin-qtranslate-how-to-add-php-translation-code-into-another-php-function/#post-1259925)
 * Miss this link for anyone else…
 * [http://codex.wordpress.org/I18n_for_WordPress_Developers](http://codex.wordpress.org/I18n_for_WordPress_Developers)

Viewing 5 replies - 1 through 5 (of 5 total)

The topic ‘[Plugin: qTranslate] How to add php translation code into another php
function’ is closed to new replies.

## Tags

 * [code](https://wordpress.org/support/topic-tag/code/)
 * [function](https://wordpress.org/support/topic-tag/function/)
 * [php](https://wordpress.org/support/topic-tag/php/)
 * [webtechglobal](https://wordpress.org/support/topic-tag/webtechglobal/)

 * 5 replies
 * 3 participants
 * Last reply from: [WebTechGlobal](https://wordpress.org/support/users/webtechglobal/)
 * Last activity: [16 years, 5 months ago](https://wordpress.org/support/topic/plugin-qtranslate-how-to-add-php-translation-code-into-another-php-function/#post-1259925)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
