Opened 4 years ago
Last modified 3 years ago
#13430 new defect
Translation of past time expressions
| Reported by: | anonymous | Owned by: | |
|---|---|---|---|
| Priority: | normal | Milestone: | 1.6.1 |
| Component: | i18n | Version: | 1.4 |
| Severity: | normal | Keywords: | time hungarian |
| Cc: | Branch: | ||
| Release Notes: | |||
| API Changes: | |||
| Internal Changes: | |||
Description
If someone comments on a ticket, the timestamp is stored and gives a human-readable output when was something made. It's a great feature, but it seems the time parts are translated separately.
Example:
2 months ago appears, and translated as 2 <months> <ago>. However, in Hungarian (possibly many more languages), the months and ago can't be translated separately, because it's an expression.
I suggest merging the two translation units into one because the current implementation results in mixed translations.
Possibly there are other places than comments when this appears, but I don't know Trac well enough to tell all of them :(
Attachments (0)
Change History (5)
follow-up: 2 comment:1 by , 4 years ago
| Milestone: | → 1.5.4 |
|---|
follow-up: 3 comment:2 by , 4 years ago
Replying to Jun Omae:
Interested. In Trac, the relative times are translated like this:
en hu 2 months 2 hónap 2 months ago 2 hónap ezelőtt (should be "2 hónappal ezelőtt")
The current Hungarian translation is a mixed half English, half Hungarian 2 hónapja ago. See it in Trac 1.4 demo.
Just to confirm, the correct translation would be 2 hónappal ezelőtt.
Thank you for looking into this!
comment:3 by , 4 years ago
The current Hungarian translation is a mixed half English, half Hungarian
2 hónapja ago. See it in Trac 1.4 demo.
That is due to missing translation in Hungarian catalog at source:/tags/trac-1.4.3/trac/locale/hu/LC_MESSAGES/messages.po#L4641.
The following patch fixes the mixed half English.
#: trac/timeline/web_ui.py:301 trac/web/chrome.py:871 -#, fuzzy, python-format +#, python-format msgid "%(relative)s ago" -msgstr "" +msgstr "%(relative)s ezelőtt"
comment:4 by , 4 years ago
| Milestone: | 1.5.4 → 1.5.5 |
|---|
comment:5 by , 3 years ago
| Milestone: | 1.5.5 → 1.6.1 |
|---|



Interested. In Trac, the relative times are translated like this:
I think we could use
format_timedelta(delta, add_direction=True)(add_directionargument is introduced in Babel 1.0).The table is generated by the following code:
>>> import babel >>> babel.__version__ '2.2.0' >>> from datetime import timedelta >>> locales = 'ca cs da de el en_GB en_US eo es es_AR es_MX et fa fi fr gl he hu hy it ja ko nb nl pl pt pt_BR ro ru sl sq sv tr uk vi zh_CN zh_TW'.split() >>> for locale in locales: ... delta = timedelta(days=2 * 30) ... print('|| %s || %s || %s || %s || %s ||' % ... (locale, ... format_timedelta(-delta, locale=locale), ... format_timedelta(-delta, add_direction=True, locale=locale), ... format_timedelta(+delta, locale=locale), ... format_timedelta(+delta, add_direction=True, locale=locale))) ...