Create a website with country context
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
endocument tree and renameentoen-us. - Create a hardlink, call it
en-usand set the reference toen. - Change language to
en_US.
If you're using a hardlink, check out the canonical information part.
Naming Convention
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.
Preparation
Localize your documents first.
Country Wrapper
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.
Magic
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.