WPTouch is a popular WordPress plugin that allows you to display your site’s content on mobile devices. It can send mobile-optimized content, pictures, scripts, and CSS code instead of ‘normal’ ones. This speeds things up considerably. It also allows your iOS visitors to save your website like an app.
WPTouch works great with WPML. In this tutorial, we will explain how to translate text that comes with WPTouch themes and extensions.
What You Will Need:
- A recent version of WPML, including the String Translation and Translation Management add-ons
- The WPTouch plugin
- One of WPtouch’s extensions (We use the Mobilestore theme in this tutorial)
- WPML’s Getting Started Guide will help you in setting up WPML in only a few minutes. You will want to refer to some of its subtopics later, such as Theme and Plugin Localization and String Translation. We recommend you keep the Getting Started Guide open while following this tutorial.
- WP Touch documentation has an excellent collection of tutorials that can help you get started.
Translating Strings Coming from WPTouch Themes and Extensions
WPTouch allows one-click downloading and installation of additional themes and extensions. The extensions are saved in wp-content/wptouch-data. As you can see, this path is outside the default plugin directory. WPML String Translation scans everything inside the themes directory (wp-content/themes) and the plugins directory (wp-content/plugins). We will create and import .po files into the String Translation table so you can translate these strings with WPML.
First, make sure you enabled theme and plugins localization in WPML, You can do that by going to WPML > Theme and plugin localization, then choosing “Translate the theme and plugins using WPML’s String Translation.”
The Mobilestore theme, which is a WPTouch extension, does not come with a .po file, so we must create one.
Obtain zipped theme files from your site after it is downloaded using the WPTouch installer. This can be done by following these steps:
The second step is to create our .po file:
Once you have the wptouch-pro.po file, upload it to your site using the WPML String Translation screen. Remember to assign the correct context for imported strings (if the wptouch-pro context is missing, create a new context with that name).
After the upload is finished, you will be redirected to the string selection screen. Select all the strings you want to translate, then click on “Add selected strings.”
After importing the strings, registered strings which are ready to be translated can be found on the WPML >> String Translation screen. Note that you can find all the strings under the wptouch-pro domain.
Creating .po files and importing them into WPML String Translation tables will register the strings to be translated on the string translation screen. This can only be done when the installed plugin, theme or extension has its own directory (not under the default directory).
Read more here:: How to Translate Strings Coming from WPTouch Themes and Extensions