parsedatetime
parsedatetime copied to clipboard
Additional German translations
@ckoeberle provided the following regarding the translation of a few words that were not yet translated in the German locale. Some are not direct translations, but I will try to integrate any of these that work with existing parsedatetime logic.
English German Example (english) Example (german) frominabtwo days from now inzwei Tagenabheuteafternachthe day after my birthday einen Tag nachmeinem Geburtstagbeforevorone week before my birthday eine Woche vormeinem Geburtstagprevvorherthe prev day einen Tag vorher
eine Wochevorherend ofEnde desEnde derremind me at the end of the month
remind me at the end of the weekerinnere mich Ende desMonats
erinnere michEnde derWocheeodeomeoythere is no corresponding german abbreviation aansame as oneeinem,einerin a month
in an hourin einemMonat
ineinerStundeNumbers 0 to 20
Number spelled 0 null 1 eins 2 zwei 3 drei 4 vier 5 fünf 6 sechs 7 sieben 8 acht 9 neun 10 zehn 11 elf 12 zwölf 13 dreizehn 14 vierzehn 15 fünfzehn 16 sechzehn 17 siebzehn 18 achtzehn 19 neunzehn 20 zwanzig
having more language coverage is always a huge win - thanks @idpaterson
A quick update on this: I had implemented the changes described above a few months ago but many issues arose when applying the examples as test cases (previously German tests covered only numeric datetime formats). I have not proceeded but this is still of interest to me. Will have more time available in a few months to rebase and take another stab at this provided that I can enlist the help of one of my users to design valid test cases.
This will be revisited after the test architecture is rewritten. I created very simple tests this morning to make sure that the "test all locales" logic was working and even something as simple as these "ago" phrases did not work for German:
past_integer_values:
sourceTime: *arbitrary_date
cases:
- context: !pdtContext minute
target: !timedelta
minutes: -5
phrases:
- "5 minuten vorheriger"
- context: !pdtContext hour
target: !timedelta
hours: -34
phrases:
- "34 stunden vergangener"
- context: !pdtContext day
target: !timedelta
days: -2
phrases:
- "2 tage vergangener"
I don't know German but based on the locale config it looks like these should work. I had to use negative integers (-5 minuten, -34 stunden, -2 tage) to get the tests to pass. It will be very nice to have better test coverage for locales but looks like it might take a lot of work to get the tests to pass.