Learn how to define translation rules to identify content for translation.
In the previous document of the AEM headless translation journey, Configure translation connector you learned how to install and configure your translation connector and should now:
Now that your connector is set up, this article takes you through the next step of identifying what content you need to translate.
This step of the documentation journey is only necessary if you are not using the Translatable flag on Content Fragments.
This document helps you understand how to use AEM’s translation rules to identify your translation content. After reading this document you should:
Content Fragments, which represent your headless content, can contain much information organized by structured fields. Depending on your project needs, it is likely that not all of the fields within a Content Fragment must to be translated.
Translation rules identify the content that is included in, or excluded from, translation projects. When content is translated, AEM extracts or harvests the content based on these rules. In this way only content that must be translated is sent to the translation service.
Translation rules include the following information:
Because Content Fragment Models, which define the structure of your Content Fragments, are unique to your own project, it is vital to set up translation rules so AEM knows what elements of your content models to translate.
Generally the content architect provides the translation specialist with the Property Names of all of the fields needed for translation. These names are needed to configure translation rules. As the translation specialist, you can find these Property Names yourself as previously described in this journey.
Multiple rules can be created to support complex translation requirements. For example, one project you may be working on requires all fields of the model to be translated, but on another only description fields must be translated while titles are left untranslated.
Translation rules are designed to handle such scenarios. However in this example we illustrate how to create rules by focusing on a simple, single configuration.
There is a Translation Configuration console available for configuring translation rules. To access it:
In the Translation Configuration UI, there are a number of options available for your translation rules. Here we highlight the most necessary and typical steps required for a basic headless localization configuration.
/content/dam/<your-project>
./content/dam
. Uncheck the option Inherit from /content/dam
in order to add additional fields to the configuration.You have now configured your translation rules.
There are a number of additional properties that can be configured as part of your translation rules. In addition, you can specify your rules by hand as XML, which allows for more specificity and flexibility.
Such features are generally not needed to get started localizing your headless content, but you can read about them further in the Additional Resources section if you are interested.
Now that you have completed this part of the headless translation journey you should:
Build on this knowledge and continue your AEM headless translation journey by next reviewing the document Translate content where you will learn how your connector and rules work together to translate headless content.
While it is recommended that you move on to the next part of the headless translation journey by reviewing the document Translate content, the following are some additional, optional resources that do a deeper dive on some concepts mentioned in this document, but they are not required to continue on the headless journey.