The following article will walk you through the steps to installing and configuring AEM Cloud with Smartling. Before proceeding with AEM Cloud installation, please read the following and linked additional resources.
Please note that this Connector is a paid product. For pricing information, please reach out to your Smartling Customer Success Manager.
Background
Adobe separated “code” and “content” for AEM Cloud. The “code” part of the repository is immutable and can only be changed with Pipeline build. The connector package contains both “code” and “content” data, it cannot be installed via CRX DE Package Manager anymore. To install the Smartling AEM Cloud Connector, you need to add a repository where the connector is and should depend on them and embed in the package.
Adobe suggested ISV Partners to submit a connector to the public Maven repository. Therefore, it is recommended to embed the connector as a part of AEM customization project.
Installation (Required)
Steps for embedding connector to a customization project
1. Copy and paste the following to main POM.xml (i.e. the public Maven repository where connector package is resided)
<repository>
<id>central</id>
<name>Central Repository</name>
<url>https://repo.maven.apache.org/maven2</url>
<layout>default</layout>
<snapshots>
<enabled>false</enabled>
</snapshots>
</repository>
2. Check all dependencies. Add the following dependency to the connector package in main POM
<dependency>
<groupId>com.smartling.aem</groupId>
<artifactId>com.smartling.aem.connector</artifactId>
<version>5.9.22</version>
<type>zip</type>
</dependency>
3. Add dependency to the connector package in All project’s POM
<dependency>
<groupId>com.smartling.aem</groupId>
<artifactId>com.smartling.aem.connector</artifactId>
<type>zip</type>
</dependency>
4. The Smartling AEM Cloud should be embedded. Add the connector package as embedded dependency to All package (the following listing is an example)
<plugin>
<groupId>org.apache.jackrabbit</groupId>
<artifactId>filevault-package-maven-plugin</artifactId>
<extensions>true</extensions>
<configuration>
<group>com.adobe.aem.guides</group>
<allowIndexDefinitions>true</allowIndexDefinitions>
<embeddeds>
<embedded>
<groupId>com.adobe.aem.guides</groupId>
<artifactId>aem-guides-wknd.ui.apps</artifactId>
<type>zip</type>
<target>/apps/wknd-packages/application/install</target>
</embedded>
<embedded>
<groupId>com.adobe.aem.guides</groupId>
<artifactId>aem-guides-wknd.ui.content</artifactId>
<type>zip</type>
<target>/apps/wknd-packages/content/install</target>
</embedded>
<embedded>
<groupId>com.adobe.aem.guides</groupId>
<artifactId>aem-guides-wknd.ui.content.sample</artifactId>
<type>zip</type>
<target>/apps/wknd-packages/content/install</target>
</embedded>
<embedded>
<groupId>com.smartling.aem</groupId>
<artifactId>com.smartling.aem.connector</artifactId>
<type>zip</type>
<target>/apps/smartling-vendor-packages/application/install</target>
</embedded>
</embeddeds>
</configuration>
</plugin>
5. Add filter for Smartling package
<filter root="/apps/smartling-vendor-packages"/>
Ensure that the `allowIndexDefinitions` flag is set to `true` for the configuration.
Note: Maven build will create an “All” package with the Smartling Cloud Connector embedded inside. The Connector will be installed on AEM Cloud with the next AEM Cloud Pipeline Build.
When installing or updating the Smartling package, keep in mind that indexes for the repository may be included. Adding or updating indexes can trigger AEM to re-index, which can take a while. Please plan for this time in your maintenance procedure.
Upgrading the Connector
Please follow these steps after upgrading to a new version of the Connector.
After Connector installation, cache for these UI files should be invalidated:
- /libs/cq/gui/components/authoring/editors/clientlibs/sites/page (js/css)
- /apps/smartling-connector/clientlibs/configuration (js/css)
- /apps/smartling-connector/clientlibs/touch-ui-smartling-job-assets-view (js/css)
- /apps/smartling-connector/clientlibs/touch-ui-smartling-job-xf-view (js/css)
- /apps/smartling-connector/components/language-selector/clientlib (js/css)
Use these tools to clear UI cache:
- Invalidate/Rebuild UI libraries via /libs/granite/ui/content/dumplibs.rebuild.html
- Remove cache for the files in Dispatcher, see info linked here.
- Clear browser's cache
Configuration
Create a Translation Integration Configuration
You can create a new configuration (folder). To do this, open Translation Cloud Services.
Now you can create a configuration folder where you will add two translation configurations.
- Open the new Translation Cloud Services (
/mnt/overlay/cq/translation/gui/content/cloudservices.html
) - Select conf - global and click Create.
- From the dropdown, select Translation Integration Configuration
- Edit the configuration for Sites as follows
- Edit configuration for Assets as follows
To learn more about available options, see the official AEM documentation.
Make sure that the Auto-execute Translation option is enabled for both the Sites and Assets tabs.
Smartling Configuration Editor
The Web Console is not available for users in AEM Cloud. It means you don’t have a UI in AEM for configuring additional options for the connector. However, you can apply OSGi configurations with special XML files. It works for both AEM Standalone and AEM Cloud.
You should create a new AEM locale user for the connector or reuse existing. Content Viewer should have permissions to browse (read) content. These requirements are the same as for Touch Connector. The only difference is deploying configuration to AEM: via UI for Touch Connector, via XML file for Cloud Connector.
Adding multiple source locales to a project
You can only have one Smartling project configuration in AEM. This project has source and target locales that are mapped to the source and target locales of the project in Smartling. Each project in Smartling can have only one source locale.
To translate AEM content in Smartling from multiple source locales, you can add a source locale override to the Smartling project configuration, and map that source locale to the appropriate AEM project in Smartling. This allows you to translate AEM content from multiple source languages, within a single AEM instance.
To add multiple source locales, do the following:
- Create an AEM Connector project in Smartling with the source locale you want to translate from
- Get the API credentials from Account Settings > API v2 > Project Tokens > Create Tokens
- In the Smartling project configuration in AEM, add source locale override (pictured)
- Insert credentials
Add as many source locales overrides as required. Ensure each override is mapped to a Smartling project with the AEM locale as the source locale.
How to configure the connector to narrow the list of target languages
-
Go to
com.smartling.aem.connector.automation.impl.wcm.localization.PageLanguageCopyManagerImpl.cfg.json
OSGi configuration
{
"respect.content.observing.language.roots": true,
"only.sibling.language.roots": true
}
How to configure the connector for context
1. Create a new .xml file, for example;
/apps/<your-app>/config/com.smartling.aem.connector.context.impl.resources.http.HttpResourceLoader.xml
2. Add the following file body:
<?xml version="1.0" encoding="UTF-8"?>
<jcr:root xmlns:sling="http://sling.apache.org/jcr/sling/1.0"
xmlns:jcr="http://www.jcp.org/jcr/1.0" jcr:primaryType="sling:OsgiConfig"
server.url="your-aem-instance-url"
user.name="<your-content-viewer-user-name>"
user.password="<your-content-viewer-user-password>" />
The configuration will be deployed on the next Pipeline Build.
After you have completed all steps above, you can check connector installation and initial configuration on Cloud Services page
Clicking on `Test Connection` icon should check connectivity to Smartling TMS and retrieving a context. A successful connection message will appear.
Troubleshooting Configuration
- When creating a Smartling configuration, make sure that you set the configuration for the page that is the parent to your sites (original and localized).
-
Error: "The Translation Provider Doesn't Support Translation for the Selected Language Pair."
The AEM Cloud Connector is delivered with predefined language mappings between Smartling and AEM language codes. This error means that the AEM site language code does not match a Smartling language code. For example, an AEM site uses the code "fr" for French, but Smartling project uses "fr-FR" for French (France). To correct the problem, update the mapping and restart your job.
AEM site language code:
Incorrect mapping:
Smartling language code:
Correct mapping:
You can adjust language mappings in /apps/granite/translation/connector/config/smartling/languageMapping
. Generally, you should only need to edit this file when you add a new language in AEM.
Automation Configuration
Connector allows you to configure AEM Translation project automatic options. The OSGi configuration can be specified as com.smartling.aem.connector.automation.impl.wcm.project.TranslationProjectResourceManager.cfg.json:
{
"polling.retry.count": 60,
"polling.retry.sleep": 600,
"polling.upload.complete": 30,
"translation.project.enable.approve": true,
"translation.project.enable.delete": true,
"translation.project.enable.promote.launch": true
}
Auto Authorize
Auto Authorization can be used as a default value for the Authorize Job option in the Smartling Dialog. OSGi configuration file is com.smartling.aem.connector.core.impl.integration.SynchronousSmartlingFacade.cfg.json:
{
"auto.authorize": true,
"move.strings": false
}