How to integrate WPML and amr-events – it’s easy

Want a multilingual website with an events plugin ? WPML works with amr-events (or the other way around!) – with standard posts or custom post types.

Please note that WPML is not necessary if all you want is events in another language with localised dates and numbers.   If all you want to do is create a translation manually, the code-styling localisation translation plugin (free) is handy.

WPML is a free plugin that you can use to either create translations manually, or pass translation requests through to their ICanLocalize [aff] service. IcanLocalize requires payment for translations.

With WPML, how to make it work

It is gratifying when plugins integrate seamlessly, using WordPress as it is intended.  I designed amr-events with this in mind – that one should be able to use a host of other plugins with it and was happy to discover that paid off here.   In addition WPML enables plugins and themes to pre-configure some bits for you to make it even easier.  Thus the necessary XML file is now included in the plugin files.   

Steps:

  1. Check the WPML settings (see advanced below) to be sure that it has picked up the info from the .xml file
    • check the custom field copy settings.  This is essential to be sure that the event data goes with the translation.  Think carefully about the LOCATION (address) field.
    • check the “translate custom post type” settings (if using custom)
    • check the blog post retrieval setting if no translation
  2. Create some representative events in original languages
  3. Create the translations.  WPML should copy the necessary event data. This event data is essential for the translation to be picked up as an event in a language calendar.
  4. Create your calendar page, add shortcode, save
  5. Create the translation page of the above calendar page, add same shortcode, save
  6. View calendars in original and other languages, check that events that have been translated are showing up on the appropriate pages.

Advanced:

If you experience any problems with event data copying, then please explore the WPML configuration as follows:

  1. In WPML settings, go to MultiLingual Content Setup, scroll down to the custom fields, and check all the events fields for “copying”.   See list at bottom of this post. Note: Decide whether you want “_LOCATION” addresses to be copied or translated.  The XML file is currently set to copy, but the next version will be to translate.  If this is an inappropriate default, please let me know.
  2. If you are using custom post types and taxonomies, scroll down a bit further and tick boxes for those too to enable translation for them.  Since you can create your own taxonomies for events, it is not possible to pre-configure these for you. (Remember to flush permalinks)
  3. Under WPML > Languages, please scroollll down to more options, check “Blog posts to display” – this choice may impact your events retrieval.

See screenshots below.

Without WMPL, single language content possible, with translated plugin files

Amr-events aims to localise, using recommended WordPress functions for translation and date and number display.  So if there is a language .mo file, it should use that for all text’s produced by the plugin.

Without a .MO file – dates and numbers will localise

Even without the mo file, with the calls to WordPress date and number localisation, you may find the public output (the dates etc with your language content) tolerable if your event creator can handle the english prompts!

RTL css for event creation.

I have included a basic RTL css for right to left languages, however am aware that it may not be adequate.  I would welcome input from anyone using a right to left language.

Plugin Translations:

Please note that  I am reliant on people using it in other languages to provide feedback and pickup on any details that are not localising or are not RTL compliant.  I will fix those asap.
Translations are always appreciated (by others at least! – hard for me to know how accurate or up to date they are!).  Translations should be in .po and .mo format. Thanks.

Screenshots

Event Edit Screen With Languages
Event Edit Screen with WPML options
Example of translated calendar page with translated and original language events
Example of translated calendar page with translated and original language events
WPML Menu option
WPML Menu option
Mark custom event fields in WMPL
Enable translation for events created as custom post types
Enable Translation for events created as custom post types
Only posts in language or all?

Custom fields to mark for copy in WMPL:

In the wpml settings, the radio buttons will be greyed out if preset from the xml file

  • _DTSTART
  • _DTEND
  • _DUE
  • _GEO
  • _TZID
  • _TZNAME
  • _ATTENDEE
  • _CONTACT
  • _ORGANIZER
  • _EXDATE
  • _EXRULE
  • _RDATE
  • _RRULE
  • _SEQUENCE
  • _DURATION
  • _ALLDAY
  • _VEVENT
  • _forever
  • _timezone
  • _tztype

Location fields (amr-events and other geo plugins that integate)

/* own fields */

  • _LOCATION (optional -it is the address, you may wish to translate rather),
  • _latitude,
  • _longitude,

/* _wpgeo fields*/

  • _wp_geo_latitude,
  • _wp_geo_longitude,
  • _wp_geo_title,
  • _wp_geo_map_settings,

/* geolocation fields  no underscore */

  • geo_latitude,
  • geo_longitude,
  • geo_address,
  • geo_public,

/* _gpress posts */

  • _gpress_posts

Ical fields not yet in use, but may be later. Update required if you use new functionality:

  • _ATTACH,
  • _CLASS,
  • _PERCENT-COMPLETE,
  • _PRIORITY,
  • _RESOURCES,
  • _STATUS,
  • _COMMENT,
  • _FREEBUSY
  • _TRANSP,
  • _RECURRENCE-ID,
  • _RELATED-TO,
  • _ACTION
  • _REPEAT
  • _icaltrigger