This is only required if you're using i18n with a country adapter.
There are two ways to implement a country page like en-us
:
- Copy and paste the
en
document tree and renameen
toen-us
. - Create a hardlink, call it
en-us
and set the reference toen
. - Change language to
en_US
.
If you're using a hardlink, check out the canonical information part.
You might be wondering why we named the hard link en-us
. For default documents, that's not a problem.
But you'll run into serious troubles if you need to build static routes with it. Read this section to solve this bravely.
Localize your documents first.
If you're using a hardlink for country specific data, create it. Otherwise just create a document as you would normally do.
Read more about the static route configuration.
All hardlink references will be generated automatically.
So if you have have a page in /en/about-us
the href-lang generator or context helper searches in all available hardlinks.
If you're having a /en-us
hardlink, a link to /en-us/about-us
will be automatically generated (for href-lang and the getLinkedLanguages
context helper for example).
In case, you don't want to have a about-us
page in /en-us
, just create the page /en-us/about-us
and disable it.
There is also some further magic you need to know about: If you have just one language but multiple countries, you're unable to link them via the localization tool. I81nBundle will then try to generate all hardlinks references automatically.