Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow empty output on formatting plurals #325

Closed
eazyliving opened this issue Jan 12, 2021 · 0 comments
Closed

Allow empty output on formatting plurals #325

eazyliving opened this issue Jan 12, 2021 · 0 comments

Comments

@eazyliving
Copy link

Hiho!

Formatting with plurals is a great tool 👍
But at the moment it's not possible to leave an empty output.

Example:
'hours' => '{ 0, plural, zero {}, one {1 Stunde}, other {# Stunden} }'

Output for {{@hours,0 | format}} is:
}, one {1 Stunde

Changing line 974 in base.php from
'(?:\s*\{\s*(?<data>.+?)\s*\})/',
to
'(?:\s*\{\s*(?<data>.*?)\s*\})/',

fixes my problem, but I'm not sure, if this introduces other problems in other places and code :)

Maybe you'd like to look into that. Thanks!

@ikkez ikkez closed this as completed in d03a6f7 Feb 5, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant