Did you know that The Events Calendar allows you to create custom language files for the plugin in addition to the ones that come packaged with the plugin? Well, it does as of Version 4.2, and we want to show you how that works.
Why use custom language files?
It’s a fair question. The plugin already includes language files, so why not simply edit those and be on your merry way?
The reason is that we release regular updates to our plugins, and with each update, existing files on your server get updated with the new files.
This means that each update essentially erases the hard work you may have put into editing the language files! We’re not trying to make your life difficult—at this time, this is just the only way we can offer plugin updates to you.
This is where custom language files come to the rescue! They allow you to duplicate any of the plugin’s language files, store them in a safe place on your WordPress installation, and prevent them—and any edits you’ve made to them—from being overridden when we release updates.
That’s the main idea of custom language files: WordPress will first check for your custom language files before looking for the ones we package with our releases, giving you control of the language translations while avoiding losing those customizations.
Let’s dive into the steps for creating your own custom language files.
Step 1: Make a copy of the language file you need
The first step is to locate the language file you wish to customize and make a copy of it. For your reference, all of our products include a directory for languages:
- The Events Calendar:
- Events Calendar Pro:
- Event Tickets:
- Event Tickets Plus:
- Community Events:
- Community Tickets:
- Filter Bar:
- Eventbrite Tickets:
So, for example, if you want to customize the Spanish translation file for The Events Calendar, you would copy the two following files:
Step 2: Find the WordPress languages folder
The second step is to located the languages file for your WordPress installation. Many WordPress installations include this by default at this location:
Inside of that folder is another folder called
/plugins. That is where we’re going to hang out.
If, for some reason, your WordPress installation does not include
/wp-content/languages/plugins, please create these folders.
Step 3: Place the copied language files in the languages folder
Once you’ve located (or created) the
wp-content/languages folder and
/plugins subfolder inside it, take the language files you duplicated in Step 1 and place them in the
Step 4: Edit away!
Now that the language files are in your WordPress installation, you can modify them to suit your needs. In this case, edit the strings in the language files and save your work.
Are you new to editing language files? Many of us on the The Events Calendar team use POEdit, a free software application that allows you to edit
.po files and convert them into the .mo language file that is read by WordPress.