Uploaded image for project: 'CMS'
  1. CMS
  2. CMS-5208

[Copy and paste pages for translation] : the language of the copied content should be changed

    • Icon: Improvement Improvement
    • Resolution: Duplicate
    • Icon: Major Major
    • 3.8.2
    • 3.5.2
    • None
    • None

        [CMS-5208] [Copy and paste pages for translation] : the language of the copied content should be changed

        Laurence Perier added a comment - CMS-5179

        Laurence Aumeunier added a comment - - edited

        An other solution to use copy page feature in order to translate a site is to be able to change the content language after copy or creation (gallery of languages)

        Sample of code:

        <extension id="org.ametys.cms.content.ChangeLanguage"
                   point="org.ametys.cms.workspace.ribbon.RibbonControlsManager"
                   class="org.ametys.cms.ribbon.button.ActionSelectionMenu">
             <action class="org.ametys.cms.ribbon.button.Menu">
                  <param name="target-type">^content$</param>
                  <param name="language-action">ChangeContentLanguageAction</param>
                  <param name="label" i18n="true">CHANGE_CONTENT_LANGUAGE_MENU_LABEL</param>
                  <param name="default-description" i18n="true">CHANGE_CONTENT_LANGUAGE_MENU_DESCRIPTION</param>
                  <param name="icon-small" file="true">img/languages_16.png</param>
                  <param name="icon-medium" file="true">img/languages_32.png</param>
                  <param name="icon-large" file="true">img/languages_32.png</param>
             </action>                      
             <scripts>
                  <file>js/org/ametys/cms/ribbon/button/Menu.js</file>
                    ....
             </scripts>
        </extension>
        
        ChangeContentLanguageAction: function (button, state, configuration, index)
        {
            var lang = configuration["gallery-" + index];
            ...
        }
        

        Laurence Aumeunier added a comment - - edited An other solution to use copy page feature in order to translate a site is to be able to change the content language after copy or creation (gallery of languages) Sample of code: <extension id= "org.ametys.cms.content.ChangeLanguage" point= "org.ametys.cms.workspace.ribbon.RibbonControlsManager" class= "org.ametys.cms.ribbon.button.ActionSelectionMenu" > <action class= "org.ametys.cms.ribbon.button.Menu" > <param name= "target-type" > ^content$ </param> <param name= "language-action" > ChangeContentLanguageAction </param> <param name= "label" i18n= "true" > CHANGE_CONTENT_LANGUAGE_MENU_LABEL </param> <param name= "default-description" i18n= "true" > CHANGE_CONTENT_LANGUAGE_MENU_DESCRIPTION </param> <param name= "icon-small" file= "true" > img/languages_16.png </param> <param name= "icon-medium" file= "true" > img/languages_32.png </param> <param name= "icon-large" file= "true" > img/languages_32.png </param> </action> <scripts> <file> js/org/ametys/cms/ribbon/button/Menu.js </file> .... </scripts> </extension> ChangeContentLanguageAction: function (button, state, configuration, index) { var lang = configuration[ "gallery-" + index]; ... }

          Unassigned Unassigned
          lperier Laurence Perier
          Votes:
          1 Vote for this issue
          Watchers:
          2 Start watching this issue

            Created:
            Updated:
            Resolved: