Drupal 8 TMGMT Installation and Setup
Drupal 8 users can use Drupal's Translation Management Tool (TMGMT) Module to manage translations within Drupal.
By installing the tmgmt_smartling module, you can use Smartling as a translation provider in TMGMT.
Install the TMGMT Smartling Module
To use the TMGMT Smartling module, you first need to install the TMGMT module and all of its dependencies.
- Go to the TMGMT Translator Smartling page and make sure to download the latest release of the 8.x-3.x branch. You'll be given the option to download a
tar.gzfile or a .zip file. Make sure you download the
- Select Extend and click +Install new module.
- Enter the file
tar.gzURL or upload it and click Install.
- You'll now need to install all of the dependencies for the Smartling Translator. To do this, repeat steps 2 and 3 for each of the following: TMGMT (latest release of 8.x-1.x branch) and TMGMT Extension Suite (latest release of 8.x-1.x branch).
- Once you've installed the new module and all of its dependencies, scroll down to Translation Management and enable the following modules:
- Config Entity Source:
- Content Entity Source:
- Config Entity Source:
Set Up the TMGMT Smartling Module
- Select the Providers tab and click + Add provider.
- In the Label field, enter the name for the translator. For example, Smartling Translator.
- Check Auto accept finished translations if you want to automatically publish translations returned from Smartling. (If you do not check this box, you will need to review translations in Drupal before they are published on your translated sites.)
- From the Provider plugin drop down, select Smartling translator.
- You should now see the Smartling Translator Plugin Settings shown here:
- In the Smartling Translator Plugin Settings, enter info for the following fields:
- Project ID: The project ID for the Smartling project you are using for your Drupal translations.
- User ID: User's unique identifier for Smartling API.
- Token Secret: User's secret token for Smartling API.
The Project ID, Key can be found within your Smartling project. The user ID and token secret are issued when the API key is generated in the Smartling account. Go to Smartling > Projects > Project Settings > API.
- Username for context retrieval: To get context for your translations, the Connector impersonates a Drupal user. Different users may have different permissions that enable them to see different components of a page. Keep this in mind when you choose a user for context. Example: admin.
- The desired format for download: Select the type of translations you want returned. You can either return only translations that are published or pre-published in Smartling, or return any saved translation even if they are not published (for example if the translation is currently in an editing step). For testing, you can choose to return a modified version of the original text with extra characters, so you can check that your layout can handle a translation that takes up more space than the original text.
- Automatically authorize content for translation in Smartling: If checked, when you submit translations, content will automatically be authorized instead of being added to your Awaiting Authorization queue.
- Use Smartling callback: You can have Smartling send a callback to your Drupal instance to download translated items as soon as they become available, rather than waiting for the scheduled download process to pick them up. For this to work, your instance must be publicly addressable.
- Download method: A list of available locations where exported files can be stored. The usage of a protected location (e.g. private://) is recommended to prevent unauthorized access.
- Custom placeholder (regular expression): The content matching this regular expression will not be editable by translators in Smartling.
- File type: The file type format that is used to upload/download from Smartling. XML file format is recommended.
- Enable basic auth for context: Enable this option if you have basic auth set up on your web server. It’s needed for context feature and useful when content is submitted from dev/stage site instances that are secured by basic auth.
In Remote Languages Mapping: Once you have set up your languages in the TMGMT Module, you will see an entry for each language here.
Enter the corresponding Smartling locale code set up in your project. For example, de-DE for German (Germany) and click Save. (The language must be set up in your Smartling Project. To retrieve the locale codes in your Smartling Project, go to Smartling > Projects > Project Settings > API > Languages.)
- Once you've saved the new provider, scroll to the top of your page and return to Providers.
- If the Smartling translator doesn't appear as the first entry in the list, click and drag it to the top of the list to make it your default provider. Click Save.