[SOLVED] Language Dialects - Content Dimensons Settings

Hi guys,

I’ve a question about dialects for a language.
My case, I have “German”, “German_Austria” and “German_Swiss” as well as english and french.

90% of the pages are “German”, but some do have Country specific variations. Say they have a different currency or VAT and therefore the content/text on a page is a bit different from the main German version.

So I made the following configuration

  ContentRepository:
contentDimensions:
  'language':
    label: 'Language'
    icon: 'icon-language'
    default: 'de'
    defaultPreset: 'de'
    presets:
      'de':
        label: 'Deutsch'
        values: ['de']
        uriSegment: 'de'
      'en':
        label: 'English'
        values: ['en']
        uriSegment: 'en'
        constraints:
          country:
            '*': false
      'fr':
        label: 'French'
        values: ['fr']
        uriSegment: 'fr'
        constraints:
          country:
            '*': false

  'country':
    default: 'de'
    defaultPreset: 'de'
    label: 'Country'
    icon: 'icon-globe'
    presets:
      'de':
        label: 'Deutschland'
        values: ['de']
        uriSegment: ''
      'at':
        label: 'Östereich'
        values: ['at']
        uriSegment: 'at'
      'ch':
        label: 'Schweitz'
        values: ['ch']
        uriSegment: 'ch'

So what I’m trying to achieve is that I get the following dimension URLs:

German (default): www.my-domain.tld/de/meine-seite.html
German Austria: www.my-domain.tld/de_at/meine-seite.html
German Swiss: www.my-domain.tld/de_ch/meine-seite.html
English: www.my-domain.tld/en/my-page.html
French: www.my-domain.tld/fr/ma-page.html

Is this currently possible or do I have to add to each language a country dimension?

Thank you!

You could rename the country de to global and allow en and fr only the global country.

1 Like

You made my day! Thanks a lot.

If someone else is interested in the solution:

Settings.yaml

  ContentRepository:
contentDimensions:
  'language':
    label: 'Language'
    icon: 'icon-language'
    default: 'de'
    defaultPreset: 'de'
    presets:
      'de':
        label: 'Deutsch'
        values: ['de']
        uriSegment: 'de'
      'en':
        label: 'English'
        values: ['en']
        uriSegment: 'en'
        constraints:
          country:
            'global': true
            '*': false
      'fr':
        label: 'French'
        values: ['fr']
        uriSegment: 'fr'
        constraints:
          country:
            'global': true
            '*': false

  'country':
    default: 'global'
    defaultPreset: 'global'
    label: 'Country'
    icon: 'icon-globe'
    presets:
      'global':
        label: 'Global'
        values: ['global']
        uriSegment: ''
      'at':
        label: 'Östereich'
        values: ['at','global']
        uriSegment: 'at'
      'ch':
        label: 'Schweiz'
        values: ['ch','global']
        uriSegment: 'ch'

Keep in mind that you have to run the ./flow node:migrate 20150716212459 in order to update your nodes.
Also important, if you change your configuration e.g. for country the won’t get updated a second time.

1 Like

I’m glad I could help. :smiley: