Title: plugin strings in admin not translated
Last modified: August 24, 2016

---

# plugin strings in admin not translated

 *  Resolved [xnau webdesign](https://wordpress.org/support/users/xnau/)
 * (@xnau)
 * [11 years ago](https://wordpress.org/support/topic/plugin-strings-in-admin-not-translated/)
 * I have a custom plugin running on a site using qtranslate-x. I’m passing all 
   display strings through the WP translation function __() and those strings are
   using the language tags like this: [:en].
 * On the frontend it’s no problem, everything is translated, but in the admin, 
   the strings are untranslated. This was working when I was using the original 
   qtranslate, but qtranslate-x doesn’t translate those strings in the admin.
 * What do I need to do differently to get qtranslate-x to translate those strings
   in the admin?
 * [https://wordpress.org/plugins/qtranslate-x/](https://wordpress.org/plugins/qtranslate-x/)

Viewing 15 replies - 1 through 15 (of 35 total)

1 [2](https://wordpress.org/support/topic/plugin-strings-in-admin-not-translated/page/2/?output_format=md)
[3](https://wordpress.org/support/topic/plugin-strings-in-admin-not-translated/page/3/?output_format=md)
[→](https://wordpress.org/support/topic/plugin-strings-in-admin-not-translated/page/2/?output_format=md)

 *  Plugin Author [Gunu](https://wordpress.org/support/users/grafcom/)
 * (@grafcom)
 * [11 years ago](https://wordpress.org/support/topic/plugin-strings-in-admin-not-translated/#post-6118502)
 * [@xnau](https://wordpress.org/support/users/xnau/),
 * did you try – Settings – Languages – Custom Integration – Compatibility Functions?
 *  Thread Starter [xnau webdesign](https://wordpress.org/support/users/xnau/)
 * (@xnau)
 * [11 years ago](https://wordpress.org/support/topic/plugin-strings-in-admin-not-translated/#post-6118512)
 * Not having any luck there, I don’t see anything that might help the __() function
   do it’s job.
 * I’m trying to avoid modifying the plugin code, so I can’t really make use of 
   the IDs or classes, or qtranslate functions. I’m not using any custom filters
   for those strings, either.
 * Is there a way to get qtranslate to jump in and translate the strings that are
   going through the __() function?
 *  Plugin Author [Gunu](https://wordpress.org/support/users/grafcom/)
 * (@grafcom)
 * [11 years ago](https://wordpress.org/support/topic/plugin-strings-in-admin-not-translated/#post-6118516)
 * > Is there a way to get qtranslate to jump in and translate the strings that 
   > are going through the __() function?
 * Yes.
 * You use .po files for your plugin?
 * What language are you talking about?
 * See under – Settings – Languages – Languages – Edit (your) language what is under
   Locale?
 * This corresponds to your language files?
 *  Thread Starter [xnau webdesign](https://wordpress.org/support/users/xnau/)
 * (@xnau)
 * [11 years ago](https://wordpress.org/support/topic/plugin-strings-in-admin-not-translated/#post-6118522)
 * Ok, these strings can’t be in translation files, they are defined by the user.
   I let the user enter the setting value with the translation blocks. Then I use
   a __() gettext call with no textdomain to display the translated string.
 * It’s worked well in the past and doesn’t require the user to install a specific
   translation plugin. It works great on the frontend, but not in the admin for 
   some reason…I thought it would be a simple thing to get it working in the admin
   also. As I mentioned, this also works well with the original qtranslate plugin.
 *  Plugin Author [Gunu](https://wordpress.org/support/users/grafcom/)
 * (@grafcom)
 * [11 years ago](https://wordpress.org/support/topic/plugin-strings-in-admin-not-translated/#post-6118523)
 * But I’ve still got no answer to my questions….
 * > What language are you talking about?
   >  See under – Settings – Languages – Languages–
   > Edit (your) language what is under Locale?
 *  Thread Starter [xnau webdesign](https://wordpress.org/support/users/xnau/)
 * (@xnau)
 * [11 years ago](https://wordpress.org/support/topic/plugin-strings-in-admin-not-translated/#post-6118527)
 * Ah I see…sorry…that is blank. In the WP general settings it is en_US
 *  Thread Starter [xnau webdesign](https://wordpress.org/support/users/xnau/)
 * (@xnau)
 * [11 years ago](https://wordpress.org/support/topic/plugin-strings-in-admin-not-translated/#post-6118528)
 * OK, when I edit the language, I see the locale is also en_US
 *  Plugin Author [Gunu](https://wordpress.org/support/users/grafcom/)
 * (@grafcom)
 * [11 years ago](https://wordpress.org/support/topic/plugin-strings-in-admin-not-translated/#post-6118530)
 * What languages are active under qTranslate?
 * In what language the admin of your plugin is not visible?
 * Edit:
    Did you change the language button in the upper right admin section used?
 *  Thread Starter [xnau webdesign](https://wordpress.org/support/users/xnau/)
 * (@xnau)
 * [11 years ago](https://wordpress.org/support/topic/plugin-strings-in-admin-not-translated/#post-6118535)
 * The site is set up for English, Nederlands, Deutsch, Español, and Français
 * I’ve tried changing the language, but the strings are still untranslated. For
   instance, a field label is shown as “[:en]My First Name[:de]Mein Vorname[:fr]
   Mon prénom[:nl]Mijn voornaam[:es]Mi nombre[:]”
 * This string is passed through the __() function before being displayed.
 *  Plugin Author [Gunu](https://wordpress.org/support/users/grafcom/)
 * (@grafcom)
 * [11 years ago](https://wordpress.org/support/topic/plugin-strings-in-admin-not-translated/#post-6118585)
 * [@xnau](https://wordpress.org/support/users/xnau/),
 * I hope this helps
 * > Most themes/plugins use __() translation by default, otherwise you may ask 
   > theme author to make this little modification for each field you need to be
   > translatable.
   >  Also, proper way for them to pass a variable through a filter,
   > and then you can put the filter name in “Custom Filters” configuration to integrate
   > their plugin. This is the best and proper way which does not require any knowledge
   > about q-X.
 *  [Boyan Raichev](https://wordpress.org/support/users/studioreforma/)
 * (@studioreforma)
 * [10 years, 12 months ago](https://wordpress.org/support/topic/plugin-strings-in-admin-not-translated/#post-6118755)
 * I have the same problem – I have a plugin that saves some strings in wp_options.
   I used to save content with lang string like [:en] and passing them trought __()
   would always leave the relevant translation in past (with original qtranslate,
   then qtranslate m). Now it does not.
 * In fact, just putting _e(‘[:bg]test1[:en]test2’); directly in my php for admin
   page still does not translate anything? It just echoes [:bg]test1[:en]test2
    
   This means Qtranslate X is not automatically translating __() function… What 
   should I do?
 *  Plugin Author [Gunu](https://wordpress.org/support/users/grafcom/)
 * (@grafcom)
 * [10 years, 12 months ago](https://wordpress.org/support/topic/plugin-strings-in-admin-not-translated/#post-6118756)
 * @talkingaboutthis,
 * compatibility functions checked?
 *  [Boyan Raichev](https://wordpress.org/support/users/studioreforma/)
 * (@studioreforma)
 * [10 years, 12 months ago](https://wordpress.org/support/topic/plugin-strings-in-admin-not-translated/#post-6118757)
 * [@gunu](https://wordpress.org/support/users/gunu/) – the problem seems to be 
   that the gettext filter is now moved to qtranslate_frontend with version 3.3…
   So Qtranslate X just does not work on __() calls in the admin any more… I find
   this veeeeery strange. __() calls were the way that plugins could let users have
   multilingual content with different multilanguage plugins. One should not be 
   supposed to develop for a specific multilanguage plugin – my code should work
   with all major multilanguage plugins.
 * Here is the use-case in more detail: I have a shopping cart and site user can
   enter custom payment methods, for example. These payment methods have a name.
   So the user would be able to name them like [:en]Bank Transfer[:de]Überweisung.
   This is not only used on the frontend, but also on the backend – in the order
   information. Or for example, when the seller prints the invoice for the purchase,
   the invoice is supposed to be in the correct language for the buyer.
 *  Plugin Author [Gunu](https://wordpress.org/support/users/grafcom/)
 * (@grafcom)
 * [10 years, 12 months ago](https://wordpress.org/support/topic/plugin-strings-in-admin-not-translated/#post-6118758)
 * @talkingaboutthis,
 * > So Qtranslate X just does not work on __() calls in the admin any more
 * This should work.
 * Which other plugins do you use?
 *  [Boyan Raichev](https://wordpress.org/support/users/studioreforma/)
 * (@studioreforma)
 * [10 years, 12 months ago](https://wordpress.org/support/topic/plugin-strings-in-admin-not-translated/#post-6118759)
 * I already tried turning all other plugins off…
 * In Qtranslate X release notes for last version it says:
 * > Enhancement: filters ‘gettext’ and ‘gettext_with_context’ are moved to qtranslate_frontend.
   > php, as they are not needed on admin side.
 * So __(‘[:en]test[:de]test2’) in admin would no longer work… I believe [@xnau](https://wordpress.org/support/users/xnau/)
   is referring to the same problem, which is why I wrote here.

Viewing 15 replies - 1 through 15 (of 35 total)

1 [2](https://wordpress.org/support/topic/plugin-strings-in-admin-not-translated/page/2/?output_format=md)
[3](https://wordpress.org/support/topic/plugin-strings-in-admin-not-translated/page/3/?output_format=md)
[→](https://wordpress.org/support/topic/plugin-strings-in-admin-not-translated/page/2/?output_format=md)

The topic ‘plugin strings in admin not translated’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/qtranslate-x_f9f9f9.svg)
 * [qTranslate X](https://wordpress.org/plugins/qtranslate-x/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/qtranslate-x/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/qtranslate-x/)
 * [Active Topics](https://wordpress.org/support/plugin/qtranslate-x/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/qtranslate-x/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/qtranslate-x/reviews/)

 * 35 replies
 * 6 participants
 * Last reply from: [Boyan Raichev](https://wordpress.org/support/users/studioreforma/)
 * Last activity: [10 years, 7 months ago](https://wordpress.org/support/topic/plugin-strings-in-admin-not-translated/page/3/#post-6118869)
 * Status: resolved