WordPress.org

Ready to get started?Download WordPress

Forums

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

  1. apuestokid
    Member
    Posted 2 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?

    http://wordpress.org/extend/plugins/all-in-one-event-calendar/

  2. MarcGuay
    Member
    Posted 1 year 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
    Member
    Posted 1 year 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 ?>"

    to

    <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
    Member
    Posted 1 year 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.

    Regards

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic