All-in-One Event Calendar
[resolved] Qtranslate and All in one event calendar issues. (4 posts)

  1. apuestokid
    Posted 4 years ago #

    I'm using Qtranslate (Spanish as main lang, and english as second one) and All in one event calendar together in a website, and i'm having some issues.
    In the main languaje (spanish) everything works ok, but un the second languaje, seems it's OK, but when you navigate inside the calendar, the ajax loader, doesn't recognize the languaje, aun turns everything into spanish.
    For example, if you vissit the calendar in english the name of the mounth and the days is in english, but when you browse between mounths the whole text turns to spanish.

    any idea?


  2. MarcGuay
    Posted 3 years ago #

    I found half of the fix for this. admin-ajax.php needs to have the 'lang' variable sent as part of the GET request, so update the ajaxurl variable in the load_js_translations function of app/controller/class-ai1ec-calendar-controller.php to:

    'ajaxurl' => site_url( 'wp-admin/admin-ajax.php?lang='.qtrans_getLanguage() ),

  3. MarcGuay
    Posted 3 years ago #

    The second part of the solution, so that the links point to the correct language pages, is to change the way the permalink is fetched in your ai1ec theme templates. For example, in my month.php file, I have changed

    <a href="<?php echo esc_attr( get_permalink( $event->post_id ) ) . $event->instance_id ?>"


    <a href="<?php echo esc_html( qtrans_convertURL(get_permalink( $event->post_id ), NULL, TRUE ) ) . $event->instance_id ?>"

    The 3rd variable to qtrans_convertURL is $forceadmin. The function seems to want to bail if WP_ADMIN is defined, which apparently admin-ajax.php does, so it must be "forced" to parse the URL. Found this article http://wordpress-hackers.1065353.n5.nabble.com/Ajax-requests-admin-ajax-php-and-the-WP-ADMIN-constant-td38366.html about it.

  4. Richard
    Posted 3 years ago #

    Hi MarcGuay,

    We really appreciate your time spent to help other users. @apuestokid if this solution does not work then please do not hesitate to contact us.


Topic Closed

This topic has been closed to new replies.

About this Plugin

  • All-in-One Event Calendar
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic