WordPress Connector Install and Configure
Smartling’s WordPress Connector allows you to integrate Smartling translations into your WordPress site. The Connector uploads new content to Smartling and downloads translations to the appropriate site.
Before you can install the Smartling Connector, you need the following in your WordPress installation:
- WordPress 4.6 or higher
- Multisite mode enabled
- Multilingual Press free plugin installed
- PHP Version 5.5 or higher
- PHP extensions
- For WP Enging hosting maximum execution time is set to 300 seconds
- Smartling Connector write access for the following folders:
- smartling-connector logs directory (
- system temp
- wordpress uploads and all subfolders (
- smartling-connector logs directory (
In Smartling, you will need a project of the CMS Connectors type.
Configure Multilingual Press Plugin
For each translated language, you will need to add a site.
- Go to My Sites > Network Admin > Sites (
- Click Add New to add a new site.
- Enter the details about the source or translated site in the fields in the Add New Site section:
- Site Address (URL): Depending on your WordPress network configuration you can specify a domain or path of your new site. For additional information, see switching network types.
- Site Title: The title of the new site. This can be changed later.
- Site Language: The language for the WordPress Admin UI. This configuration doesn’t affect content that will be managed manually, or by the connector.
- Admin Email: The site will be linked to this user, allowing the user to log in and run the site. You can enter an email for an existing user, or enter a new email address that isn't already on this site. If the email address is new, WordPress will create a new user, and send login instructions to that user.
- On the Multilingual Press section, in the Language box, select the site language. Language is displayed in Smartling widgets, which helps identify target blogs. If you have two language versions (for example, English and French) of the same blog post and they have the same title (for example, Canada blog), the Language value will be appended when the blog posts are displayed (for example, “Canada blog - en-CA” and “Canada blog - fr-CA”).
- In Relationships, do one of the following:
- For your original site only, select the checkbox next to each translated site.
- For translated sites, select the checkbox next to the original site.
- Leave Based on site unselected.
If a site is selected in Based on site, Multilingual Press will clone the original content to the new localized site. Smartling will not build relationships between the original and cloned content, and the connector will duplicate content to the localized site when you upload it to the original one.
- In Search Engine Visibility, select or clear the Discourage search engines from indexing this site box. You may want to select this option for a sandbox site, or one that is not yet launched.
- Click Add Site.
Install Smartling Plugin
- Go to Network Admin > Plugins > Add new
- Type smartling in the Search Plugins box to locate the Smartling plugin.
- Follow the WordPress documentation to install and activate the Smartling plugin.
- The following error messages may be displayed. The last two will be resolved as you continue with configuration. To resolve the Advanced Translator error, click this link in the error text.
- On the Multilingual Press settings page, clear the Advanced Translator box, and then click Save changes.
Configure Smartling Plugin
Before you begin, you will need the following details in order to configure the Smartling plugin:
- User Identifier and Secret Token: See Authentication.
- Project ID and target locales: You can find these while viewing your project in Smartling. Select API from the top menu, and then select the v 1.0 tab. Project Settings > API.
- In WordPress, go to Smartling > Settings (
- Click Add Profile.
- In the Account Info section, set the following fields:
- Profile Name: Enter a descriptive name for the profile.
- Active: Select Active if you want to use this profile right away.
- Project ID: See note at the beginning of this section.
- User Identifier
- Token Secret
- In Source Locale, select the original content site language, and then click Save changes. Saving the changes at this step will allow you to select the target locales from a list of valid locales in a drop-down box in the next step.
- In the Target Locales section, select the checkbox beside each target site language (not the source), and select the corresponding Smartling target language from the drop-downs.
- Click Save Changes to save the profile.
Configure Smartling Plugin - Expert Settings
While creating or editing a profile, you can access an extended set of settings by clicking Show Expert Settings at the bottom of the profile page. Contact Technical Support or your Customer Success Manager before modifying these settings.
Updates to these settings will change how content is handled during the translation process. Please consult before making any changes.
|Field||Options and Explanations|
|Resubmit changed content||Automatically: The Connector resubmits content to Smartling whenever a change in original content is detected.
Manually: You must resubmit original content when it changes.
|Force sync attachment files on upload||Disabled: The connector synchronizes attachments from source to target sites only once when they are submitted the first time. This allows you to add localized images later and the connector will not override these manual changes.
Enabled: Every time attachments are submitted to Smartling they will synchronize from source to target sites. This would work well when you want all images on the target site to be replaced, for example, if all icons have been redesigned. If you resubmit attachments with this option enabled, all target site icons will be overwritten.
|Auto Authorize||Checked (default): Strings are authorized for translation in Smartling automatically.
Cleared: You must go to the Smartling dashboard and authorize strings for translation. When you manually authorize strings, authorize only for the locales list set up for submitting with the connector. Languages that are not on the locales list will not be tracked or retrieved.
|Retrieval Type||Pseudo: Smartling can provide pseudo translations, which is the original strings with extra characters added to increase the length by 30 percent (default). This emulates the increase in length that can occur when strings are translated, allowing you to test the expanded text before translation is completed.
Published: Only completed translations will be retrieved.
|Download translated files when||Translation Completed: Translations will be downloaded when they reach the Published step in a workflow.
Progress Changes: Translations will be downloaded when the connector finds that a translation in a file has been added or changed
|Publish completed translation||No: Post status is not affected when translations are downloaded.
Yes: Post status is set to Published after download of completed translations.
|Auto synchronize properties on translated page with source||
Disabled: Third-party plugins can add/remove properties for a page (these are stored in the
|Exclude fields by field name||
Fields listed will be excluded when the post is sent to Smartling for translation, and will not appear in the translations returned to WordPress. This is useful for elements that only need to exist on the source page, like post dates, comments, or comment counts.
|Copy fields by field name||
Fields listed here will be copied from the source to the target locale. No translation will take place. The translated content will be the same as the source content.
|Copy by field value||
Fields that match the regular expressions listed here will be copied from the source to the target locale. No translation will take place. The translated content will be the same as the source content. This allows you to capture multiple fields using expressions instead of entering every field name in the Copy fields by field name box.
|SEO fields by field name||Field names listed here will be flagged as SEO (search engine optimization) terms in Smartling, identifying them with a special translation key so they can be translated appropriately.|
Configure WP Cron
The WordPress Connector uses WP-Cron to run regular tasks. See here for further information about hooking WP-Cron into the system task scheduler.
- Ensure that the domain name of your WordPress site is resolved on the server by pinging it when you’re logged in via ssh. for example:
If you get a response like "Could not resolve host: mywordpressinstallation.com", then you will need to add a record to your /etc/hosts file
- To configure a Cron task, edit your crontab (using the appropriate user nginx\ www-data):
sudo -u nginx crontab -e
- Add a line to the end of the file:
*/5 * * * * curl http://mywordpressinstallation.com/wp-cron.php > /dev/null 2>&1
*/5 * * * * wget -O - -q -t 1 http://mywordpressinstallation.com/wp-cron.php
This will run WordPress cron every 5 minutes. Remember to leave at least one blank line at the end of the file.
- Edit your wp-config.php file and add the following line: