In Craft CMS 3 there are some minor adjustements to make when setting up a localized website. The Old Guide to setup a localized Site is still valid with some differences.
You have to create a language folder in the public directory with a .htaccess and a index.php
Let's say you want english as a second language with the url extension yourdomain.com/en.
- create a folder
en. - Copy
.htaccess&index.phpfrom the public folder into theenfolder.
Replace the line define('CRAFT_BASE_PATH', dirname(__DIR__));
with define('CRAFT_BASE_PATH', dirname(__DIR__,2));
Define which language should be loaded when accessing /en/. And with language Craft 3 means Site:
Therfore add define('CRAFT_SITE', 'yourSiteHandle'); to the index.php.
Remember. Languages are now Site based. Therefore you mustn't use the locale handle but the site Handle