This repository was archived by the owner on Nov 14, 2023. It is now read-only.

Description
Bug report: https://forum.getkirby.com/t/staticbuilder-kirby-as-a-static-site-generator/4084/26
So basically how the l::set and l::get system works in Kirby:
L::$data is an empty array.
- On page load for multilang websites, Kirby identifies the current language from the URL (e.g.
/fr/foo/bar) and loads the corresponding PHP file in site/languages/fr.php.
- In this file, using the L class instead of the C class (
c::set) is just convention. There's nothing special about it. It's a static class with an array and the get/set methods.
When rendering from /staticbuilder/, Kirby does not set the current language and does not load this language-specific config file. We then go to great lengths to set the page's language when rendering each version, but don't load those files either. Not sure what would be a decent solution. :/
Possible workaround, in e.g. site/snippets/header.php:
<?php
// make sure to load the translations for each page
$langfile = $kirby->roots()->languages() . '/' . $site->language()->code() . '.php';
if (file_exists($langfile)) {
include $langfile;
}