How to add localization?

How to make improvements to the file so that localization into several languages ​​is possible



As in the first screenshot, so that there are several languages

my yaml

**definitions:
  config:
    /hippo:namespaces/main/SpecialOff:
      jcr:primaryType: hipposysedit:templatetype
      jcr:mixinTypes: [ 'editor:editable', 'mix:referenceable' ]
      jcr:uuid: fb7ad149-93e5-42d0-a7d2-c1d088bfbaf5
      /hipposysedit:nodetype:
        jcr:primaryType: hippo:handle
        jcr:mixinTypes: [ 'mix:referenceable' ]
        jcr:uuid: a681e025-8eee-455c-9965-eeab8c19e60c
        /hipposysedit:nodetype:
          jcr:primaryType: hipposysedit:nodetype
          jcr:mixinTypes: [ 'hipposysedit:remodel', 'mix:referenceable' ]
          jcr:uuid: 59a88b22-300b-49f3-b2f7-5183fde2c157
          hipposysedit:node: true
          hipposysedit:supertype: [ 'main:basedocument', 'hippostd:relaxed', 'hippotranslation:translated' ]
          hipposysedit:uri: http://www.onehippo.org/main/nt/1.0
          /offer_name:
            jcr:primaryType: hipposysedit:field
            hipposysedit:mandatory: false
            hipposysedit:multiple: false
            hipposysedit:ordered: false
            hipposysedit:path: main:offer_name
            hipposysedit:primary: false
            hipposysedit:type: String
            hipposysedit:validators: [ non-empty, required ]
          /offer_rules:
            jcr:primaryType: hipposysedit:field
            hipposysedit:mandatory: false
            hipposysedit:multiple: false
            hipposysedit:ordered: false
            hipposysedit:path: main:offer_rules
            hipposysedit:primary: false
            hipposysedit:type: String
            hipposysedit:validators: [ non-empty, required ]
          /offer_price:
            jcr:primaryType: hipposysedit:field
            hipposysedit:mandatory: false
            hipposysedit:multiple: false
            hipposysedit:ordered: false
            hipposysedit:path: main:offer_price
            hipposysedit:primary: false
            hipposysedit:type: Double
            hipposysedit:validators: [ required ]
          /offer_currency:
            jcr:primaryType: hipposysedit:field
            hipposysedit:mandatory: false
            hipposysedit:multiple: false
            hipposysedit:ordered: false
            hipposysedit:path: main:offer_currency
            hipposysedit:primary: false
            hipposysedit:type: String
            hipposysedit:validators: [ non-empty, required ]
          /offer_discount:
            jcr:primaryType: hipposysedit:field
            hipposysedit:mandatory: false
            hipposysedit:multiple: false
            hipposysedit:ordered: false
            hipposysedit:path: main:offer_discount
            hipposysedit:primary: false
            hipposysedit:type: String
          /offer_emoji:
            jcr:primaryType: hipposysedit:field
            hipposysedit:mandatory: false
            hipposysedit:multiple: false
            hipposysedit:ordered: false
            hipposysedit:path: main:offer_emoji
            hipposysedit:primary: false
            hipposysedit:type: String
          /offersck:
            jcr:primaryType: hipposysedit:field
            hipposysedit:mandatory: false
            hipposysedit:multiple: true
            hipposysedit:ordered: false
            hipposysedit:path: main:offersck
            hipposysedit:primary: false
            hipposysedit:type: String
      /hipposysedit:prototypes:
        jcr:primaryType: hipposysedit:prototypeset
        /hipposysedit:prototype:
          jcr:primaryType: main:SpecialOff
          jcr:mixinTypes: [ 'mix:referenceable' ]
          jcr:uuid: 725db767-2ae6-40f6-bc0c-8dfd468b47d3
          hippostd:holder: holder
          hippostd:state: draft
          hippostdpubwf:createdBy: ''
          hippostdpubwf:creationDate: 2022-01-26T17:24:28.257+07:00
          hippostdpubwf:lastModificationDate: 2022-01-26T17:24:28.257+07:00
          hippostdpubwf:lastModifiedBy: ''
          hippotranslation:id: document-type-locale-id
          hippotranslation:locale: document-type-locale
          main:offer_currency: ''
          main:offer_discount: ''
          main:offer_emoji: ''
          main:offer_name: ''
          main:offer_price: 0.0
          main:offer_rules: ''
          main:offersck: [ '' ]
      /editor:templates:
        jcr:primaryType: editor:templateset
        /_default_:
          jcr:primaryType: frontend:plugincluster
          frontend:properties: [ mode ]
          frontend:references: [ wicket.model, model.compareTo, engine, validator.id ]
          frontend:services: [ wicket.id, validator.id ]
          /root:
            jcr:primaryType: frontend:plugin
            item: ${cluster.id}.field
            plugin.class: org.hippoecm.frontend.service.render.ListViewPlugin
          /offer_name:
            jcr:primaryType: frontend:plugin
            caption: Название тарифа
            field: offer_name
            plugin.class: org.hippoecm.frontend.editor.plugins.field.PropertyFieldPlugin
            wicket.id: ${cluster.id}.field
            /cluster.options:
              jcr:primaryType: frontend:pluginconfig
          /offer_rules:
            jcr:primaryType: frontend:plugin
            caption: Условия тарифа
            field: offer_rules
            plugin.class: org.hippoecm.frontend.editor.plugins.field.PropertyFieldPlugin
            wicket.id: ${cluster.id}.field
            /cluster.options:
              jcr:primaryType: frontend:pluginconfig
          /offer_price:
            jcr:primaryType: frontend:plugin
            caption: Стоимость тарифа
            field: offer_price
            plugin.class: org.hippoecm.frontend.editor.plugins.field.PropertyFieldPlugin
            wicket.id: ${cluster.id}.field
            /cluster.options:
              jcr:primaryType: frontend:pluginconfig
          /offer_currency:
            jcr:primaryType: frontend:plugin
            caption: Валюта тарифа
            field: offer_currency
            plugin.class: org.hippoecm.frontend.editor.plugins.field.PropertyFieldPlugin
            wicket.id: ${cluster.id}.field
            /cluster.options:
              jcr:primaryType: frontend:pluginconfig
          /offer_discount:
            jcr:primaryType: frontend:plugin
            caption: Скидка на тарифе, %
            field: offer_discount
            hint: ''
            plugin.class: org.hippoecm.frontend.editor.plugins.field.PropertyFieldPlugin
            wicket.id: ${cluster.id}.field
            /cluster.options:
              jcr:primaryType: frontend:pluginconfig
          /offer_emoji:
            jcr:primaryType: frontend:plugin
            caption: Эмодзи
            field: offer_emoji
            hint: ''
            plugin.class: org.hippoecm.frontend.editor.plugins.field.PropertyFieldPlugin
            wicket.id: ${cluster.id}.field
            /cluster.options:
              jcr:primaryType: frontend:pluginconfig
          /offersck:
            jcr:primaryType: frontend:plugin
            caption: SOCK тарифа
            field: offersck
            hint: ''
            plugin.class: org.hippoecm.frontend.editor.plugins.field.PropertyFieldPlugin
            wicket.id: ${cluster.id}.field
            /cluster.options:
              jcr:primaryType: frontend:pluginconfig**

I added the argument hippotranslation:translated but it doesn’t help

Hi,
Indeed the document type should have mixin hippotranslation:translated but usually this is already set up in your .cnd file with the document types. If not, add that below /hippo:namespaces/ in yaml.

Then, you’ll need a folder structure with a different locale that is linked to your default (English?) one, starting with the root folder. The page here
may help you out!

Regards, Jeroen

in my cdn the parameters are indicated like this? should be here too hippotranslation:translated?

[main: SpecialOff] > hippostd:relaxed, mainsite:basedocument
orderable

That depends on how mainsite:basedocument is defined, if that already has hippotranslation:translated you’re good to go.

If not, I think that adding the mixin in the cnd to existing types will lead to problems on deployment to existing repositories, e.g. your staging/prod envs. Better double check that locally, deploying such change on existing local storage. Use -Drepo.path to specify that local storage directory.

Otherwise, revert to yaml, then also write a Groovy script to add the mixin to existing document instances.