WordPress.org

Ready to get started?Download WordPress

Forums

Events Manager
[resolved] When used with qTranslate displays tags in titles (40 posts)

  1. jpavly
    Member
    Posted 2 years ago #

    Hello,

    I'm using qTranslate in a site and I noticed lately that though Events have now the ability to input another language the result is:

    qTranslate tags in the Event's title
    Both languages texts in description.

    I worked around it by quick-Editing the page title and removing the qTranslate tags, also removing every text in the second language.

    I made a test event here: http://www.marine-club.gr/events/?page=4
    http://www.marine-club.gr/events/test-event-3/

    Thank you

    http://wordpress.org/extend/plugins/events-manager/

  2. Marcus
    NetWebLogic Support
    Plugin Author

    Posted 2 years ago #

    I haven't had the chance to test this with qtranslate yes. Will work on multilingual plugin compatability in the near future.

  3. tiran818
    Member
    Posted 2 years ago #

    Got the same problem here, would be greatly appreciated if you could fix this soon :-)

  4. jpavly
    Member
    Posted 2 years ago #

    Got the same problem here, would be greatly appreciated if you could fix this soon :-)

    @tiran818, be patient my friend! Free support never includes timelines!

  5. Marcus
    NetWebLogic Support
    Plugin Author

    Posted 2 years ago #

    qtranslate will take a while (i.e. at very least a few weeks) for sure. there's a lot of stuff we're going through atm that takes priority.

  6. iamlorenz
    Member
    Posted 2 years ago #

    I'm experiencing the same problem: http://cl.ly/2z0l3L002e3d0j3I3b2Y (printscreen)

    @jpavly: I've visited your website and didn't see any tags in the event titles. Have you figured out a solution? Thanks in advance!

  7. jpavly
    Member
    Posted 2 years ago #

    Well, I did work it around and left only the first test event that has the tags.

    The workaround is creating a New event with a title in English only, then save it. After that, I use quick edit and remove the qTranslate tags. I'm sure this is also done by editing the database entries by phpMyAdmin or something.

  8. mia_123
    Member
    Posted 2 years ago #

    I am having the same issue, just keep us posted when you guys have found a solution, thanks

  9. xriss
    Member
    Posted 2 years ago #

    jpavly

    i m having the same problem. But your test page seems to work. How did you solve it?

  10. jpavly
    Member
    Posted 2 years ago #

    My work-around (not solution) is just 2 posts up towards yours :)

  11. Netz
    Member
    Posted 2 years ago #

    @Marcus
    Thanks mate ... I am also waiting for this fix!

    There are also some US text showing up where it should be Dansih (Date/Time, Location, Categor(ies) (http://sundhed.herbalcenter.dk/events/walkaton-lyngby)
    I did check the DK .po file - All is translated (thx to the translator)

    @jpavly
    I tried you walk around. When I save the edited version EM creates a new location with the event description?? :-)
    It craps the event desc. and bot the location :) (New feature!)
    And it still shows the language tags !! :-(

    Thanks for a GREAT Plugin.
    Now I will check some styling (CSS) options!

    Best regards

    Netz

  12. ckho
    Member
    Posted 2 years ago #

    @Marcus
    I am looking forward to this fix too

  13. jalbaiges
    Member
    Posted 2 years ago #

    Me too, Marcus. Thanks in advance.

    Jaume

  14. Marcus
    NetWebLogic Support
    Plugin Author

    Posted 2 years ago #

    this is probably because the alternate translations aren't being removed.

    if someone can provide me the function required to translate a string into the current language in qtranslate,

    in theory, we can add a workaround with just a few lines of code, and then you could use translation tags in your formats

  15. jalbaiges
    Member
    Posted 2 years ago #

    Marcus, this maybe could help you.

    http://www.qianqin.de/qtranslate/forum/viewtopic.php?f=3&t=9

    Hope to hear from you soon :)

    Thank you,

    Jaume

  16. Marcus
    NetWebLogic Support
    Plugin Author

    Posted 2 years ago #

    that very well might do! will look into this asap

  17. jalbaiges
    Member
    Posted 2 years ago #

    Great, Marcus! I feel anxious about it... :-)

  18. jpavly
    Member
    Posted 2 years ago #

    This is great, looking forward for your update :)

  19. kokomoweb
    Member
    Posted 2 years ago #

    Having the exact same problem. Has anyone figured this yet?

  20. mateusgm
    Member
    Posted 2 years ago #

    I've stepped at this problem today and made a quickfix:

    (put this at your theme's functions.php)

    // hook
    
    add_action('em_event', em_qtranslate, 0, 3);
    
    // qtranslate
    
    function em_qtranslate($target, $arg1=null, $arg2=null, $arg3=null) {
      $target->event_name = em_qtranslate_string($target->event_name);
      $target->event_owner = em_qtranslate_string($target->event_owner);
      $target->post_content = em_qtranslate_string($target->post_content);
    }
    
    function em_qtranslate_string($raw_string) {
      if(function_exists('qtrans_useCurrentLanguageIfNotFoundUseDefaultLanguage'))
        $output = qtrans_useCurrentLanguageIfNotFoundUseDefaultLanguage($raw_string);
      else
        $output = __($raw_string);
      return $output;
    }

    Hope that this help!

  21. mberasategi
    Member
    Posted 2 years ago #

    Mateus, that's so cool! It worked!

  22. Netz
    Member
    Posted 2 years ago #

    Hi Mateusgm!! My new hero!!!
    It works perfect in the cal view
    But not for the LOCATION link when viewing the event?
    Can you add that one ... PLZ PLZ!!
    See my event here!

    CLICK ME

    Keep up the good work!

    Peter

  23. mateusgm
    Member
    Posted 2 years ago #

    Glad it worked :)

    For the location this might do the job, although I havent tested it:

    // hook
    
    add_action('em_location', em_qtranslate_location, 0, 3);
    
    // qtranslate
    
    function em_qtranslate_location($target, $arg1=null, $arg2=null, $arg3=null) {
      $target->location_name = em_qtranslate_string($target->location_name);
      $target->post_content = em_qtranslate_string($target->post_content);
    }
  24. Netz
    Member
    Posted 2 years ago #

    Hi mateusgm!

    You are cool...

    After login out of my blog and returning to do this new fix...
    The first part caused a 500 server error :(

    My theme are OLD and not up to par!
    "Js O4w" ver. 1.1.8 - But changed to fit my style!

    So I can't yet use this cool fix :(
    Unless you can help me out some other way?

  25. Marcus
    NetWebLogic Support
    Plugin Author

    Posted 2 years ago #

    hey, matewusgm, thanks for the contributions. There's another user contributing here -

    http://wordpress.org/support/topic/plugin-events-manager-multilingual-ticket-names?replies=6

    I'm trying to consolidate these snippets into something that could possibly make EM and qTranslate compatible. I've not used qTranslate for quite some time now (years), so I'm not familiar with it anymore, but would be great to see it working with EM if it's the case of a few snippets like this.

  26. Marcus
    NetWebLogic Support
    Plugin Author

    Posted 2 years ago #

    additionally, if we can establish any other major issues with using qtranslate and EM maybe I can offer some insight or maybe even get involved in the near future.

  27. mateusgm
    Member
    Posted 2 years ago #

    Hey marcus, based on my quick experience tweaking EM code, my guess on this issue would be that the real problem lies around not calling proper WP hooks during EM objects initialization.

    For example, on EM_Event you do the following:

    $this->event_name = $event_post->post_title;
    $this->event_owner = $event_post->post_author;
    $this->post_content = $event_post->post_content;

    But doesn't call the filters that WP calls on these attributes when it's initializing a "normal" post (by instance: the_title, the_author, the_content).

    Although i haven't tested this idea, if i'm correct, this fix would not only fix the issues with qTranslate, but turn your plugin compatible with any other plugin that operates through these hooks.

    Have you already thought about this?
    (just reminding you that this is only a guess based on my limited view of the code, maybe i'm just saying nonsense things here =p)

  28. mateusgm
    Member
    Posted 2 years ago #

    Just tested my idea and it worked like a charm :)

    $this->event_name = apply_filters('the_title', $event_post->post_title);
    $this->event_owner = apply_filters('the_author', $event_post->post_author);

    But the application of 'the_content' didn't work (gave a server 503 error) - maybe because you already call it somewhere?

  29. Netz
    Member
    Posted 2 years ago #

    mateusgm!

    Cool (I think..) But is this fix for us all..?

    Could you post the total "FIX" to use so we all can use it and enjoy the neatness of your skills :)

    In advance: THX

  30. Marcus
    NetWebLogic Support
    Plugin Author

    Posted 2 years ago #

    you wouldn't be able to use the_content because you'd create an infinite loop i think.

    you'd probably want to hook into the action em_event and then modify the event there, after instantiation, and then also run this:

    [php]
    remove_filter('the_content','em_content');
    //your code here
    add_filter('the_content', 'em_content');
    [/php]

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic