sveltekit-i18n / lib

Internationalization library built for SvelteKit.
MIT License
447 stars 28 forks source link

Trailing spaces #111

Closed yheuhtozr closed 1 year ago

yheuhtozr commented 1 year ago

Hi, I find parser-default quite useful for most situations, but I cannot think of a way to handle trailing (and preceding) spaces. For example,

"message": "Usual message. {{category; special:Special message. ;}}({{date:date}})"

What I want is when category is not special:

Usual message. ([actual date])

and when it is:

Usual message. Special message. ([actual date])

But the actual output is:

Usual message. Special message.([actual date])

Of course, if you put the space outside the modifier command, you'll see double spaces when the output is empty.

Usual message.  ([actual date])

It'd be very helpful if there is a way to describe trailing spaces.