python-humanize / python-humanize/humanize

German requires different cases for ‘%s ago’ and ‘%s from now’

未关闭
#263 0 条评论 3 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

help wanted
主要语言
Python
星标
756
派生
148
平均合并
6 天 1 小时
30 天内合并 PR
12

描述

This is somewhat related to #88 , but hasn’t been resolved and also needs changes to more than the translation files I am afraid.

So what this is about is that German grammar is a beast, and prepositions require certain cases. For instance, ’vor‘ will need a dativ. ‘an hour ago’ thus translates into ‘vor einer Stunde‘, rather than ‘vor eine Stunde‘ (that’s nominativ).

humanize forms the expression ‘an hour ago‘ by piping the output of naturaldelta straight into the i18n format string for %s ago. naturaldelta() returns a nominativ, that is correct as long as the expression stands by itself. However, as soon as a preposition is placed in front of the value, the grammatical case should change.

(The same is true for ‘in ...’/‘... from now’(which currently translates into ‘... ab jetzt’ which sounds odd). Conveniently, both ‘in’ and ‘vor’ require the same case, dativ)

I would be happy to contribute, but I do not know where to start without breaking things big time. If anybody can give me some directions of how to implement this best, I would go ahead and dig my head in

I don’t properly speak any Slavic languages, but I would expect similar issues with those (correct me if I am wrong)

贡献指南

打开贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

调研方向

从 src/humanize/time.py 中 naturaldelta() 的输出以及用于“%s ago.”的 i18n 格式字符串附近开始。跟踪过去和将来表达式的德语翻译是如何组装的,然后确定如何表示所需的与格形式,同时不破坏其他 locale。完成的标准是德语的“ago”和“from now”表达式使用正确的格,而现有翻译仍然有效。

由索引模型根据 Issue 内容生成。

评估

技术栈
python
领域
localization
Issue 类型
缺陷
难度
4/5
预计耗时
3-5 天
活跃度
停滞
描述清晰度
基本清楚
新手友好度
35/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。