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

sentence_list not translated #2463

Closed
wm-simon opened this issue Sep 18, 2020 · 9 comments
Closed

sentence_list not translated #2463

wm-simon opened this issue Sep 18, 2020 · 9 comments

Comments

@wm-simon
Copy link

Bug Description

If you use the sentence_list modifier, the "and" is not translated.

How to Reproduce

{{ list | sentence_list }}
Output: item1, item2**, and** item3
Should be: item1, item2 und item3

Extra Detail

Environment

Statamic version: 3.0.9

PHP version: 7.4

Install method (choose one):

  • Fresh install from statamic/statamic
@robdekort
Copy link
Contributor

It might be nice if you can pass a localisable string in there. Something like this:
{{ list | sentence_list:trans_file.key }}

@ebeauchamps
Copy link
Contributor

Shouldn't it rather be somewhat automatic based on the locale in use for the list items?

@robdekort
Copy link
Contributor

Even better.

@jasonvarga
Copy link
Member

FYI the argument is the glue.

{{ list | sentence_list:et }}
one, two, et three

@ebeauchamps
Copy link
Contributor

That was fast!

@wm-simon
Copy link
Author

Thanks for the fast fix @jasonvarga !

If someone doesn't need the the Oxford Comma, you can remove it with {{ list | sentence_list:und:0 }}.
I think this should be added to the docs.
https://statamic.dev/modifiers/sentence_list#content

@jasonvarga
Copy link
Member

jasonvarga commented Sep 18, 2020

Added to the docs, but you should use the oxford comma! 😄

@wm-simon
Copy link
Author

In Germany it's allowed, but reeeaaallly not common. The most people would mark it as error.

@ebeauchamps
Copy link
Contributor

So funny. And in France you should not use any kind of comma when it's located just before "et".
So It should be one, two et three.....
I guess I cannot ask for that, can I?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants