Hi Max, thanks for looking into this!
To answer your question: Always, always, always present the translators with full sentences, no exceptions. Even if the current hard-coding should work for 50 languages that have been tested, language #51 will come along and have a different word order and screw things up. So, the string markup should be "X days ago" and "In X days", with no hard-coded word order at all. You're already taking the plural forms into account by using npgettext, so that bit is correct. Scottish Gaelic examples: 2 days ago: 2 latha air ais 3 days ago: 3 làithean air ais In 2 days: An ceann 2 latha In 3 days: An ceann 3 làithean I hope that helps. Cheers GunChleoc Sgrìobh Max Merz na leanas 16/04/2018 aig 14:08: > Hello everybody, > > I am the author of a pull request to fix Django bug #21408 > <https://code.djangoproject.com/ticket/21408>, which concerns the German > translation of the phrases “X days ago” and “X days from now”. Up until > now, these phrases were translated into German with “vor X Tage” and “in > X Tage”, while the correct translation would have been “vor X Tagen” and > “in X Tagen” (this corresponds to the Dative inflection of the word “Tag”). > The problem lies in the fact that Django's implementation does not > translate the phrase “X days ago” as one, but rather translates the > phrases “… ago” and “X days” separately, and puts the two translations > together afterwards. I tried to fix the bug for the German language by > introducing a `naturaltime` context to pass to `npgettext_lazy` when > translating “X days”, so that it would translate to “X Tagen”. (The same > holds for “… from now”.) > > When reviewing the changes in my pull request > <https://github.com/django/django/pull/9777>, Claude Paroz noted that > there might be languages in which a differentiation between “X days ago” > and “X days from now” is needed. > My (our) question is now: Are there any such languages, and if yes, > could you provide an example? > > Thank you very much in advance :) > > Cheers > Max > > -- > You received this message because you are subscribed to the Google > Groups "Django internationalization and localization" group. > To unsubscribe from this group and stop receiving emails from it, send > an email to django-i18n+unsubscr...@googlegroups.com > <mailto:django-i18n+unsubscr...@googlegroups.com>. > To post to this group, send email to django-i18n@googlegroups.com > <mailto:django-i18n@googlegroups.com>. > Visit this group at https://groups.google.com/group/django-i18n. > For more options, visit https://groups.google.com/d/optout. -- -----BEGIN PGP PUBLIC KEY BLOCK----- Version: GnuPG v2.0.22 (MingW32) mQINBFNbSyEBEADh+uhohycnZgPPnyMs5pZQG6pKyLzFZoIKbVjY31ZoPZ2SdltB elr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ToRJik4PkcxsfepzhMdNfCpr7I3jE5XQHzib5Ubv8 wsSaVNBG92NTnGKoAntWXBUaiDN84St9l+Zm/BgedRk+7wdESHBuOuFXoRc0yEjF 4tLOhyO9u5bYGQWHyJiwhbw51R8G+Kh3OPq/tr4KmsuueEI2v5cLkoDzwCpYyMnu BfU8d0mt5eULbQCWcy7LYeQs6E+CEB+tPL3Qz2zaAAvwt7N2PLMjHf5Fcqj5LqrV mzQfcB9zQFq9Rtld/IIIDkE1y/q/SNFYsFNW/u/bxWsu+lMOYtBco++O5DJhAq6t 7rJXUBirju50hhogHfBL2v6RG1b8/uiWm0m8713ZhiSvpr4Dd+V+DU9nPli5nTmU En6gP7TTYJKETMf7O9i873Z8yG6zd0/fBzFyruS2KRTPV2GiVT6CI37gUtw= =fcOW -----END PGP PUBLIC KEY BLOCK----- -- You received this message because you are subscribed to the Google Groups "Django internationalization and localization" group. To unsubscribe from this group and stop receiving emails from it, send an email to django-i18n+unsubscr...@googlegroups.com. To post to this group, send email to django-i18n@googlegroups.com. Visit this group at https://groups.google.com/group/django-i18n. For more options, visit https://groups.google.com/d/optout.