Page 1 of 1

Rename existing default actions in framework

Posted: Tue May 30, 2023 12:34 pm
by NicoAMP
Hello,

In an Oxygen Web Author Framework (.exf), I would like to use some existing actions provided by default, but I would like to rename them.

Code: Select all

<group name="My group" largeIconPath="${framework}/icons/Topicref24.png" smallIconPath="${framework}/icons/Topicref16.png">
          <addAction id="reuse.content"/><!-- to be renamed by "xxx" in menu -->
          <addAction id="DITA/ReuseKeys"/><!-- to be renamed by "yyy" in menu -->
</group>
Is there a way to achieve this?

Thanks.

Re: Rename existing default actions in framework

Posted: Tue May 30, 2023 4:25 pm
by mihaela
Hello,

You can try to add a translation file in your framework, where to add new translations for the two actions tags:
https://www.oxygenxml.com/doc/versions/ ... works.html
Please let us know if this solution is not suitable for your use case.

Best Regards,
Mihaela

Re: Rename existing default actions in framework

Posted: Fri Jun 02, 2023 10:07 am
by NicoAMP
Hello,

I use a translation file and it works fine for reuse.content action.

Code: Select all

<key type="action" value="reuse.content">      
      <val lang="en_US">xxx</val>      
      <val lang="de_DE">xxx</val>      
      <val lang="fr_FR">xxx</val>      
      <val lang="ja_JP">xxx</val>      
      <val lang="nl_NL">xxx</val>      
      <val lang="zh_CN">xxx</val>      
   </key>
But it doesn't work for DITA/ReuseKeys

Code: Select all

<key type="action" value="DITA/ReuseKeys">      
      <val lang="en_US">yyy</val>      
      <val lang="de_DE">yyy</val>      
      <val lang="fr_FR">yyy</val>      
      <val lang="ja_JP">yyy</val>      
      <val lang="nl_NL">yyy</val>      
      <val lang="zh_CN">yyy</val>      
   </key>
I found no entry for DITA/ReuseKeys action in the translation.xml file of the original DITA framework.
Thanks for your help.

Re: Rename existing default actions in framework

Posted: Mon Jun 05, 2023 7:15 am
by mihaela
Hello,

For DITA/ReuseKeys action there are two translations, one for the action name and one for the description.
Here are the values that you have to use for the two keys: DITA_KEYS_ and DITA_KEYS_DESCRIPTION_.

Best Regards,
Mihaela

Re: Rename existing default actions in framework

Posted: Mon Jun 05, 2023 5:06 pm
by NicoAMP
Hello,
I tried like that :

Code: Select all

<key type="action" value="DITA_KEYS_">     
      <val lang="en_US">yyy</val>      
      <val lang="de_DE">yyy</val>      
      <val lang="fr_FR">yyy</val>      
      <val lang="ja_JP">yyy</val>      
      <val lang="nl_NL">yyy</val>      
      <val lang="zh_CN">yyy</val>      
   </key>

   <key type="action" value="DITA_KEYS_DESCRIPTION_">     
      <val lang="en_US">yyy</val>      
      <val lang="de_DE">yyy</val>      
      <val lang="fr_FR">yyy</val>      
      <val lang="ja_JP">yyy</val>      
      <val lang="nl_NL">yyy</val>      
      <val lang="zh_CN">yyy</val>      
   </key>
But it's not translated in my menu entry :
image.png
Regards,
Nicolas

Re: Rename existing default actions in framework

Posted: Tue Jun 06, 2023 11:18 am
by mihaela
Hello,

I have checked again and the translations for DITA keys action are included in the general translation of the Web Author UI, so you will be able to replace them by using the following javascript API:
https://www.oxygenxml.com/maven/com/oxy ... ation.html
You can use this code inside a plugin. See more details here:
https://www.oxygenxml.com/maven/com/oxy ... 0.0/jsdoc/

Best Regards,
Mihaela

Re: Rename existing default actions in framework

Posted: Mon Jun 12, 2023 3:48 pm
by NicoAMP
It works fine.
Thanks Mihaela for your help.
Regards,
Nicolas

Re: Rename existing default actions in framework

Posted: Tue Jun 13, 2023 8:06 am
by mihaela
Hello,

Great! We are glad that you managed to add the translations.

Best Regards,
Mihaela