Expand my Community achievements bar.

Don’t miss the AEM Skill Exchange in SF on Nov 14—hear from industry leaders, learn best practices, and enhance your AEM strategy with practical tips.
SOLVED

Project specific translation_rules.xml

Avatar

Level 4

Hello Everyone!

We have multiple sites running in the same instance. Each site has several custom components and they are totally different in nature. Instead of going and adding each component in Translation Configuration UI, is it possible to have a translation_rules.xml file for a specific site? If so, is it possible to manage the translation_rules.xml file through the maven project that way rules will be applied/available as soon as we build and deploy the specific maven project?

Based on what I read in different articles looks like the translation_rules.xml file resides in the below locations but haven't found any article that talks about a project-specific translation_rules.xml file.

  • /libs/settings/translation/rules/translation_rules.xml
  • /apps/settings/translation/rules/translation_rules.xml
  • /conf/global/settings/translation/rules/translation_rules.xml

Open to any other suggestions as well.

Thank you!

1 Accepted Solution

Avatar

Correct answer by
Level 6

@webdev91 

I am not sure if AEM or maven has any straight forward solution to this issue. 

One probable solution I can think of is You can create a one more maven project dedicated for translation rules file and all teams utilize it for their respective changes and remove translation rules file from all other projects.

View solution in original post

3 Replies

Avatar

Level 6

Hi @webdev91 

You can not have multiple translation_rules.xml files. There is only one translation_rules.xml file per aem instance. You can create different contexts under this file for your each site like below I have created for wknd site. You can add components specific to that site under this context.

salamswapnil_0-1687854720333.png

salamswapnil_1-1687855279281.png

Node in xml will look like this.

 

<?xml version="1.0" encoding="UTF-8"?><nodelist>
    <node path="/content/wknd">
        <node resourceType="wknd/components/accordion">
          <property inherit="true" name="xyz" translate="true" updateDestinationLanguage="false"/>
        </node>
    </node>
</nodelist>

 

To make translation_rules.xml as part of your maven build, you need to put it under /conf/global/settings/translation/rules.

 

Thanks

Swapnil

Avatar

Level 4

Hi @salamswapnil

Thank you for the clarification.

The problem is we have separate Maven projects for each site so I believe keeping a translation_rules.xml file in sync across the Maven projects will be challenging. Any suggestions in this scenario?

Avatar

Correct answer by
Level 6

@webdev91 

I am not sure if AEM or maven has any straight forward solution to this issue. 

One probable solution I can think of is You can create a one more maven project dedicated for translation rules file and all teams utilize it for their respective changes and remove translation rules file from all other projects.