1
0
Fork 0
mirror of https://github.com/mperham/sidekiq.git synced 2022-11-09 13:52:34 -05:00

Finish i18n extraction

This commit is contained in:
Mike Perham 2013-04-04 20:51:59 -07:00
parent d12b00b359
commit 750a5efb78
14 changed files with 82 additions and 50 deletions

View file

@ -20,8 +20,8 @@ module Sidekiq
(request.env["HTTP_ACCEPT_LANGUAGE"] || 'en')[0,2]
end
def t(msg)
I18n.t(msg, :locale => get_locale)
def t(msg, options={})
I18n.t(msg, options.merge(:locale => get_locale))
end
def reset_worker_list

View file

@ -1,5 +1,8 @@
en:
Dashboard: Dashboard
Status: Status
Time: Time
Namespace: Namespace
Realtime: Real-time
History: History
Busy: Busy
@ -9,8 +12,38 @@ en:
Retries: Retries
Enqueued: Enqueued
Worker: Worker
Workers: Workers
LivePoll: Live Poll
StopPolling: Stop Polling
Queue: Queue
Class: Class
Job: Job
Arguments: Arguments
Started: Started
ShowAll: Show All
CurrentMessagesInQueue: "Current messages in <span class='title'>%{queue}</span>"
Delete: Delete
AreYouSureDeleteJob: Are you sure you want to delete this job?
AreYouSureDeleteQueue: Are you sure you want to delete the %{queue} queue?
Queues: Queues
Size: Size
Actions: Actions
NextRetry: Next Retry
RetryCount: Retry Count
RetryNow: Retry Now
LastRetry: Last Retry
OriginallyFailed: Originally Failed
AreYouSure: Are you sure?
DeleteAll: Delete All
RetryAll: Retry All
NoRetriesFound: No retries were found
Error: Error
ErrorClass: Error Class
ErrorMessage: Error Message
ErrorBacktrace: Error Backtrace
GoBack: ← Back
NoScheduledFound: No scheduled jobs were found
When: When
ScheduledJobs: Scheduled Jobs
idle: idle
active: active

4
web/views/_nav.slim Executable file → Normal file
View file

@ -6,7 +6,7 @@
- tabs.each do |title, url|
- if url == ''
li class="#{(current_path == url) ? 'active':''}"
a href='#{{root_path}}#{{url}}' #{title}
a href='#{{root_path}}#{{url}}' = t(title)
- else
li class="#{(current_path =~ Regexp.new(url)) ? 'active':''}"
a href='#{{root_path}}#{{url}}' #{title}
a href='#{{root_path}}#{{url}}' = t(title)

0
web/views/_paging.slim Executable file → Normal file
View file

2
web/views/_status.slim Executable file → Normal file
View file

@ -1,3 +1,3 @@
span.status
i class="status-sprite status-#{current_status}"
== current_status
== t(current_status)

0
web/views/_summary.slim Executable file → Normal file
View file

0
web/views/_workers.slim Executable file → Normal file
View file

0
web/views/index.slim Executable file → Normal file
View file

0
web/views/layout.slim Executable file → Normal file
View file

11
web/views/queue.slim Executable file → Normal file
View file

@ -1,15 +1,14 @@
header.row
.span5
h3
| Current messages in
span.title #{@name}
== t('CurrentMessagesInQueue', :queue => @name)
.span4
== slim :_paging, :locals => { :url => "#{root_path}queues/#{@name}" }
table class="queue table table-hover table-bordered table-striped"
thead
th Class
th Arguments
th = t('Class')
th = t('Arguments')
th
- @messages.each_with_index do |msg, index|
tr
@ -17,12 +16,12 @@ table class="queue table table-hover table-bordered table-striped"
td
- if msg['args'] and msg['args'].to_s.size > 100
= msg['args'].inspect[0..100] + "... "
button data-toggle="collapse" data-target="#worker_#{index}" class="btn btn-mini" Show All
button data-toggle="collapse" data-target="#worker_#{index}" class="btn btn-mini" = t('ShowAll')
.toggle[id="worker_#{index}" style="display: none;"]= msg['args']
- else
= msg['args']
td
form action="#{root_path}queues/#{@name}/delete" method="post"
input name="key_val" value="#{Sidekiq.dump_json(msg)}" type="hidden"
input.btn.btn-danger.btn-mini type="submit" name="delete" value="Delete" data-confirm="Are you sure you want to delete this job?"
input.btn.btn-danger.btn-mini type="submit" name="delete" value="#{t('Delete')}" data-confirm="#{t('AreYouSure')}"
== slim :_paging, :locals => { :url => "#{root_path}queues/#{@name}" }

10
web/views/queues.slim Executable file → Normal file
View file

@ -1,10 +1,10 @@
h3 Queues
h3 = t('Queues')
table class="queues table table-hover table-bordered table-striped table-white"
thead
th Queue
th Size
th Actions
th = t('Queue')
th = t('Size')
th = t('Actions')
- @queues.each do |queue, size|
tr
td
@ -12,4 +12,4 @@ table class="queues table table-hover table-bordered table-striped table-white"
td= number_with_delimiter(size)
td width="20%"
form action="#{root_path}queues/#{queue}" method="post"
input.btn.btn-danger.btn-small type="submit" name="delete" value="Delete" data-confirm="Are you sure you want to delete the #{queue} queue?"
input.btn.btn-danger.btn-small type="submit" name="delete" value="#{t('Delete')}" data-confirm="#{t('AreYouSureDeleteQueue', :queue => queue)}"

22
web/views/retries.slim Executable file → Normal file
View file

@ -1,6 +1,6 @@
header.row
.span5
h3 Retries
h3 = t('Retries')
.span4
- if @retries.size > 0
== slim :_paging, :locals => { :url => "#{root_path}retries" }
@ -12,11 +12,11 @@ header.row
tr
th width="20px"
input type="checkbox" class="check_all"
th width="25%" Next Retry
th width="11%" Retry count
th Queue
th Worker
th Args
th width="25%" = t('NextRetry')
th width="11%" = t('RetryCount')
th = t('Queue')
th = t('Worker')
th = t('Arguments')
- @retries.each do |msg, score|
tr
td
@ -28,13 +28,13 @@ header.row
a href="#{root_path}queues/#{msg['queue']}" #{msg['queue']}
td= msg['class']
td= display_args(msg['args'])
input.btn.btn-primary.btn-small.pull-left type="submit" name="retry" value="Retry Now"
input.btn.btn-danger.btn-small.pull-left type="submit" name="delete" value="Delete"
input.btn.btn-primary.btn-small.pull-left type="submit" name="retry" value="#{t('RetryNow')}"
input.btn.btn-danger.btn-small.pull-left type="submit" name="delete" value="#{t('Delete')}"
form action="#{root_path}retries/all/delete" method="post"
input.btn.btn-danger.btn-small.pull-right type="submit" name="delete" value="Delete All" data-confirm="Are you sure?"
input.btn.btn-danger.btn-small.pull-right type="submit" name="delete" value="#{t('DeleteAll')}" data-confirm="#{t('AreYouSure')}"
form action="#{root_path}retries/all/retry" method="post"
input.btn.btn-danger.btn-small.pull-right type="submit" name="retry" value="Retry All" data-confirm="Are you sure?"
input.btn.btn-danger.btn-small.pull-right type="submit" name="retry" value="#{t('RetryAll')}" data-confirm="#{t('AreYouSure')}"
- else
.alert.alert-success No retries were found
.alert.alert-success = t('NoRetriesFound')

32
web/views/retry.slim Executable file → Normal file
View file

@ -1,55 +1,55 @@
header
h3 Job
h3 = t('Job')
table class="retry table table-bordered table-striped"
tbody
tr
th Queue
th = t('Queue')
td
a href="#{root_path}queues/#{@retry['queue']}" #{@retry['queue']}
tr
th Job Class
th = t('Class')
td
code= @retry['class']
tr
th Job Arguments
th = t('Arguments')
td
code= display_args(@retry['args'], 1000)
tr
th Job ID
th JID
td
code= @retry.jid
- if @retry['retry_count'] > 0
tr
th Retry Count
th = t('RetryCount')
td= @retry['retry_count']
tr
th Last Retry
th = t('LastRetry')
td== relative_time(@retry['retried_at'].is_a?(Numeric) ? Time.at(@retry['retried_at']) : Time.parse(@retry['retried_at']))
- else
tr
th Originally Failed
th = t('OriginallyFailed')
td== relative_time(@retry['failed_at'].is_a?(Numeric) ? Time.at(@retry['failed_at']) : Time.parse(@retry['failed_at']))
tr
th Next Retry
th = t('NextRetry')
td== relative_time(Time.at(@retry.score))
h3 Error
h3 = t('Error')
table class="error table table-bordered table-striped"
tbody
tr
th Error Class
th = t('ErrorClass')
td
code= @retry['error_class']
tr
th Error Message
th = t('ErrorMessage')
td= @retry['error_message']
- if !@retry['error_backtrace'].nil?
tr
th Error Backtrace
th = t('ErrorBacktrace')
td
code== @retry['error_backtrace'].join("<br/>")
form.form-horizontal action="#{root_path}retries/#{job_params(@retry, @retry.score)}" method="post"
a.btn href="#{root_path}retries" ← Back
input.btn.btn-primary type="submit" name="retry" value="Retry Now"
input.btn.btn-danger type="submit" name="delete" value="Delete"
a.btn href="#{root_path}retries" = t('GoBack')
input.btn.btn-primary type="submit" name="retry" value="#{t('RetryNow')}"
input.btn.btn-danger type="submit" name="delete" value="#{t('Delete')}"

14
web/views/scheduled.slim Executable file → Normal file
View file

@ -1,6 +1,6 @@
header.row
.span5
h3 Scheduled Jobs
h3 = t('ScheduledJobs')
.span4
- if @scheduled.size > 0
== slim :_paging, :locals => { :url => "#{root_path}scheduled" }
@ -12,10 +12,10 @@ header.row
thead
th width="20px"
input type="checkbox" class="check_all"
th width="25%" When
th width="10%" Queue
th Worker
th Args
th width="25%" = t('When')
th width="10%" = t('Queue')
th = t('Worker')
th = t('Arguments')
- @scheduled.each do |msg, score|
tr
td
@ -25,6 +25,6 @@ header.row
a href="#{root_path}queues/#{msg['queue']}" #{msg['queue']}
td= msg['class']
td= display_args(msg['args'])
input.btn.btn-danger.pull-right type="submit" name="delete" value="Delete"
input.btn.btn-danger.pull-right type="submit" name="delete" value="#{t('Delete')}"
- else
.alert.alert-success No scheduled jobs were found
.alert.alert-success = t('NoScheduledFound')