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
Using the number 1 instead of the word "ein" for formatDuration in German locale #2505
Comments
As I can see in CLDR, using numbers is the correct way. @date-fns/i18n-de could you please chime in? |
Embedded into a longer text up to and including 12, it should be written as eins, zwei, ... zwölf. Alone standing i think 1 is correct (or at least thats how most people do it). But from my observation many (mostly younger) people always use "1" instead of "ein" , even in a longer text. If you don't know where it will he used and have to decide one way or the other, I think "1" is better than "ein", even though it will trigger some grammar nazis. edit: I lokked it up and the rule that up to 12 should be written as a word isn't true anymore. You can still do it but digits are always allowed now. |
I have created a PR. Does it make sense? #2576 |
@saithis is right afaik - there is not an official rule two write 1-12 as a word.
This may be the reason why the number 1 is currently an exception. |
…an locale (date-fns#2576) (closes date-fns#2505) Changed: Used `1` instead of `ein` for German `formatDuration` to make it consistent with other locales and formats.
Hello, I just noticed Italian locale has the same "issue" if we can call it like that, it uses the string "un" when the unit is 1, the number otherwise. I see the PR for the German locale has been accepted, should we use it as a rule to always use numbers for durations? In that case I'd open a PR for the Italian locale. |
Hello. I tried using
formatDuration
to calculate a duration based on an interval. When I try it without a locale (i.e. in English) the result that I get is e.g. "1 year 1 month 15 days". However, when I add the German locale and try to format the same interval, I get "ein Jahr ein Monat 15 Tage". I am not a native German speaker, but it's strange that it does it only to number 1. It doesn't happen to other numbers, e.g. "2". Is there a reason why this is the behavior or is it a bug?EDIT: My current workaround is to do a replace
formattedString.replace(/ein/g, '1')
The text was updated successfully, but these errors were encountered: