Issues with the new naturaltime template tag

118 views
Skip to first unread message

Vladimir Macek

unread,
Nov 25, 2011, 7:25:05 PM11/25/11
to djang...@googlegroups.com
Hello translators,

there's a new `naturaltime' template tag coming with the Django dev
version. It construct a phrase specifying how much ago/from-now the given
time is.
https://docs.djangoproject.com/en/dev/ref/contrib/humanize/#naturaltime

When the difference is more than one day, it calls timesince/timeuntil and
translates its result using "%(delta) ago"/"%(delta) from now" msgids.

In my Czech language the translation of these is rather dumb unless I have
a chance to translate words generated here by timesince/timeuntil differently.

The past form would sound like either "age %(delta)s" or "%(delta)s in the
past". For second form I don't know anything better than "%(delta) in the
future". Not pretty.

Do other languages have similar trouble? In case there is considerable
number of them, I think the code should be changed.

The best I can see now would be to pass i18n contexts like "naturaltime
past"/"naturaltime future" to timesince/timeuntil
OR
don't call timesince/timeuntil at all and reimplement their functionality
using msgids containing words "hours", "minutes" etc. together with "ago"
and "from now" -- just as naturaltime already does when the delta is within
one day (u'a second from now', u'%(count)s seconds from now'), which is
completely ok.

Thank you for responses,

--
: Vladimir Macek : http://macek.sandbox.cz : +420 608 978 164
: UNIX && Dev || Training : Python, Django : GPG key 1F059424


Sergiy Kuzmenko

unread,
Nov 26, 2011, 10:23:55 AM11/26/11
to djang...@googlegroups.com

I agree. We are getting nested translations here which does not work equally well in all languages. Translation strings have to be fully spelled.

--
You received this message because you are subscribed to the Google Groups "Django internationalization and localization" group.
To post to this group, send email to djang...@googlegroups.com.
To unsubscribe from this group, send email to django-i18n...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-i18n?hl=en.

Lachlan Musicman

unread,
Nov 26, 2011, 6:23:22 PM11/26/11
to djang...@googlegroups.com
Have you had a look through http://lictionary.in/ to look for prevelance?

cheers
L.

Vladimir Macek

unread,
Nov 28, 2011, 8:39:07 AM11/28/11
to djang...@googlegroups.com
No, I didn't. How could it help me with my problem and may I ask you for
examples for my situation?

V.

: MOJE AKT. SKOLENI: http://macek.sandbox.cz/skoleni/aktualni.html

Lachlan Musicman

unread,
Nov 30, 2011, 5:31:51 PM11/30/11
to djang...@googlegroups.com
On Tue, Nov 29, 2011 at 00:39, Vladimir Macek <ma...@sandbox.cz> wrote:
> No, I didn't. How could it help me with my problem and may I ask you for
> examples for my situation?

Any repo would do, but I think that lictionary have a lot of i18n code
from different open projects making it easy to check horizontally.

I was thinking that you could browse to see how other open source
projects address this issue, and how they translate it into your
language of choice.

I'm not a Czech speaker (actually, the best I do is a little
Indonesian and even my English is wonky), so I can't give concrete
examples, apols.

cheers
L.

Reply all
Reply to author
Forward
0 new messages