Since Version 1.1 Kirby has full built-in multi-language support. You are able to translate each and every part of your website with a few simple steps.
Jump to your config file
site/config/config.php and activate multi-language support there:
If you are still using an older version of Kirby, please upgrade and add those lines to your existing config file.
As soon as you activate multi-language support, Kirby will automatically create new language-specific URLs for your site:
You can define any number of available languages by adding their 2-character shortcodes to the
c::set('lang.available''en', 'fr', 'it', 'de'));
To make sure that you provide a proper fallback for parts of your site, which are not translated yet, you must define a default language. Kirby will automatically take care of replacing untranslated content from other languages with content from your default language, so you will never get empty or broken spaces on your site.
If you set
lang.detect to true, Kirby will automatically try to find the best language for your visitor and will redirect them to the translated version. This is activated by default, but you can switch it off, so visitors will always land on your default translation first.
Adding translated content couldn't be easier. Just add another text file to your content folder and append the language shortcode:
Make sure you always got a text file for your default language. Otherwise Kirby won't be able to provide a fallback for missing translations.
In your content files you can use the same fields and just fill in the translated text. Best way to proceed at the beginning is to start with the default language and when you are happy with the results, duplicate the default language files, rename them and translate them.
To provide translations for your global site info, add language-specific site.txt to your main content folder files like this: