Support

Home Forums Translations qTranslate and Event Espresso

qTranslate and Event Espresso

Posted: September 3, 2012 at 5:15 pm

Viewing 4 reply threads


Tyler Brown

September 3, 2012 at 5:15 pm

In an earlier post Josh made it seem like it was close to working:

https://eventespresso.com/forums/2012/06/few-bugs/

With #3, WPML doesn’t work with Event Espresso. We are working on a solution that uses q-translate. This could be integrated right now with some template customization. See this post for more info:

I can see how this could easily work with qTranslate, but I can’t seem to get the .mo files to work when switching languages with qTranslate.

If I explicitly set the language using WP_LANG it will use the .mo files, but not if the language is set using the language switch in qTranslate.

  • This topic was modified 12 years, 3 months ago by Tyler Brown.


Tyler Brown

September 3, 2012 at 7:32 pm

Ok. Found the problem with the .mo files and not catching the qTrans language change.

The problem is that qTrans updates the locale on plugins_loaded with priority 2. EE explicity loads the locale (mo) files whenever the plugin first loaded but not initialized.

A quick fix was to change:

//Get language files
load_plugin_textdomain('event_espresso', false, dirname(plugin_basename(__FILE__)) . '/languages');

and change it to:

add_action('plugins_loaded', 'espresso_loadLanguageFiles', 11);
function espresso_loadLanguageFiles(){
    //Get language files
    load_plugin_textdomain('event_espresso', false, dirname(plugin_basename(__FILE__)) . '/languages');
}

That way the language files are loaded just after the other plugins. For not qtrans is initialized with priority 2.


Chris Reynolds

  • Support Staff

September 4, 2012 at 3:10 pm

Nice catch. I’ll create a ticket so we can get this added in.


Tyler Brown

September 4, 2012 at 3:11 pm

As I keep doing work to clean up qTranslate and EE would you guys be willing to to continue to consider adding the non-intrusive support for it?


Tyler Brown

September 8, 2012 at 2:12 pm

I have seen a few people report that the form posts do no maintain the language.

This is easily solved:

Old form code:

 change home_url()+pageId stuff

Now becomes:

get_permalink($event_page_id) 

This will allow qTrans to respect the language.

If you need the blog url using DO NOT USE home_url() instead use bloginfo(‘url’) which will maintain the language code.

I will use this thread as a bit of a how-to to getting EE to work with qTrans.

  • This reply was modified 12 years, 3 months ago by Tyler Brown.
  • This reply was modified 12 years, 3 months ago by Tyler Brown.
  • This reply was modified 12 years, 3 months ago by Tyler Brown.
  • This reply was modified 12 years, 3 months ago by Tyler Brown.
  • This reply was modified 12 years, 3 months ago by Tyler Brown. Reason: This forum makes it super! hard to post HTMLish code
Viewing 4 reply threads

The support post ‘qTranslate and Event Espresso’ is closed to new replies.

Have a question about this support post? Create a new support post in our support forums and include a link to this existing support post so we can help you.

Event Espresso