Hi. I have to implement Thai as a language in an existing kirby website which is running in german and english now. Since Thai uses a completely different alphabet, a different font must be used. Has anyone had any experience here? Is there some kind of “best practice”?
I can’t think of anything, it’s easier for Thai because it reads left to right, so at least you don’t have to mess around with text direction.
If you wanted to only load the Thai font on pages with Thai content, you can do it like this (change the ‘th’ for whatever code you declared for Thai in your config.)
<?php if($page->content('th')->exists()): ?>
<!-- Thai Font -->
<?php else: ?>
<!-- Other Font -->
<?php endif ?>
I am not sure happens with with the Thai language variables in the panel, I would think you would need to load in custom font there to. You can do this with a custom panel stylesheet. However, Kirby is multilingual so I think it will be ok without doing that.
I’m not 100% sure but i think it’s possible to have the site language code as Thai but the content will be in English or whatever you set the default to if Thai content does not exist. Kirby will fall back if its missing. I think its safer to actually check for Thai content.