Project

General

Profile

Defect #25130 » distance_in_words.patch

requested at 25402#note-2 - Greg T, 2017-03-23 10:33

View differences:

app/helpers/settings_helper.rb (working copy)
def session_lifetime_options
options = [[l(:label_disabled), 0]]
options += [4, 8, 12].map {|hours|
[l('datetime.distance_in_words.x_hours', :count => hours), (hours * 60).to_s]
[l('datetime.x_hours', :count => hours), (hours * 60).to_s]
}
options += [1, 7, 30, 60, 365].map {|days|
[l('datetime.distance_in_words.x_days', :count => days), (days * 24 * 60).to_s]
[l('datetime.x_days', :count => days), (days * 24 * 60).to_s]
}
options
end
......
def session_timeout_options
options = [[l(:label_disabled), 0]]
options += [1, 2, 4, 8, 12, 24, 48].map {|hours|
[l('datetime.distance_in_words.x_hours', :count => hours), (hours * 60).to_s]
[l('datetime.x_hours', :count => hours), (hours * 60).to_s]
}
options
end
app/models/issue_relation.rb (working copy)
issue_text = block_given? ? yield(other_issue(issue)) : "##{other_issue(issue).try(:id)}"
s = []
s << l(label_for(issue))
s << "(#{l('datetime.distance_in_words.x_days', :count => delay)})" if delay && delay != 0
s << "(#{l('datetime.x_days', :count => delay)})" if delay && delay != 0
s << issue_text
s.join(' ')
end
app/views/settings/_authentication.html.erb (working copy)
<div class="box tabular settings">
<p><%= setting_check_box :login_required %></p>
<p><%= setting_select :autologin, [[l(:label_disabled), 0]] + [1, 7, 30, 365].collect{|days| [l('datetime.distance_in_words.x_days', :count => days), days.to_s]} %></p>
<p><%= setting_select :autologin, [[l(:label_disabled), 0]] + [1, 7, 30, 365].collect{|days| [l('datetime.x_days', :count => days), days.to_s]} %></p>
<p><%= setting_select :self_registration, [[l(:label_disabled), "0"],
[l(:label_registration_activation_by_email), "1"],
......
<p><%= setting_text_field :password_min_length, :size => 6 %></p>
<p>
<%= setting_select :password_max_age, [[l(:label_disabled), 0]] + [7, 30, 60, 90, 180, 365].collect{|days| [l('datetime.distance_in_words.x_days', :count => days), days.to_s]} %>
<%= setting_select :password_max_age, [[l(:label_disabled), 0]] + [7, 30, 60, 90, 180, 365].collect{|days| [l('datetime.x_days', :count => days), days.to_s]} %>
</p>
<p><%= setting_check_box :lost_password %></p>
config/locales/ar.yml (working copy)
pm: "مساءاً"
datetime:
x_hours:
one: "%{count} ساعة"
other: "%{count} ساعات"
x_days:
one: "يوم"
other: "%{count} أيام"
distance_in_words:
half_a_minute: "نصف دقيقة"
less_than_x_seconds:
config/locales/az.yml (working copy)
tb: "TB"
datetime:
x_hours:
one: "1 saat"
other: "%{count} saat"
x_days:
one: "%{count} gün"
few: "%{count} gün"
many: "%{count} gün"
other: "%{count} gün"
distance_in_words:
half_a_minute: "bir dəqiqədən az"
less_than_x_seconds:
config/locales/bg.yml (working copy)
pm: "pm"
datetime:
x_hours:
one: "1 час"
other: "%{count} часа"
x_days:
one: "1 ден"
other: "%{count} дена"
distance_in_words:
half_a_minute: "half a minute"
less_than_x_seconds:
config/locales/bs.yml (working copy)
pm: "poslijepodne"
datetime:
x_hours:
one: "1 sahat"
other: "%{count} sahata"
x_days:
one: "1 dan"
other: "%{count} dana"
distance_in_words:
half_a_minute: "pola minute"
less_than_x_seconds:
config/locales/ca.yml (working copy)
pm: "pm"
datetime:
x_hours:
one: "1 hora"
other: "%{count} hores"
x_days:
one: "1 dia"
other: "%{count} dies"
distance_in_words:
half_a_minute: "mig minut"
less_than_x_seconds:
config/locales/cs.yml (working copy)
pm: "odp."
datetime:
x_hours:
one: "1 hodina"
other: "%{count} hodin"
x_days:
one: "1 den"
other: "%{count} dnů"
distance_in_words:
half_a_minute: "půl minuty"
less_than_x_seconds:
config/locales/da.yml (working copy)
skip_last_comma: true
datetime:
x_hours:
one: "1 time"
other: "%{count} timer"
x_days:
one: "en dag"
other: "%{count} dage"
distance_in_words:
half_a_minute: "et halvt minut"
less_than_x_seconds:
config/locales/de.yml (working copy)
pm: "nachmittags"
datetime:
x_hours:
one: "1 Stunde"
other: "%{count} Stunden"
x_days:
one: '1 Tag'
other: '%{count} Tagen'
distance_in_words:
half_a_minute: 'eine halbe Minute'
less_than_x_seconds:
config/locales/el.yml (working copy)
pm: "μμ"
datetime:
x_hours:
one: "1 ώρα"
other: "%{count} ώρες"
x_days:
one: "1 ημέρα"
other: "%{count} ημέρες"
distance_in_words:
half_a_minute: "μισό λεπτό"
less_than_x_seconds:
config/locales/en-GB.yml (working copy)
pm: "pm"
datetime:
x_hours:
one: "1 hour"
other: "%{count} hours"
x_days:
one: "1 day"
other: "%{count} days"
distance_in_words:
half_a_minute: "half a minute"
less_than_x_seconds:
config/locales/en.yml (working copy)
pm: "pm"
datetime:
x_hours:
one: "1 hour"
other: "%{count} hours"
x_days:
one: "1 day"
other: "%{count} days"
distance_in_words:
half_a_minute: "half a minute"
less_than_x_seconds:
config/locales/es-PA.yml (working copy)
# Used in distance_of_time_in_words(), distance_of_time_in_words_to_now(), time_ago_in_words()
datetime:
x_hours:
one: "1 hora"
other: "%{count} horas"
x_days:
one: "1 día"
other: "%{count} días"
distance_in_words:
half_a_minute: "medio minuto"
less_than_x_seconds:
config/locales/es.yml (working copy)
# Used in distance_of_time_in_words(), distance_of_time_in_words_to_now(), time_ago_in_words()
datetime:
x_hours:
one: "1 hora"
other: "%{count} horas"
x_days:
one: "1 día"
other: "%{count} días"
distance_in_words:
half_a_minute: "medio minuto"
less_than_x_seconds:
config/locales/et.yml (working copy)
pm: "peale lõunat"
datetime:
x_hours:
one: "1 tund"
other: "%{count} tundi"
x_days:
one: "1 päev"
other: "%{count} päeva"
distance_in_words:
half_a_minute: "pool minutit"
less_than_x_seconds:
config/locales/eu.yml (working copy)
pm: "pm"
datetime:
x_hours:
one: "ordu 1"
other: "%{count} ordu"
x_days:
one: "egun 1"
other: "%{count} egun"
distance_in_words:
half_a_minute: "minutu erdi"
less_than_x_seconds:
config/locales/fa.yml (working copy)
pm: "عصر"
datetime:
x_hours:
one: "1 ساعت"
other: "%{count} ساعت"
x_days:
one: "1 روز"
other: "%{count} روز"
distance_in_words:
half_a_minute: "نیم دقیقه"
less_than_x_seconds:
config/locales/fi.yml (working copy)
tb: "TB"
datetime:
x_hours:
one: "1 tunti"
other: "%{count} tuntia"
x_days:
one: "päivä"
other: "%{count} päivää"
distance_in_words:
half_a_minute: "puoli minuuttia"
less_than_x_seconds:
config/locales/fr.yml (working copy)
pm: 'pm'
datetime:
x_hours:
one: "une heure"
other: "%{count} heures"
x_days:
one: "un jour"
other: "%{count} jours"
distance_in_words:
half_a_minute: "30 secondes"
less_than_x_seconds:
config/locales/gl.yml (working copy)
pm: ''
datetime:
x_hours:
one: "1 hora"
other: "%{count} horas"
x_days:
one: '1 día'
other: '%{count} días'
distance_in_words:
half_a_minute: 'medio minuto'
less_than_x_seconds:
config/locales/he.yml (working copy)
pm: 'pm'
datetime:
x_hours:
one: "1 שעה"
other: "%{count} שעות"
x_days:
one: 'יום אחד'
other: '%{count} ימים'
distance_in_words:
half_a_minute: 'חצי דקה'
less_than_x_seconds:
config/locales/hr.yml (working copy)
pm: "pm"
datetime:
x_hours:
one: "1 sata"
other: "%{count} sati"
x_days:
one: "1 dan"
other: "%{count} dana"
distance_in_words:
half_a_minute: "pola minute"
less_than_x_seconds:
config/locales/hu.yml (working copy)
pm: "du."
datetime:
x_hours:
one: "1 óra"
other: "%{count} óra"
x_days:
one: '1 nap'
other: '%{count} nap'
distance_in_words:
half_a_minute: 'fél perc'
less_than_x_seconds:
......
one: 'csaknem 1 órája'
other: 'csaknem %{count} órája'
x_hours:
one: "1 óra"
other: "%{count} óra"
one: "1 órája"
other: "%{count} órája"
x_days:
one: '1 napja'
other: '%{count} napja'
config/locales/id.yml (working copy)
pm: "pm"
datetime:
x_hours:
one: "1 jam"
other: "%{count} jam"
x_days:
one: "sehari"
other: "%{count} hari"
distance_in_words:
half_a_minute: "setengah menit"
less_than_x_seconds:
config/locales/it.yml (working copy)
pm: 'pm'
datetime:
x_hours:
one: "1 ora"
other: "%{count} ore"
x_days:
one: "1 giorno"
other: "%{count} giorni"
distance_in_words:
half_a_minute: "mezzo minuto"
less_than_x_seconds:
config/locales/ja.yml (working copy)
pm: "午後"
datetime:
x_hours:
one: "1時間"
other: "%{count}時間"
x_days:
one: "1日"
other: "%{count}日"
distance_in_words:
half_a_minute: "30秒前後"
less_than_x_seconds:
config/locales/ko.yml (working copy)
pm: "오후"
datetime:
x_hours:
one: "1 시간"
other: "%{count} 시간"
x_days:
one: "하루"
other: "%{count}일"
distance_in_words:
half_a_minute: "30초"
less_than_x_seconds:
config/locales/lt.yml (working copy)
pm: "vakaro"
datetime:
x_hours:
one: "1 valanda"
other: "%{count} valandų(os)"
x_days:
one: "1 diena"
other: "%{count} dienų(os)"
distance_in_words:
half_a_minute: "pusė minutės"
less_than_x_seconds:
config/locales/lv.yml (working copy)
pm: "vakarā"
datetime:
x_hours:
one: "1 stunda"
other: "%{count} stundas"
x_days:
one: "1 diena"
other: "%{count} dienas"
distance_in_words:
half_a_minute: "pus minūte"
less_than_x_seconds:
config/locales/mk.yml (working copy)
pm: "попладне"
datetime:
x_hours:
one: "1 час"
other: "%{count} часа"
x_days:
one: "1 ден"
other: "%{count} дена"
distance_in_words:
half_a_minute: "пола минута"
less_than_x_seconds:
config/locales/mn.yml (working copy)
pm: "pm"
datetime:
x_hours:
one: "1 цаг"
other: "%{count} цаг"
x_days:
one: "1 өдөр"
other: "%{count} өдөр"
distance_in_words:
half_a_minute: "хагас минут"
less_than_x_seconds:
config/locales/nl.yml (working copy)
pm: "pm"
datetime:
x_hours:
one: "1 uur"
other: "%{count} uren"
x_days:
one: "1 dag"
other: "%{count} dagen"
distance_in_words:
half_a_minute: "halve minuut"
less_than_x_seconds:
config/locales/no.yml (working copy)
am: ""
pm: ""
datetime:
x_hours:
one: "1 time"
other: "%{count} timer"
x_days:
one: "1 dag"
other: "%{count} dager"
distance_in_words:
half_a_minute: "et halvt minutt"
less_than_x_seconds:
config/locales/pl.yml (working copy)
pm: "po południu"
datetime:
x_hours:
one: "1 godzina"
other: "%{count} godzin"
x_days:
one: "1 dzień"
other: "%{count} dni"
distance_in_words:
half_a_minute: "pół minuty"
less_than_x_seconds:
config/locales/pt-BR.yml (working copy)
# date helper distancia em palavras
datetime:
x_hours:
one: "1 hora"
other: "%{count} horas"
x_days:
one: '1 dia'
other: '%{count} dias'
distance_in_words:
half_a_minute: 'meio minuto'
less_than_x_seconds:
config/locales/pt.yml (working copy)
pm: 'pm'
datetime:
x_hours:
one: "1 hora"
other: "%{count} horas"
x_days:
one: "1 dia"
other: "%{count} dias"
distance_in_words:
half_a_minute: "meio minuto"
less_than_x_seconds:
config/locales/ro.yml (working copy)
pm: "pm"
datetime:
x_hours:
one: "1 oră"
other: "%{count} ore"
x_days:
one: "o zi"
other: "%{count} zile"
distance_in_words:
half_a_minute: "jumătate de minut"
less_than_x_seconds:
config/locales/ru.yml (working copy)
tb: "ТБ"
datetime:
x_hours:
one: "%{count} час"
few: "%{count} часа"
many: "%{count} часов"
other: "%{count} часа"
x_days:
one: "%{count} день"
few: "%{count} дня"
many: "%{count} дней"
other: "%{count} дня"
distance_in_words:
half_a_minute: "меньше минуты"
less_than_x_seconds:
config/locales/sk.yml (working copy)
pm: "popoludní"
datetime:
x_hours:
one: "1 hodina"
other: "%{count} hodín"
x_days:
one: "1 deň"
other: "%{count} dní"
distance_in_words:
half_a_minute: "pol minúty"
less_than_x_seconds:
config/locales/sl.yml (working copy)
pm: "pm"
datetime:
x_hours:
one: "1 ura"
other: "%{count} ur"
x_days:
one: "1 dan"
other: "%{count} dni"
distance_in_words:
half_a_minute: "pol minute"
less_than_x_seconds:
config/locales/sq.yml (working copy)
pm: "pm"
datetime:
x_hours:
one: "1 ore"
other: "%{count} ore"
x_days:
one: "1 day"
other: "%{count} days"
distance_in_words:
half_a_minute: "half a minute"
less_than_x_seconds:
config/locales/sr-YU.yml (working copy)
pm: "pm"
datetime:
x_hours:
one: "1 sat"
other: "%{count} sati"
x_days:
one: "jedan dan"
other: "%{count} dana"
distance_in_words:
half_a_minute: "pola minuta"
less_than_x_seconds:
config/locales/sr.yml (working copy)
pm: "pm"
datetime:
x_hours:
one: "1 сат"
other: "%{count} сати"
x_days:
one: "један дан"
other: "%{count} дана"
distance_in_words:
half_a_minute: "пола минута"
less_than_x_seconds:
config/locales/sv.yml (working copy)
# Used in distance_of_time_in_words(), distance_of_time_in_words_to_now(), time_ago_in_words()
datetime:
x_hours:
one: "1 timme"
other: "%{count} timmar"
x_days:
one: "en dag"
other: "%{count} dagar"
distance_in_words:
half_a_minute: "en halv minut"
less_than_x_seconds:
config/locales/th.yml (working copy)
pm: "pm"
datetime:
x_hours:
one: "1 hour"
other: "%{count} hours"
x_days:
one: "1 day"
other: "%{count} days"
distance_in_words:
half_a_minute: "half a minute"
less_than_x_seconds:
config/locales/tr.yml (working copy)
pm: "öğleden sonra"
datetime:
x_hours:
one: "1 saat"
other: "%{count} saat"
x_days:
one: '1 gün'
other: '%{count} gün'
distance_in_words:
half_a_minute: 'yarım dakika'
less_than_x_seconds:
config/locales/uk.yml (working copy)
pm: "вечора"
datetime:
x_hours:
one: "1 година"
few: "%{count} години"
many: "%{count} годин"
other: "%{count} години"
x_days:
one: "1 день"
few: "%{count} дня"
many: "%{count} днів"
other: "%{count} днів"
distance_in_words:
half_a_minute: "менше хвилини"
less_than_x_seconds:
config/locales/vi.yml (working copy)
# Used in distance_of_time_in_words(), distance_of_time_in_words_to_now(), time_ago_in_words()
datetime:
x_hours:
one: "1 giờ"
other: "%{count} giờ"
x_days:
one: "1 ngày"
other: "%{count} ngày"
distance_in_words:
half_a_minute: "30 giây"
less_than_x_seconds:
config/locales/zh-TW.yml (working copy)
# 使用於 distance_of_time_in_words(), distance_of_time_in_words_to_now(), time_ago_in_words()
datetime:
x_hours:
one: "1 小時"
other: "%{count} 小時"
x_days:
one: "1 天"
other: "%{count} 天"
distance_in_words:
half_a_minute: "半分鐘"
less_than_x_seconds:
config/locales/zh.yml (working copy)
pm: "下午"
datetime:
x_hours:
one: "1 小时"
other: "%{count} 小时"
x_days:
one: "一天"
other: "%{count} 天"
distance_in_words:
half_a_minute: "半分钟"
less_than_x_seconds:
(1-1/2)