Browse Source

Ooops, a special case for "now"

pull/1983/head
Vladimir Vissoultchev 9 years ago
parent
commit
25d8757255
  1. 5
      modules/base/tool.go

5
modules/base/tool.go

@ -303,7 +303,7 @@ func timeSince(then time.Time, lang string) string {
switch { switch {
case diff <= 0: case diff <= 0:
langTr = "tool.now" langTr, lbl = "tool.now", ""
case diff <= 2: case diff <= 2:
langTr = "tool.1s" langTr = "tool.1s"
case diff < 1*Minute: case diff < 1*Minute:
@ -340,6 +340,9 @@ func timeSince(then time.Time, lang string) string {
langTr, diffNum = "tool.years", diff/Year langTr, diffNum = "tool.years", diff/Year
} }
if lbl == "" {
return i18n.Tr(lang, langTr)
}
if diffNum == 0 { if diffNum == 0 {
return i18n.Tr(lang, langTr, lbl) return i18n.Tr(lang, langTr, lbl)
} }

Loading…
Cancel
Save