Give is fully localized and “translation ready”. Our available languages is growing continually, but you might find the need to provide your own localized language for your website. This article gives you an overview of how to do that.
How Translations in Plugins Happen
Language translation sounds like a very daunting challenge for WordPress plugins. But in the end, it’s relatively straight forward. Give is built in U.S. English and comes with a “.po” file that lists all of the strings of text used throughout the entire plugin.
WordPress now ships all translations to users as updates, the same way you get plugin or theme updates from WordPress.org. This is through a platform WordPress developed called Glotpress. That whole system is now hosted on WordPress.org and manages all plugin translations, including for Give. This enables people from all over the world to contribute to plugin translations and then to have those translations shipped to everyone using that plugin in that given language.
Here is where the Give translations happen. These translations are only shipped to users who have that language installed on their WordPress website. Further, translations are only shipped once they have reached 95% complete for the stable version of the plugin.
Contributing your local language for Give is relatively easy. On the Give translation page, search for your local language and click on the title. From there click on “Stable (latest release)”. You’ll then see a long table showing all the language strings available for translating.
From there you can double-click on the cell to the right of any language string and add your translation.
The Translation team for that language will review your translations. If they are approved and the translation reaches 95% or more, then it will become available for all users of that language to benefit from.
There are times when you want to do your translation locally first. You might want to translate the plugin for your website in order to confirm that it communicates well both on the Admin and front-end. Another reason you might want to translate locally is because our Add-ons are not hosted on WordPress.org and you may need their strings translated as well.
For translating locally we highly recommend using PoEdit. WordPress.org has a very handy guide to creating plugin translations with PoEdit. Review that here, and then continue below with how to incorporate your translation into your website.
Implementing your Give Translation into your Website
Now that you have your translated files, you’ll need to upload them to your website. Here’s the steps:
Change the file name of your PO and MO files
In order for Give to recognize your file as a valid localized language to be used on the site, it has to have a very specific file name. After you’ve saved your PO and MO files from PoEdit, you need to change the file name like the following (using standard German as an example):
So the structure is “[give] hyphen [language code].file extension”. Here is a list of available language codes.
If you are translating a Give Add-on, the name of the file must be the textdomain of that Addon. For example, our Give Stripe Add-on’s text domain is “give-stripe”. You can find the textdomain of each of our Addons at the top of the readme.txt file. So, the Give Stripe PO and MO files should be called:
Implement your Translation on your Website
Now that you have your translation done, and the file names are correct, the last step is to upload them to your website.
- Login via (S)FTP, and then navigate to the “/wp-content” folder.
- Add a new folder there called “languages”
- Inside the “languages” folder, add another folder called “give”
- Upload both the PO and MO files there.
- You’re done!
If you are uploading a translation for an Add-on, the folder name (using Stripe as an example again) would instead be “/wp-content/languages/give-stripe”.
Interested in Joining our Translations Team?
We are assembling reliable translators from all over to world to help translate Give into as many languages as possible. There are benefits and responsibilities to being on this team. If you are interested, please email us at email@example.com.