Title: plugin integration
Last modified: August 22, 2016

---

# plugin integration

 *  Resolved [Franky](https://wordpress.org/support/users/liedekef/)
 * (@liedekef)
 * [11 years, 4 months ago](https://wordpress.org/support/topic/plugin-integration-1/)
 * Hi,
 * I’m wondering how to add the language switch buttons to my own plugin admin page,
   so I could use qtranslate-x in some parts that need translating too.
    And maybe
   a hook/filter so we can add the id’s to be parsed via our own plugin directly
   would be nice too …
 * [https://wordpress.org/plugins/qtranslate-x/](https://wordpress.org/plugins/qtranslate-x/)

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

1 [2](https://wordpress.org/support/topic/plugin-integration-1/page/2/?output_format=md)
[→](https://wordpress.org/support/topic/plugin-integration-1/page/2/?output_format=md)

 *  Plugin Author [John Clause](https://wordpress.org/support/users/johnclause/)
 * (@johnclause)
 * [11 years, 4 months ago](https://wordpress.org/support/topic/plugin-integration-1/#post-5628851)
 * Yes, this is a good idea, thank you! Please, give us a few days to put that in.
 *  Thread Starter [Franky](https://wordpress.org/support/users/liedekef/)
 * (@liedekef)
 * [11 years, 4 months ago](https://wordpress.org/support/topic/plugin-integration-1/#post-5628855)
 * Cool, meanwhile a howto for the language switch buttons would be nice already
   🙂
 *  Plugin Author [John Clause](https://wordpress.org/support/users/johnclause/)
 * (@johnclause)
 * [11 years, 4 months ago](https://wordpress.org/support/topic/plugin-integration-1/#post-5628915)
 * Hi, Franky, could you send me your plugin, so that I can see exactly what you
   wish? You can use qtranslateteam at g mail d com. Thanks!
 * P.S. There is “Custom Fields” field which is what you would probably need, but
   it may not affect your page. That is what I would need to enable for you somehow.
 *  Thread Starter [Franky](https://wordpress.org/support/users/liedekef/)
 * (@liedekef)
 * [11 years, 4 months ago](https://wordpress.org/support/topic/plugin-integration-1/#post-5628919)
 * The plugin is on WP: events made easy
    After installing it, try to e.g. add a
   new event (via the seperate EME menu)
 *  Plugin Author [John Clause](https://wordpress.org/support/users/johnclause/)
 * (@johnclause)
 * [11 years, 3 months ago](https://wordpress.org/support/topic/plugin-integration-1/#post-5628948)
 * > add the language switch buttons to my own plugin
 * The latest beta version from GitHub: [https://github.com/qTranslate-Team/qtranslate-x](https://github.com/qTranslate-Team/qtranslate-x),
   which you can [download here](https://github.com/qTranslate-Team/qtranslate-x/archive/master.zip),
   has a new experimental option “Custom Pages”. Could you take a look and see if
   this is what you would want? Please, if you test it, test not only this problem,
   but rather the whole thing. Thanks a lot.
 *  Thread Starter [Franky](https://wordpress.org/support/users/liedekef/)
 * (@liedekef)
 * [11 years, 3 months ago](https://wordpress.org/support/topic/plugin-integration-1/#post-5628953)
 * Hi,
 * I just downloaded the latest github version and added the value ‘admin.php?page
   =eme-new_event’ to the ‘Custom Pages’ option. Then I went to that page but no
   language buttons showed up …
 *  Plugin Author [John Clause](https://wordpress.org/support/users/johnclause/)
 * (@johnclause)
 * [11 years, 3 months ago](https://wordpress.org/support/topic/plugin-integration-1/#post-5628954)
 * Hi [@franky](https://wordpress.org/support/users/franky/), please try the latest
   from [GitHub](https://github.com/qTranslate-Team/qtranslate-x)
 * Integration is in the process of design. Let us do it together. Please, let me
   know how you envision this.
 * Right now buttons get at the very top of your page, because, by default, it puts
   them in front of `<form>` inside `div` “wrap”. In your case `<form>` is located
   outside of “wrap”, which is unusual, all other admin pages I saw have form inside
   wrap. So, I created langSwitchWrapAnchor variable, which one can set in a custom
   script to put buttons wherever desired.
 * Anyway, there is a lot more to figure out. I saw in some of your pages, in java
   console, undefined function qtrans_use was used, which should not be. I believe,
   we need to design integration in such a way, that you would not need any additional
   coding at all. You would only need to specify ids and classes of items to display
   or to edit translated per admin page needed. I was thinking about creating an
   xml-like file, which a plugin/theme developer would have to create to achieve
   integration. Would this make sense to you?
 * Could you gather information which ids and classes you wish to make translatable
   on each of relevant pages?
 * I realized that currently existent option for custom fields may be in conflict
   if same id is used on different pages and one of them needs translation, while
   other does not. I originally thought it would be a rather rare case, but now 
   I see that conflicts are quite possible to happen. So, ids and classes need to
   be specified per each page separately.
 * Please, let me know what would make the best sense to you.
 * Thanks a lot.
 *  Thread Starter [Franky](https://wordpress.org/support/users/liedekef/)
 * (@liedekef)
 * [11 years, 3 months ago](https://wordpress.org/support/topic/plugin-integration-1/#post-5628956)
 * Using the latest github version I first get this upon activation:
    Notice: Undefined
   variable: lang in /var/www/html/wordpress/wp-content/plugins/qtranslate-x/admin/
   admin_utils.php on line 10
 * After that, when creating a new event, the buttons indeed show up (after adding
   the “title” id to the advanced settings in qtranslate-x) and they react correctly
   too.
    However, trying to add the “content” text-container (that does wordpress
   html) doesn’t seem to be working: adding it to the id-settings doesn’t work, 
   and adding wp-content-editor-container to the id-section results in a javascript
   error:
 * TypeError: n is undefined
    [http://localhost/wordpress/wp-admin/admin.php?page=eme-new_event](http://localhost/wordpress/wp-admin/admin.php?page=eme-new_event)
   Line 2191
 * That lines is about the qtranslate-x js-code being added, and seems to have to
   do with this part:
 * on(n){n.mlContentField.value=”<“===n.separator?qtranxj_join_c(n.contents):qtranx…
 *  Plugin Author [John Clause](https://wordpress.org/support/users/johnclause/)
 * (@johnclause)
 * [11 years, 3 months ago](https://wordpress.org/support/topic/plugin-integration-1/#post-5628958)
 * Sorry, [@franky](https://wordpress.org/support/users/franky/), for the delay 
   in reply. I am busy right now with something else, but will be back to this shortly.
 * Meanwhile, a few notes. First of all, you do not need to run any scripts serving
   language substitution on your own. If you do, please, point me to a line in your
   code to disable it during my testing. Second, please, gather the information 
   on all your pages and fields needed to be translatable. Like this, for example:
 *     ```
       On page /wp-admin/admin.php?page=eme-new_event:
       <input type="text" id="title" name="edit-event_name" value="">
       <textarea class="wp-editor-area" rows="20" autocomplete="off" cols="40" name="content" id="content"></textarea>
       etc.
       ```
   
 * It easy enough to do with “Inspect Element” action on mouse right-click, but 
   I am not sure which fields to you want.
 * I will make it work shortly, it all is ready in pieces, it is a matter of putting
   it together, and I will need the information as described.
 * Thanks a lot.
 * P.S. Please, give me your input which format to choose for supplying this information.
   XML file? JSON file? What else? Which one will be easier for plugin authors to
   create and to be load quick?
 *  Plugin Author [John Clause](https://wordpress.org/support/users/johnclause/)
 * (@johnclause)
 * [11 years, 3 months ago](https://wordpress.org/support/topic/plugin-integration-1/#post-5628966)
 * Hi [@franky](https://wordpress.org/support/users/franky/), it occurred to me 
   that the easiest way to tune everything is to create a separate plugin “Events
   Made Easy & qTranslate-X”, which I did:
    [https://github.com/qTranslate-Team/events-made-easy-qtranslate-x](https://github.com/qTranslate-Team/events-made-easy-qtranslate-x)
   Please, download and try it with the latest -X.
 * I only started on configuring the page `admin.php?page=events-manager&eme_admin_action
   =edit_event. I have put some comments and hope it will be enough for you to finish
   putting in all the fields needed. Submit pull request at GitHub, when you are
   done. Later I will make it possible to have all this information in a configuration
   file, as I already mentioned. Let us make it fully work this way first.
 * I also submitted the plugin to WordPress, so by the time we are finished with
   tuning it, WordPress will hopefully approve it and people will be able to easily
   use it.
 * I look forward to hearing back from you.
 *  Plugin Author [John Clause](https://wordpress.org/support/users/johnclause/)
 * (@johnclause)
 * [11 years, 2 months ago](https://wordpress.org/support/topic/plugin-integration-1/#post-5628967)
 * BTW, [@franky](https://wordpress.org/support/users/franky/), I am getting bunch
   of errors on wp-admin/error_log file:
 *     ```
       PHP Notice:  Undefined variable: option_categories in /wp-content/plugins/events-made-easy/eme_widgets.php on line 284
   
       PHP Warning:  Invalid argument supplied for foreach() in /wp-content/plugins/events-made-easy/eme_UI_helpers.php on line 4
   
       PHP Notice:  Undefined variable: option_categories in /wp-content/plugins/events-made-easy/eme_widgets.php on line 136
   
       PHP Notice:  Undefined variable: option_categories in /wp-content/plugins/events-made-easy/eme_widgets.php on line 144
       ```
   
 * Keep WP_DEBUG on when you develop in order to clean those up.
 * Any news on new plugin?
 *  Thread Starter [Franky](https://wordpress.org/support/users/liedekef/)
 * (@liedekef)
 * [11 years, 2 months ago](https://wordpress.org/support/topic/plugin-integration-1/#post-5628968)
 * Thanks for the warning info. I always develop with WP_DEBUG activated, but since
   I already had eme categories, I didn’t see this warning. I fixed it in trunk.
   
   Concerning the plugin events-made-easy-qtranslate-x: I don’t really know if it
   is the correct method, but I’ll let you decide that (we could just put the filter
   in the EME code). I tried to network-activate the plugin, and it works but it
   generated 1 extra character of output (I didn’t check for that yet).
 * I just tested the latest version of qtranslate-x and the extra plugin events-
   made-easy-qtranslate-x and I get the language buttons for the title and event
   details now, so that’s great!
    I looked in the plugin events-made-easy-qtranslate-
   x but I’m a bit confused on how to add extra pages:
 * admin.php?page=eme-templates
    admin.php?page=eme-categories admin.php?page=eme-
   locations admin.php?page=eme-new_event (this one has the same formfields as for‘
   edit events’).
 * I guess I need to repeat the code for $page_config[‘pages’] and below for each
   one ?
 * Also, for each of the “format settings” in EME (when editing/creating an event),
   it would be nice to have the language buttons too, but I guess that’s just a 
   matter of adapting the value of
    $page_config[‘anchors’], correct?
 *  Plugin Author [John Clause](https://wordpress.org/support/users/johnclause/)
 * (@johnclause)
 * [11 years, 2 months ago](https://wordpress.org/support/topic/plugin-integration-1/#post-5628969)
 * > I guess I need to repeat the code for $page_config[‘pages’]
 * Correct. Later I plan to make it all configurable with an xml-like file to record
   all those things, so that people could put in their own custom configuration 
   without an additional plugin.
 * > I don’t really know if it is the correct method
 * It is too much of additional coding inside eme plugin and not everyone needs 
   it. We both could share the authority and the support of it. I listed you as 
   an author. I think it is better to keep it separate for those who need it only.
   Besides, I was thinking that it would be easier for us to tune it this way for
   the first time, since I do not want to dig and to change your plugin. Let us 
   make it work 100% first, and then we will think about the best way to deploy 
   it.
 * More than one anchor on a page does not yet work well, since two different sets
   of buttons do not interact with each other, although each set works ok separately.
   I would use one set per page for now.
 * Let me see how far you got, submit pull request with whatever you got even if
   it is not working well. Then I could comment and improve further.
 *  Plugin Author [John Clause](https://wordpress.org/support/users/johnclause/)
 * (@johnclause)
 * [11 years, 2 months ago](https://wordpress.org/support/topic/plugin-integration-1/#post-5628986)
 * [@franky](https://wordpress.org/support/users/franky/): How is it going? Do you
   have github repository for Events Made Easy? Maybe we should continue communication
   on GitHub?
 *  Thread Starter [Franky](https://wordpress.org/support/users/liedekef/)
 * (@liedekef)
 * [11 years, 2 months ago](https://wordpress.org/support/topic/plugin-integration-1/#post-5628987)
 * Sorry, I have been very busy with the next version of the plugin and will come
   back to this afterwards.

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

1 [2](https://wordpress.org/support/topic/plugin-integration-1/page/2/?output_format=md)
[→](https://wordpress.org/support/topic/plugin-integration-1/page/2/?output_format=md)

The topic ‘plugin integration’ 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/)

 * 21 replies
 * 2 participants
 * Last reply from: [Franky](https://wordpress.org/support/users/liedekef/)
 * Last activity: [11 years, 2 months ago](https://wordpress.org/support/topic/plugin-integration-1/page/2/#post-5628993)
 * Status: resolved