Smartypants and languages

Hi there,
I’m a quite new Kirby user and am tuning my (draft) website. It’s bilingual English/German and I would like to have Smartypants for both languages – with evidently different options.
I see two approaches and would like to have some comments on that:

  1. configuration using language definitions (can’t get it going, does not seem to change config variables)
  2. Updating the Kirby SmartyPants.php to set the defaults based on locale (that’s something I would share as a pull request).
    Any thoughts on that?
    Thanks for input!

I think it goes into the language configuration files.

I tried to add it to languages/de.php as follows but that does not work.

return [
    'code' => 'de',
    'default' => true,
    'direction' => 'ltr',
    'locale' => 'de_DE',
    'name' => 'Deutsch',
    'url' => '/de',
    'smartypants' => [
        'smartypants' => true,
        'doublequote.open' => "„",
        'backtick.doublequote.open' => "„",
        'do_ellipses' =>true,
    ],
];

Hm, yes, can’t get this to work either. It only seems to work if you define your smartypants array in the config, but then it is not language specific. Even setting it up with arrays for each language doesn’t work.

I created an issue on GitHub:

2 Likes

Thank you!

Language specific SmartyPants are implemented in 3.3.0.

1 Like

Cool, I truly love the kirby approach with discussions here and a transparent process. Haven’t regretted the move to kirby for a second. A solid, stable and relatively simple system.