[sugar] [PATCH] Improve formatting of relative dates
Eben Eliason
eben.eliason at gmail.com
Mon Apr 21 16:50:03 EDT 2008
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]
> >
>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0002-Improve-formatting-of-relative-dates.patch
Type: text/x-patch
Size: 2450 bytes
Desc: not available
Url : http://lists.laptop.org/pipermail/sugar/attachments/20080421/62b4e193/attachment-0001.bin
More information about the Sugar
mailing list