MemberMouse includes support for localization, and by default loads a US English translation for use with the plugin. It’s possible to translate most text in the MemberMouse backend to the language of your choice using WordPress’ built-in localization feature. This is in addition to being able to create member-facing content in the language of your choice with few exceptions. These are detailed in the second half of this article.
The simplest way to add support for additional languages is to use a localization plugin, which is what will be demonstrated in this article.
We also have created a step-by-step guide to a more advanced method of translation that allows more flexibility for those with custom requirements.
Translate MemberMouse Backend – Basic
Step 1: Get the necessary plugins
- Upgrade MemberMouse – If you haven't already done so, make sure that you have the latest version of MemberMouse activated. You can do this in WordPress following the instructions found in Upgrading MemberMouse, or manually, by downloading the plugin and referring to instructions provided in Manually Upgrading MemberMouse.
- Download Loco Translate – There are several translation plugins available that work with WordPress. We have chosen to use Loco Translate. Download here and activate on your site. A new item ‘Loco Translate' will be created in the lefthand WordPress menu.
Step 2: Create Your Translated File
- From the lefthand menu, click on Loco Translate > Plugins.
- On the next page, select MemberMouse Platform.
- You'll see that Loco Translate is accessing the membermouse-en_US.po file and that the English translation is at 100%. In order to translate to another language, click on +New Language.
- Choose your desired language from the ‘WordPress language' dropdown menu.
- IMPORTANT: By default, Loco Translate will attempt to place the translation file it's created into the MemberMouse plugin directory. It is best to change this to another location because otherwise, when MemberMouse updates, the translation file will be deleted and replaced, along with all the other files in the plugin directory.
The way to resolve this is to choose a Custom location to place the file in. Under the ‘Choose a location' section, select Custom. Your translation file will be put into the directory languages/loco/plugins. NOTE: You need to ensure that you have ‘write' access to this directory.
- Click on the Start Translating button.
- The source text in English is found in the lefthand column and the translated text in your desired language can now be seen in the righthand Translation column.
At this point, if you are satisfied with the translation, you can click ‘Save'. If there is one or many line items that you'd like to customize further, you can also select that line and alter the translation in the ‘Translation' box at the bottom of the page. After you've finished this, click ‘Save'.
- You will see a confirmation message that your translation file has been saved and compiled.
Step 3: Change WordPress Language Settings
In order to see the translation in MemberMouse, the MemberMouse plugin and WordPress have to be ‘speaking' the same language. So once you've created the translation file in your desired second language, then you will also have to change the WordPress Language Settings to that second language.
- In the WordPress menu, go to Settings > General.
- At the bottom of the General Settings page, choose the language that you have created a translation file for from the ‘Site Language' dropdown menu. For example, if you had translated the MemberMouse file to Spanish, you would select ‘Espanol' from the dropdown menu. Then click ‘Save Changes'.
Translate Member-Facing Content
Most of the things that your customers will be interacting with via your website and member portal can be translated as the majority of customer-facing content that MemberMouse creates is simply HTML text that can be modified via the WordPress editor. There are a few instances where items can either not be translated, or require more coding than just changing the HTML in order to translate. Wherever possible we've suggested other methods of translating these elements.
Elements able to be translated with additional coding:
1. Error messages generated by MemberMouse or error messages received from 3rd parties, such as the payment service provider.
If you are technically inclined you can customize this message to appear in another language. The Customize Error Messages on the Checkout Page article provides additional information on how to do this. You'll note in this article that you can translate the 3rd party error messages only if you know the specific error message received from the 3rd party that you want to translate.
2. The product price description. One option would be to use the Order_Decision SmartTag to define alternate descriptions for specific products.
For each product you want to include a translation for, you can add a line directly below the SmartTag™ (or replace the SmartTag™ all together if you include one for each product) using the SmartTag™ to filter the description by ID:
[MM_Order_Decision productId='#'] Your translated product price description here [/MM_Order_Decision]
Another workaround would be to create product-specific custom checkout pages and replace the MM_Form_Data name='productPriceDescription' SmartTag with text in your language describing the pricing for that product. The Create a Custom Checkout Page article provides additional information on how to do this.
3. The payment processing message on the checkout page that displays after a customer has submitted their order. You can customize this message to appear in another language by following the information provided in Customize the Checkout Page Processing Message
Because messages coming from 3rd party vendors, such as payment service providers, are received and then directly output by MemberMouse onto the screen, if you do not know the specific error message from the 3rd party vendor, then this will not be able to be translated.