Permalink
Browse files

Convert all .l calls to t(

  • Loading branch information...
1 parent 7d17777 commit 02249a9e7f05708c0a53eb1c7313cb506e819fc1 @jamesu jamesu committed Sep 23, 2010
Showing with 208 additions and 227 deletions.
  1. +1 −1 app/controllers/accounts_controller.rb
  2. +1 −1 app/controllers/albums_controller.rb
  3. +2 −2 app/controllers/application_controller.rb
  4. +2 −2 app/controllers/journals_controller.rb
  5. +1 −1 app/controllers/lists_controller.rb
  6. +6 −6 app/controllers/reminders_controller.rb
  7. +1 −1 app/controllers/statuses_controller.rb
  8. +2 −2 app/controllers/users_controller.rb
  9. +10 −10 app/helpers/application_helper.rb
  10. +1 −1 app/helpers/journals_helper.rb
  11. +1 −1 app/models/application_log.rb
  12. +1 −1 app/models/mailman.rb
  13. +4 −4 app/models/notifier.rb
  14. +1 −1 app/models/page.rb
  15. +2 −2 app/models/reminder.rb
  16. +11 −11 app/views/accounts/_form.html.haml
  17. +3 −3 app/views/accounts/show.html.haml
  18. +3 −3 app/views/album_pictures/_form.html.haml
  19. +1 −1 app/views/album_pictures/_show.html.haml
  20. +5 −5 app/views/albums/_form.html.haml
  21. +1 −1 app/views/albums/_show.html.haml
  22. +3 −3 app/views/dashboards/_user_activity.html.haml
  23. +1 −1 app/views/dashboards/show.html.haml
  24. +2 −2 app/views/emails/_show.html.haml
  25. +3 −3 app/views/emails/show.html.haml
  26. +2 −2 app/views/journals/_form.html.haml
  27. +1 −1 app/views/journals/_users_sidebar.html.haml
  28. +4 −4 app/views/journals/index.html.haml
  29. +4 −4 app/views/layouts/_tabs.html.haml
  30. +3 −3 app/views/layouts/page.html.haml
  31. +1 −1 app/views/layouts/public_page.html.haml
  32. +2 −2 app/views/list_items/_form.html.haml
  33. +2 −2 app/views/list_items/_show.html.haml
  34. +2 −2 app/views/lists/_form.html.haml
  35. +4 −4 app/views/lists/_show.html.haml
  36. +4 −4 app/views/notes/_form.html.haml
  37. +2 −2 app/views/notes/_show.html.haml
  38. +2 −2 app/views/notifier/page_share_info.erb
  39. +1 −1 app/views/notifier/password_reset.erb
  40. +3 −3 app/views/notifier/reminder.erb
  41. +4 −4 app/views/notifier/signup_notification.erb
  42. +2 −2 app/views/pages/_form.html.haml
  43. +1 −1 app/views/pages/_listed_pages.html.haml
  44. +3 −3 app/views/pages/_page_sidebar.html.haml
  45. +5 −5 app/views/pages/index.html.haml
  46. +3 −3 app/views/pages/new.html.haml
  47. +7 −7 app/views/pages/share.html.haml
  48. +13 −13 app/views/pages/show.html.haml
  49. +2 −2 app/views/pages/show.rss.builder
  50. +4 −4 app/views/reminders/_form.html.haml
  51. +3 −3 app/views/reminders/_group.html.haml
  52. +3 −3 app/views/reminders/index.html.haml
  53. +3 −3 app/views/separators/_form.html.haml
  54. +9 −9 app/views/sessions/new.html.haml
  55. +4 −4 app/views/sessions/new_token.html.haml
  56. +2 −2 app/views/statuses/_form.html.haml
  57. +2 −2 app/views/tags/_form.html.haml
  58. +3 −3 app/views/uploaded_files/_form.html.haml
  59. +11 −11 app/views/users/_form.html.haml
  60. +3 −3 app/views/users/edit.html.haml
  61. +4 −4 app/views/users/forgot_password.html.haml
  62. +4 −4 app/views/users/index.html.haml
  63. +3 −3 app/views/users/new.html.haml
  64. +4 −4 app/views/users/reset_password.html.haml
  65. +0 −19 lib/rucksack_extras.rb
@@ -44,7 +44,7 @@ def update
respond_to do |format|
if @account.update_attributes(params[:account])
- flash[:notice] = :settings_updated.l
+ flash[:notice] = t('settings_updated')
format.html { redirect_back_or_default(:action => 'show') }
format.xml { head :ok }
else
@@ -80,7 +80,7 @@ def create
# Make the darn note
@album = @page.albums.build(params[:album])
@album.created_by = @logged_user
- @album.title ||= :album.l
+ @album.title ||= t('album')
saved = @album.save
# And the slot, don't forget the slot
@@ -42,10 +42,10 @@ class ApplicationController < ActionController::Base
def error_status(error, message, args={}, continue_ok=true)
if request.format == :html
flash[:error] = error
- flash[:message] = message.l_with_args(args)
+ flash[:message] = t(message, args)
else
@flash_error = error
- @flash_message = message.l_with_args(args)
+ @flash_message = t(message, args)
end
return unless (error and continue_ok)
@@ -160,9 +160,9 @@ def get_groups(list)
list.group_by do |journal|
date = journal.created_at.to_date
if date == now
- :journal_date_today.l
+ t('journal_date_today')
else
- date.strftime(date.year == now.year ? :journal_date_format.l : :journal_date_format_extended.l)
+ date.strftime(date.year == now.year ? t('journal_date_format') : t('journal_date_format_extended'))
end
end
end
@@ -80,7 +80,7 @@ def create
# Make the darn note
@list = @page.lists.build(params[:list])
@list.created_by = @logged_user
- @list.name ||= :List.l
+ @list.name ||= t('List')
saved = @list.save
# And the slot, don't forget the slot
@@ -157,17 +157,17 @@ def get_groups
time = obj.at_time
if time.year > @now.year # Distant future
- [time.strftime(:reminder_due_future.l), 'dueFuture', :date_format_md]
+ [time.strftime(t('reminder_due_future')), 'dueFuture', :date_format_md]
elsif time.month > @now.month # Rest of year (monthly)
- [time.strftime(:reminder_due_months.l), "dueMonths#{time.month-@now.month}", :date_format_mwd]
+ [time.strftime(t('reminder_due_months')), "dueMonths#{time.month-@now.month}", :date_format_mwd]
elsif time.day > @now.day+1 # Rest of the current month (excluding tomorrow)
- [time.strftime(:reminder_due_days.l), "dueDays#{time.day-@now.day}", :date_format_time]
+ [time.strftime(t('reminder_due_days')), "dueDays#{time.day-@now.day}", :date_format_time]
elsif time.day > @now.day # Tomorrow
- [:reminder_due_tomorrow.l, 'dueTomorrow', :date_format_time]
+ [t('reminder_due_tomorrow'), 'dueTomorrow', :date_format_time]
elsif time.day == @now.day and time > @now
- [:reminder_due_today.l, 'dueToday', (time.hour > @now.hour ? :due_format_hours : :due_upcomming)]
+ [t('reminder_due_today'), 'dueToday', (time.hour > @now.hour ? :due_format_hours : :due_upcomming)]
else
- [:reminder_done.l, 'done', :done]
+ [t('reminder_done'), 'done', :done]
end
end
end
@@ -47,7 +47,7 @@ def show
# PUT /statuses/1
# PUT /statuses/1.xml
def update
- @status = @user.status || @user.build_status(:content => :status.l)
+ @status = @user.status || @user.build_status(:content => t('status'))
return error_status(true, :cannot_edit_status) unless (@status.can_be_edited_by(@logged_user))
@status.attributes = params[:status]
@@ -208,12 +208,12 @@ def reset_password
@password_data = params[:user]
unless @password_data[:password]
- @user.errors.add(:password, :new_password_required.l)
+ @user.errors.add(:password, t('new_password_required'))
return
end
unless @password_data[:password] == @password_data[:password_confirmation]
- @user.errors.add(:password_confirmation, :does_not_match.l)
+ @user.errors.add(:password_confirmation, t('does_not_match'))
return
end
@@ -29,7 +29,7 @@ def site_name
unless Account.owner.site_name.empty?
html_escape Account.owner.site_name
else
- html_escape "#{Account.owner.owner.display_name.pluralize} #{:product_name.l}"
+ html_escape "#{Account.owner.owner.display_name.pluralize} #{t('product_name')}"
end
end
@@ -38,15 +38,15 @@ def site_account
end
def product_signature
- :product_signature.l
+ t('product_signature')
end
def pagination_links(url, ids)
values = ids.collect do |id|
"<a href=\"#{url}page=#{id}\">#{id}</a>"
end.join ' | '
- "<div class=\"advancedPagination\"><span>{:page.l} </span><span>(#{values})</span></div>"
+ "<div class=\"advancedPagination\"><span>{t('page')} </span><span>(#{values})</span></div>"
end
def checkbox_link(link, checked=false, hint=nil, attrs={})
@@ -109,23 +109,23 @@ def page_handle(actions, id, resType)
def widget_options(object)
opts = []
opts << ['delete', '-'] if object.can_be_deleted_by(@logged_user)
- opts << ['edit', :edit.l] if object.class != Journal and object.can_be_edited_by(@logged_user)
+ opts << ['edit', t('edit')] if object.class != Journal and object.can_be_edited_by(@logged_user)
opts << ['handle', '+'] unless [Reminder, Journal].include? object.class
opts
end
def yesno_toggle(object_name, method, options = {})
radio_button(object_name, method, "true", options.merge({:id => "#{options[:id]}Yes"})) +
- " <label for=\"#{options[:id]}Yes\" class=\"#{options[:class]}\">#{:yesno_yes.l}</label> ".html_safe +
+ " <label for=\"#{options[:id]}Yes\" class=\"#{options[:class]}\">#{t('yesno_yes')}</label> ".html_safe +
radio_button(object_name, method, "false", options.merge({:id => "#{options[:id]}No"})) +
- " <label for=\"#{options[:id]}No\" class=\"#{options[:class]}\">#{:yesno_no.l}</label>".html_safe
+ " <label for=\"#{options[:id]}No\" class=\"#{options[:class]}\">#{t('yesno_no')}</label>".html_safe
end
def yesno_toggle_tag(name, is_yes, options = {})
radio_button_tag(name, "1", is_yes, options.merge({:id => "#{options[:id]}Yes"})) +
- " <label for=\"#{options[:id]}Yes\" class=\"#{options[:class]}\">#{:yesno_yes.l}</label> ".html_safe +
+ " <label for=\"#{options[:id]}Yes\" class=\"#{options[:class]}\">#{t('yesno_yes')}</label> ".html_safe +
radio_button_tag(name, "0", !is_yes, options.merge({:id => "#{options[:id]}No"})) +
- " <label for=\"#{options[:id]}No\" class=\"#{options[:class]}\">#{:yesno_no.l}</label>".html_safe
+ " <label for=\"#{options[:id]}No\" class=\"#{options[:class]}\">#{t('yesno_no')}</label>".html_safe
end
def common_tabs(current)
@@ -147,8 +147,8 @@ def user_tabs(current)
end
def actions_for_reminder(reminder)
- [{:name => :snooze.l, :class => 'reminderSnooze', :url => '#', :cond => true},
- {:name => :delete.l, :class => 'reminderDelete', :url => '#', :cond => true}]
+ [{:name => t('snooze'), :class => 'reminderSnooze', :url => '#', :cond => true},
+ {:name => t('delete'), :class => 'reminderDelete', :url => '#', :cond => true}]
end
def status_bar
@@ -1,7 +1,7 @@
module JournalsHelper
def fancy_journal_time(time)
if @time_now > time + 1.day
- time.strftime(:date_format_time.l)
+ time.strftime(t('date_format_time'))
else
distance_of_time_in_words(time, Time.zone.now) + " ago"
end
@@ -32,7 +32,7 @@ class ApplicationLog < ActiveRecord::Base
@@action_id_lookup = @@action_lookup.invert
def friendly_action
- "action_#{self.action}".to_sym.l
+ t "action_#{self.action}"
end
def action
View
@@ -164,7 +164,7 @@ def process_fwd(name, page, email, responsible_user)
def process_list(name, page, email, responsible_user)
page_list = page.lists.build(
- :name => name.nil? ? :list.l : name)
+ :name => name.nil? ? t('list') : name)
page_list.created_by = responsible_user
View
@@ -26,7 +26,7 @@
class Notifier < ActionMailer::Base
def reminder(reminder, sent_at = Time.now)
- @subject = "#{:reminder.l} - #{reminder.content}"
+ @subject = "#{t('reminder')} - #{reminder.content}"
@recipients = reminder.created_by.email
@from = "noreply@#{Account.owner.host_name}"
@sent_on = sent_at
@@ -41,7 +41,7 @@ def reminder(reminder, sent_at = Time.now)
end
def page_share_info(user, page)
- @subject = :user_wants_to_share_page.l_with_args(
+ @subject = t('user_wants_to_share_page',
:user => page.updated_by.display_name,
:page => page.title)
@recipients = user.email
@@ -59,15 +59,15 @@ def page_share_info(user, page)
def signup_notification(user)
setup_email(user)
- @subject += :notifier_signup_subject.l
+ @subject += t('notifier_signup_subject')
@body[:owner] = Account.owner
@body[:url] = "http://#{Account.owner.host_name}/login"
end
def password_reset(user)
setup_email(user)
- @subject += :notifier_password_reset_subject.l
+ @subject += t('notifier_password_reset_subject')
@recipients = user.email
@from = "noreply@#{Account.owner.host_name}"
@sent_on = Time.now
View
@@ -256,7 +256,7 @@ def duplicate(new_owner)
Page.transaction do
new_page = self.clone
- new_page.title = :copy_of_page.l_with_args(:title => self.title)
+ new_page.title = t('copy_of_page', :title => self.title)
new_page.created_by = new_owner
new_page.address = 'random'
new_page.save!
View
@@ -87,7 +87,7 @@ def snooze(interval={:minutes => 15})
end
def friendly_repeat
- "reminder_repeat_#{self.repeat}".to_sym.l
+ t "reminder_repeat_#{self.repeat}"
end
def repeat
@@ -172,7 +172,7 @@ def self.dispatch_and_clean
def self.select_repeat
@@repeat_lookup.keys.map do |key|
- ["reminder_repeat_#{key}".to_sym.l, key]
+ [t("reminder_repeat_#{key}"), key]
end
end
@@ -1,31 +1,31 @@
= error_messages_for :account
%div
- %label{:for => 'settingsFormSiteName'}= :site_name.l
+ %label{:for => 'settingsFormSiteName'}= t('site_name')
= text_field 'account', 'site_name', :id => 'settingsFormSiteName', :class => 'long'
- %p.desc= :site_name_info.l
+ %p.desc= t('site_name_info')
%div
- %label{:for => 'settingsFormHostName'}= :host_name.l
+ %label{:for => 'settingsFormHostName'}= t('host_name')
= text_field 'account', 'host_name', :id => 'settingsFormHostName', :class => 'moderate'
- %p.desc= :host_name_info.l
+ %p.desc= t('host_name_info')
%div
= check_box 'account', 'openid_enabled', :id => 'settingsFormOpenID'
- %label.checkbox{:for => 'settingsFormOpenID'}= :openid_enabled.l
- %p.desc= :openid_info.l
+ %label.checkbox{:for => 'settingsFormOpenID'}= t('openid_enabled')
+ %p.desc= t('openid_info')
%div
%span{:style => 'display: block;'}
- %span{:style => 'font-weight: bold;'}= :tabs_visible.l
- %span{:style => 'font-size: 90%; color: #555555;'}= "(#{:tabs_visible_info.l})"
+ %span{:style => 'font-weight: bold;'}= t('tabs_visible')
+ %span{:style => 'font-size: 90%; color: #555555;'}= "(#{t('tabs_visible_info')})"
- Account::Tabs.each do |tab|
= check_box 'account', "#{tab}_hidden", :id => "setting_#{tab}_hidden"
- %label.checkbox{:for => "setting_#{tab}_hidden"}= tab.to_sym.l
+ %label.checkbox{:for => "setting_#{tab}_hidden"}= t tab
- Account::Colours.each do |colour|
%div
- %label= "#{colour.to_sym.l} #{:colour.l}"
+ %label= "#{t(colour)} #{t('colour')}"
= text_field 'account', "#{colour}_colour", :id => 'setting_#{colour}_colour', :class => 'short'
- %span{:style => 'font-size: 75%; color: #555555;'}= "(#{:colour_info.l})"
+ %span{:style => 'font-size: 75%; color: #555555;'}= "(#{t('colour_info')})"
%div{:style => "border: 1px solid #555555; background-color: #{site_account.send("#{colour}_colour")}; float: left; width: 50px; height: 16px; margin-top: 2px; margin-right: 10px;"}
@@ -1,11 +1,11 @@
-- @page_title = :settings.l
+- @page_title = t('settings')
- @tabbed_navigation_items = common_tabs(nil)
- @user_navigation_items = user_tabs(:settings)
#settingsForm
- form_tag account_path(), :method => :put do
= render :partial => 'form'
%div.formSubmit
- %button.submit{:type => 'submit'}= :save.l
- %a.cancel{:href => '/'}= :cancel.l
+ %button.submit{:type => 'submit'}= t('save')
+ %a.cancel{:href => '/'}= t('cancel')
@@ -1,11 +1,11 @@
- if @album_picture.nil? or @album_picture.new_record?
- url = page_album_album_pictures_path(@page, @album || object)
- mth = :post
- - action_name = :add_picture.l
+ - action_name = t('add_picture')
- else
- url = page_album_album_picture_path(@page, @album, @album_picture)
- mth = :put
- - action_name = :update.l
+ - action_name = t('update')
- form_tag url, :method => mth, :multipart => true do
%div
@@ -14,4 +14,4 @@
= text_field 'picture', 'caption', :class => 'autofocus long', :size => 18
%div
%button.submit{:type => 'submit'}= action_name
- %a.cancel{:href => '#'}= :cancel.l
+ %a.cancel{:href => '#'}= t('cancel')
@@ -3,7 +3,7 @@
%li.albumPicture{:id => "album_picture_#{show.id}", :picture_id => show.id, :url => url}
.albumPictureContent
- if show.can_be_edited_by(@logged_user)
- = page_handle [ ['delete', '-'], ['edit', :edit.l], ['handle', '+'] ], "page_picture_handle_#{show.id}", '.albumPicture'
+ = page_handle [ ['delete', '-'], ['edit', t('edit')], ['handle', '+'] ], "page_picture_handle_#{show.id}", '.albumPicture'
%a{:href => show.picture.url}
%img{:src => show.picture.url(:album), :hover_handle => "page_picture_handle_#{show.id}"}
.albumPictureCaption= textilize show.caption, true
@@ -9,17 +9,17 @@
- form_tag( fpath, :method => fmethod, :class => fid) do
- if @album.nil? or @album.new_record?
- %h2= :add_album.l
+ %h2= t('add_album')
%div
- %label{:for => 'noteFormTitle'}= :album_title.l
+ %label{:for => 'noteFormTitle'}= t('album_title')
!= text_field 'album', 'title', :id => 'albumFormTitle', :class => 'autofocus long'
- if @album.nil? or @album.new_record?
%input#add_AlbumFormBefore{:type => 'hidden', :name=> 'position[before]', :value => '0'}/
%input#add_AlbumFormSlot{:type => 'hidden', :name=> 'position[slot]', :value => '0'}/
- %button{:class => 'submit', :type => 'submit'}= :create.l
+ %button{:class => 'submit', :type => 'submit'}= t('create')
- else
- %button{:class => 'submit', :type => 'submit'}= :edit_album.l
+ %button{:class => 'submit', :type => 'submit'}= t('edit_album')
- %a{:href => '#', :class => 'cancel'}= :cancel.l
+ %a{:href => '#', :class => 'cancel'}= t('cancel')
@@ -13,5 +13,5 @@
.inner{:style => (@new_album.nil? ? 'display:none' : nil)}
= render :partial => 'album_pictures/form', :locals => {:object => object}
.newPicture{:style => (@new_album.nil? ? nil : 'display:none')}
- %a{:href => '#'}= :add_picture.l
+ %a{:href => '#'}= t('add_picture')
.clear
@@ -2,18 +2,18 @@
%div.activityUser
%div.activityUserAvatar
%img{:src => user.gravatar_url(:size => 30)}
- = user.id == @logged_user.id ? :you.l : user.display_name
+ = user.id == @logged_user.id ? t('you') : user.display_name
%div.activityUserEntries
%ul
- user_activity[1].each do |log|
%li.activityEntry
-# "#{log.action} (#{log.rel_object_id} #{log.rel_object_type}) | p:#{log.page_id} by #{log.created_by_id}"
- if !log.page_id.nil?
- = "activity_edit_Page".to_sym.l_with_args(:object_name => log.page.object_name, :previous_name => log.previous_name, :url => !log.page.nil? ? url_for(log.page) : '#')
+ = t "activity_edit_Page", :object_name => log.page.object_name, :previous_name => log.previous_name, :url => !log.page.nil? ? url_for(log.page) : '#'
-# "(#{log.created_on.to_s})"
- else
- = "activity_#{log.action}_#{log.rel_object_type}".to_sym.l_with_args(:object_name => log.object_name, :previous_name => log.previous_name, :url => !log.rel_object.nil? ? url_for(log.rel_object) : '#')
+ = t "activity_#{log.action}_#{log.rel_object_type}", :object_name => log.object_name, :previous_name => log.previous_name, :url => !log.rel_object.nil? ? url_for(log.rel_object) : '#'
-# "(#{log.created_on.to_s})"
Oops, something went wrong.

0 comments on commit 02249a9

Please sign in to comment.