dachcom-digital / pimcore-i18n

Pimcore - i18n Manager

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[bug?] Indonesian language (`hreflang="id"`) not showing

ceefour opened this issue Β· comments

First of all thank you for creating this extension! πŸ‘

Q A
Bug report? yes
Feature request? no
BC Break report? no
RFC? no

This is my page:

image

image

image

Setting:

image

However, on both page variants (en and id) the only hreflang links I get is:

<link href="https://pim.lovia.life/en/edu/preschool/in/indonesia" rel="alternate" type="" title="" hreflang="en">

hreflang="id" is never showing, neither is x-default.

(seems like the id document knows about the en one, but the en one is not aware that id exists?)

Pimcore v6.2.0. I18nBundle 3.1.1.

I tried this in app/config/config.yml: (Pimcore's default locale is id)

i18n:

    # set mode (language|country)
    mode: language

    # define a locale adapter (system|custom)
    locale_adapter: system

    # define a default locale - this value is optional
    default_locale: 'id'

    # static route translations
    translations: ~

    zones:

        # zone 1: language
        zone1:
            id: 1
            # domains must be the main domain of page
            domains:
                - 'pim.lovia.life'
            config:
                mode: language
                locale_adapter: system
                translations: ~

and same (no effect).

But when I tried this:

    default_locale: 'en'

I get:

<link href="https://pim.lovia.life/en/edu/preschool/in/indonesia" rel="alternate" type="" title="" hreflang="x-default">
<link href="https://pim.lovia.life/en/edu/preschool/in/indonesia" rel="alternate" type="" title="" hreflang="en">

I tried to edit Adapter\PathGenerator\Document.php:

            $tree = $this->zoneManager->getCurrentZoneDomains(true);
            $this->logger->info("Tree: " . print_r($tree, true));

I got:

[2019-09-14 00:02:25] main.INFO: Tree: Array (     [0] => Array         (             [id] => 1             [host] => http://pim.lovia.life             [realHost] => pim.lovia.life             [isRootDomain] => 1             [locale] => en             [countryIso] =>
         [languageIso] => en             [hrefLang] => en             [localeUrlMapping] =>              [url] => http://pim.lovia.life             [homeUrl] => http://pim.lovia.life             [domainUrl] => http://pim.lovia.life             [fullPath] => /
[type] => page         )  )  [] []

I would expect the tree to contain two pages with id and en ? But only en is returned in the tree.

not reproducable:

my system.yml:

pimcore:
    general:
        fallback_languages:
            en: ''
            id: 'en'
        language: en
        valid_languages: 'en,id'
        default_language: id

my i18n config:

i18n:
    mode: language
    locale_adapter: system
    default_locale: 'id'
    translations: ~

Frontpage:

image

I guess you didn't connect your documents? See https://pimcore.com/docs/5.x/Development_Documentation/Multi_Language_i18n/Localize_your_Documents.html#page_Localization-Tool