[sugar] [PATCH] Improve formatting of relative dates

Tomeu Vizoso tomeu at tomeuvizoso.net
Tue Apr 22 05:36:28 EDT 2008


r+

On Mon, Apr 21, 2008 at 10:50 PM, Eben Eliason <eben.eliason at gmail.com> wrote:
>
> On Sun, Apr 20, 2008 at 7:17 PM, Eben Eliason <eben.eliason at gmail.com> wrote:
>  > All sounds good, thanks for the suggestions.  Hopefully I'll have time
>  >  to tidy up the patch tomorrow.
>  >
>  >  - Eben
>  >
>  >
>  >
>  >
>  >  On Sun, Apr 20, 2008 at 5:04 PM, Sayamindu Dasgupta <sayamindu at gmail.com> wrote:
>  >  > On Mon, Apr 21, 2008 at 2:18 AM, Tomeu Vizoso <tomeu at tomeuvizoso.net> wrote:
>  >  >  > On Sat, Apr 19, 2008 at 7:54 PM, Eben Eliason <eben.eliason at gmail.com> wrote:
>  >  >  >  > >  +NOW = _('Seconds ago')
>  >  >  >  >  >
>  >  >  >  >  >  Translators may not be able to translate adequately from 'Seconds
>  >  >  >  >  >  ago'. Perhaps a translation comment may help here? Example from
>  >  >  >  >  >  misc.py:
>  >  >  >  >  >
>  >  >  >  >  >  # TRANS: Relative dates (eg. 1 month and 5 days).
>  >  >  >  >
>  >  >  >  >  What if we are explicit in the comment about the intended meaning of NOW, as in:
>  >  >  >  >  # TRANS: Indicating something that just happened; "just now", "right
>  >  >  >  >  now", "moments ago"
>  >  >  >
>  >  >  >  Sounds good.
>  >  >  >
>  >  >  >
>  >  >  >  >  >  +AGO = _(' ago')
>  >  >  >  >  >  ...
>  >  >  >  >  >  +    return result + AGO
>  >  >  >  >  >
>  >  >  >  >  >  This will break in most languages other than english. Sayamindu, do
>  >  >  >  >  >  you have any idea about what can be done here?
>  >  >  >  >
>  >  >  >  >  Likewise:
>  >  >  >  >  # TRANS: Indicating time passed, eg (1 month, 5 days ago); "ago", "in
>  >  >  >  >  the past", "earlier"
>  >  >  >
>  >  >  >  Yes, but in some languages that string may appear in a different
>  >  >  >  position inside the sentence. What about _('%s ago') % result instead?
>  >  >  >  Btw, may be better to change the name of the result variable to
>  >  >  >  something more descriptive (like 'period'?).
>  >  >  >
>  >  >  >  http://docs.python.org/lib/typesseq-strings.html
>  >  >
>  >  >  I would say +1 for the above. It is very difficult to predict how a
>  >  >  translation might rearrange a string, so _('%s ago')  would be the
>  >  >  safest option (along with a #TRANS comment explaining the string).
>  >  >
>  >  >  Thanks,
>  >  >  Sayamindu
>  >  >
>  >  >
>  >  >  --
>  >  >  Sayamindu Dasgupta
>  >  >  [http://sayamindu.randomink.org/ramblings]
>  >  >
>  >
>


More information about the Sugar mailing list