Different fashions of time expressions
peter.vitt2 at uni-siegen.de
Sat May 9 15:11:58 EDT 2015
It’s me again with a translation “problem”. I came across the string "%(user)s commented on changeset at %(when)s” which looks quite simple to translate. But in german we decide between a date “Am 8. Mai” and a time “Um 13:47 Uhr”, so I wanted to check what kind of string is used to replace "%(when)s". This particular string is used in kallithea/model/notification.py:252, and in lines 261 the time string is created. The problem here is that the string can be a timespan since the comment was submitted and the exact point in time of the comment. Which removes one possible translation, but brings another into play. Now I have to decide between “Am 2015-05-08 13:47:23” und “Vor 3 Tagen und 17 Stunden”.
Which of the two time strings is used can be controlled with a function parameter, but the format string to be used is independent from this parameter. Which leads me to the question: Is it wise to adapt the code to translation needs, which is: Make the format string also depending on the show_age parameter? Or should we just live with bulky translations (which somehow destroys the benefit of having the possibility to decide between different time fashions)?
More information about the kallithea-general