I found a bug when adding one language to the project.
Before adding language config
Before I add a config to set multiple languages I add some pages and content like home.txt and about.txt. These are not prefixed as language yet because the language config has not yet been set.
After adding language config
This is where the bug appears. When having added the language config, the panel loads the old home.txt, probably because it still exists.
The problem is when trying to save it. It appears that it cannot save, because the same content keeps coming back. It loads home.txt and not home.sv.txt.
However it still saves the home.sv.txt correctly but it does not load it. It loads home.txt instead.
Fix
…for @bastianallgeier:
If saving the file as home.sv.txt, then load home.sv.txt, not home.txt.
…for Kirby users:
Delete home.txt and all other text files that are not language prefixed.
This is how I added the language to config.php:
c::set(‘languages’, array(
array(
‘name’ => ‘Svenska’,
‘code’ => ‘sv’,
‘locale’ => ‘sv_SE.utf-8’,
‘default’ => true,
‘url’ => ‘/’,
‘direction’ => ‘ltr’
),
));
If it works when you try this out, change the file created date and updated date. It might have something to do with it as well.