Translating Your App
You can translate your app by providing a translation file and creating a language settings page. You can also integrate with the WPML plugin to translate WordPress content.
1. First, download our sample translation files* and add your translations.
In this package you'll find json files such as es.json, and de.json. https://github.com/apppresser/i18n
For example:
{ "Language Name": "Deustch", "Logout": "Ausloggen", "Back": "Zurück", etc... }
The word on the left is the word in the app that needs to be translated, the word on the right is the native translation. Any word that you need translated has to be in this file, and the file must be named by it's two letter language code, such as en.json, es.json, de.json, etc.
You must include "Language Name" in any translation file.
Find all the translation strings in the en.json file, you can duplicate that file and change it for any language. You must also add any words from your menus and custom page titles. For example, if you have a menu item titled "My Profile," add that string to each translation file.
You must include "dir" Language direction in any translation file
For Left to Right languages like English, use "ltr". If the language needs to change direction to rtl (Right to Left), then you need to add the dir parameter "rtl" to the language file.
For example:
{ "Language Name": "العربية", "dir": "rtl", "Language Settings": "مقدمة", "Intro": "مقدمة", "Login": "مقدمة", etc... }
2. Next, zip the contents of the i18n folder with your JSON translation files inside, and upload it under translation files.
When you are finished editing the files, you need to zip them.
Select only the files, not the folder, and compress into a zip file.
Rename the file i18n.zip.
Upload this zip file in your app customizer Settings tab, under Translation Files.
Save, then refresh the page. You should then see the default languages menu populated. If not, you may need to try Clearing your App Preview Cache
3. Create Custom Page with a language setting block (See: Language and Push Settings)
This is the page you can add to your app that gives your users a way to select what language they want to use. If you only want to use a single language you can skip this step and use the default language option instead
4. Set a Default Language
If you prefer to set a default language other than English you can set this on the Customizer under the settings tab. You will need to upload your i18n.zip first and then rebuild your app. Then you will need to refresh the page for the customizer to scan your app's i18n folder in order to populate the dropdown.
Translate WordPress Content With WPML
The translation files you included above only handle text strings in the app itself, not on your WordPress site. To translate WordPress content, you can use the WPML plugin.
Please note: we do not provide technical support for WPML, please contact the plugin authors for translation support.
This plugin is very popular for translating WordPress, and costs as little as $29.
Once you configure WPML and add your translations, your app will automatically load translated WordPress pages and posts based on your language settings page. API list pages are also translated. No special setup is required, but you should make sure you have done the following:
WPML Settings
In our testing, we found the following settings are required:
- Language url format has to be "Language name added as a parameter (http://mysite.com?lang=de - German)" Note: some customers see issues with this setting, and choose "Different languages in directories" instead.
- Add these to "Preserve URL arguments" - appp,list_type,num You must also add any custom parameters you are using for WordPress list pages, such as category, author, etc.
- Disable browser language redirect (checked)
WordPress App List Page
If you are using the App List page, go to the page editor and select these check boxes and click "duplicate"
All WordPress content needs to be manually translated with the WPML plugin, and certain things like custom post types and custom fields require extra setup. Please consult WPML for help, we do not provide technical support for translating your WordPress site.
Common Translation Source Questions
It can be confusing at first to understand what text is translated by the translation files and which is translated by the WPML integration. Here's a reference table to help clarify that:
App Text | Translation Source | |
Side, Tab & Auxilary Menus | Translation Files | |
Custom Page Text Created in MyAppPresser | Translation Files | |
WordPress API List Content | WPML | |
WordPress iFrame Pages | WPML |
|
Welcome Back %user% message | WPML | |
Native Modals, Screens & Pop up Messages | Translation Files | |
Translation Issues
If there are any issues with either the translations or selecting a default language, in most scenarios, it will be caused by an error in the JSON file. In order to check that your file does not have any errors, upload it to a JSON Validator, such as https://jsonlint.com/ and if there are any errors, fix them then upload to My AppPresser again.