Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Merge branch 'localhost_master' into i18n

Conflicts:
	README.rdoc
	app/controllers/sessions_controller.rb
	app/controllers/users_controller.rb
	app/helpers/users_helper.rb
	app/views/forums/index.html.erb
	app/views/layouts/_head.html.erb
	app/views/layouts/application.html.erb
	app/views/posts/index.html.erb
	app/views/sites/_form.html.erb
	app/views/sites/index.html.erb
	app/views/topics/show.html.erb
	app/views/users/edit.html.erb
	app/views/users/show.html.erb
	db/schema.rb
  • Loading branch information...
commit 7a8990e61f1c8b0f9f2f8eeccbe11475b9779851 2 parents 1d9ef5d + da3acf6
@courtenay courtenay authored
Showing with 951 additions and 804 deletions.
  1. +3 −0  .gitmodules
  2. +1 −0  README.rdoc
  3. +8 −0 app/controllers/application.rb
  4. +2 −2 app/controllers/forums_controller.rb
  5. +4 −4 app/controllers/sessions_controller.rb
  6. +1 −1  app/controllers/sites_controller.rb
  7. +14 −4 app/controllers/users_controller.rb
  8. +6 −30 app/helpers/application_helper.rb
  9. +0 −8 app/helpers/forums_helper.rb
  10. +6 −3 app/helpers/users_helper.rb
  11. +4 −2 app/models/user/validation.rb
  12. +3 −3 app/views/forums/_form.html.erb
  13. +3 −3 app/views/forums/edit.html.erb
  14. +25 −24 app/views/forums/index.html.erb
  15. +3 −3 app/views/forums/new.html.erb
  16. +22 −25 app/views/forums/show.html.erb
  17. +13 −15 app/views/layouts/_head.html.erb
  18. +23 −22 app/views/layouts/application.html.erb
  19. +4 −14 app/views/posts/_edit.html.erb
  20. +9 −0 app/views/posts/_formatting.erb
  21. +4 −4 app/views/posts/edit.html.erb
  22. +6 −6 app/views/posts/index.html.erb
  23. +5 −5 app/views/sessions/new.html.erb
  24. +2 −2 app/views/sessions/new.rhtml
  25. +4 −4 app/views/sites/_form.html.erb
  26. +3 −3 app/views/sites/edit.html.erb
  27. +14 −14 app/views/sites/index.html.erb
  28. +4 −4 app/views/sites/new.html.erb
  29. +6 −2 app/views/sites/show.html.erb
  30. +5 −5 app/views/topics/_form.html.erb
  31. +2 −2 app/views/topics/edit.html.erb
  32. +4 −4 app/views/topics/new.html.erb
  33. +25 −38 app/views/topics/show.html.erb
  34. +7 −7 app/views/users/_contact_info.html.erb
  35. +9 −9 app/views/users/_settings.html.erb
  36. +8 −8 app/views/users/edit.html.erb
  37. +10 −10 app/views/users/index.html.erb
  38. +7 −5 app/views/users/new.rhtml
  39. +15 −15 app/views/users/show.html.erb
  40. +10 −0 config/environment.rb
  41. +1 −1  config/environments/development.rb
  42. +311 −0 config/locales/de.yml
  43. +143 −0 config/locales/en.rb
  44. +134 −0 config/locales/en.yml
  45. +37 −0 db/migrate/002_add_brain_buster.rb
  46. +5 −0 db/schema.rb
  47. +1 −2  public/javascripts/application.js
  48. +0 −75 public/javascripts/time.js
  49. +14 −0 public/stylesheets/captcha.css
  50. +1 −0  vendor/plugins/brain_buster
  51. +0 −18 vendor/plugins/gibberish/LICENSE
  52. +0 −113 vendor/plugins/gibberish/README
  53. +0 −3  vendor/plugins/gibberish/init.rb
  54. +0 −3  vendor/plugins/gibberish/lang/es.yml
  55. +0 −3  vendor/plugins/gibberish/lang/fr.yml
  56. +0 −8 vendor/plugins/gibberish/lib/gibberish.rb
  57. +0 −69 vendor/plugins/gibberish/lib/gibberish/localize.rb
  58. +0 −17 vendor/plugins/gibberish/lib/gibberish/string_ext.rb
  59. +0 −182 vendor/plugins/gibberish/test/gibberish_test.rb
View
3  .gitmodules
@@ -0,0 +1,3 @@
+[submodule "vendor/plugins/brain_buster"]
+ path = vendor/plugins/brain_buster
+ url = git://github.com/rsanheim/brain_buster.git
View
1  README.rdoc
@@ -11,6 +11,7 @@ The popular rails-based Beast forum, rewritten from the ground up with the same
* email and atom feed support
* xml/json API (not 100% tested yet, fixing soon)
* highline based easy console installer
+* internationalization via the I18n framework
Help desired via git:
View
8 app/controllers/application.rb
@@ -4,6 +4,7 @@ class ApplicationController < ActionController::Base
include AuthenticatedSystem
helper :all
helper_method :current_page
+ before_filter :set_language
before_filter :login_required, :only => [:new, :edit, :create, :update, :destroy]
# See ActionController::RequestForgeryProtection for details
@@ -21,4 +22,11 @@ class ApplicationController < ActionController::Base
def current_page
@page ||= params[:page].blank? ? 1 : params[:page].to_i
end
+
+ private
+
+ def set_language
+ I18n.locale = :en || I18n.default_locale
+ end
+
end
View
4 app/controllers/forums_controller.rb
@@ -53,7 +53,7 @@ def create
respond_to do |format|
if @forum.save
- flash[:notice] = 'Forum was successfully created.'
+ flash[:notice] = I18n.t 'txt.forum_created', :default => 'Forum was successfully created.'
format.html { redirect_to(@forum) }
format.xml { render :xml => @forum, :status => :created, :location => @forum }
else
@@ -70,7 +70,7 @@ def update
respond_to do |format|
if @forum.update_attributes(params[:forum])
- flash[:notice] = 'Forum was successfully updated.'
+ flash[:notice] = I18n.t 'txt.forum_updated', :default => 'Forum was successfully updated.'
format.html { redirect_to(@forum) }
format.xml { head :ok }
else
View
8 app/controllers/sessions_controller.rb
@@ -16,10 +16,10 @@ def create
cookies[:auth_token] = { :value => current_user.remember_token , :expires => current_user.remember_token_expires_at }
end
redirect_back_or_default('/')
- flash[:notice] = "Logged in successfully"
+ flash[:notice] = I18n.t 'txt.successful_login', :default => "Logged in successfully"
else
- flash[:error] = "Invalid login"
- render :action => 'new'
+ flash[:error] = I18n.t 'txt.invalid_login', :default => "Invalid login"
+ redirect_back_or_default(login_path)
end
end
@@ -27,7 +27,7 @@ def destroy
current_user.forget_me if logged_in?
cookies.delete :auth_token
reset_session
- flash[:notice] = "You have been logged out."
+ flash[:notice] = I18n.t 'txt.logged_out', :default => "You have been logged out."
redirect_back_or_default('/')
end
end
View
2  app/controllers/sites_controller.rb
@@ -1,5 +1,5 @@
class SitesController < ApplicationController
- before_filter :admin_required, :only => [ :destroy, :update, :edit ]
+ before_filter :admin_required
def index
@sites = Site.paginate(:all, :page => current_page, :order => 'host ASC')
View
18 app/controllers/users_controller.rb
@@ -2,7 +2,11 @@ class UsersController < ApplicationController
before_filter :admin_required, :only => [:suspend, :unsuspend, :destroy, :purge, :edit]
before_filter :find_user, :only => [:update, :show, :edit, :suspend, :unsuspend, :destroy, :purge]
before_filter :login_required, :only => [:settings, :update]
-
+
+ # Brainbuster Captcha
+ before_filter :create_brain_buster, :only => [:new]
+ before_filter :validate_brain_buster, :only => [:create]
+
def index
users_scope = admin? ? :all_users : :users
if params[:q]
@@ -20,10 +24,11 @@ def create
cookies.delete :auth_token
@user = current_site.users.build(params[:user])
@user.save if @user.valid?
+ @user.register! if @user.valid?
unless @user.new_record?
- @user.register!
redirect_back_or_default('/login')
- flash[:notice] = "Thanks for signing up! Please click the link in your email to activate your account"
+ flash[:notice] = I18n.t 'txt.activation_required',
+ :default => "Thanks for signing up! Please click the link in your email to activate your account"
else
render :action => 'new'
end
@@ -31,6 +36,7 @@ def create
def settings
@user = current_user
+ current_site
render :action => "edit"
end
@@ -100,8 +106,12 @@ def find_user
current_site.users.find_by_permalink(params[:id])
end or raise ActiveRecord::RecordNotFound
end
-
+
def authorized?
admin? || params[:id].blank? || params[:id] == current_user.permalink
end
+
+ def render_or_redirect_for_captcha_failure
+ render :action => 'new'
+ end
end
View
36 app/helpers/application_helper.rb
@@ -7,22 +7,22 @@ def feed_icon_tag(title, url)
def pagination(collection)
if collection.total_entries > 1
- "<p class='pages'>" + 'Pages'[:pages_title] + ": <strong>" +
- will_paginate(collection, :inner_window => 10, :next_label => "next"[], :prev_label => "previous"[]) +
+ "<p class='pages'>" + I18n.t('txt.pages', :default => 'Pages') + ": <strong>" +
+ will_paginate(collection, :inner_window => 10, :next_label => I18n.t('txt.page_next', :default => 'next'), :prev_label => I18n.t('txt.page_prev', :default => 'previous')) +
"</strong></p>"
end
end
def next_page(collection)
unless collection.current_page == collection.total_entries or collection.total_entries == 0
- "<p style='float:right;'>" + link_to("Next page"[], { :page => collection.current_page.next }.merge(params.reject{|k,v| k=="page"})) + "</p>"
+ "<p style='float:right;'>" + link_to(I18n.t('txt.next_page', :default => 'next page'), { :page => collection.current_page.next }.merge(params.reject{|k,v| k=="page"})) + "</p>"
end
end
def search_posts_title
- returning(params[:q].blank? ? 'Recent Posts'[] : "Searching for"[] + " '#{h params[:q]}'") do |title|
- title << " "+'by {user}'[:by_user,h(@user.display_name)] if @user
- title << " "+'in {forum}'[:in_forum,h(@forum.name)] if @forum
+ returning(params[:q].blank? ? I18n.t('txt.recent_posts', :default => 'Recent Posts') : I18n.t('txt.searching_for', :default => 'Searching for') + " '#{h params[:q]}'") do |title|
+ title << " " + I18n.t('txt.by_user', :default => 'by {{user}}', :user => h(@user.display_name)) if @user
+ title << " " + I18n.t('txt.in_forum', :default => 'in {{forum}}', :forum => h(@forum.name)) if @forum
end
end
@@ -61,32 +61,8 @@ def search_path(atom = false)
atom ? send("formatted_#{prefix}_posts_path", options.update(:format => :atom)) : send("#{prefix}_posts_path", options)
end
- @@default_jstime_format = "%d %b, %Y %I:%M %p"
- def jstime(time, format = nil)
- content_tag 'span', time.strftime(format || @@default_jstime_format), :class => 'time'
- end
-
def for_moderators_of(record, &block)
moderator_of?(record) && concat(capture(&block))
end
- def main_site
- @main_site ||= Site.find(:first)
- end
-
- def main_site_name
- @main_site_name ||= main_site ? @main_site.name :
- "Altered Beast"
- end
-
- def main_site_description
- @main_site_description ||= main_site ? @main_site.description :
- "<h5>What is Beast?</h5><p>A small, light-weight forum in Rails with a scary name and a goal of around 500 lines of code when we're done.</p>"
- end
-
- def main_site_tagline
- @main_site_tagline ||= main_site ? @main_site.tagline :
- "Two's company. Three's a forum. More's a Beast."
- end
-
end
View
8 app/helpers/forums_helper.rb
@@ -10,14 +10,6 @@ def recent_forum_activity(forum)
return false unless logged_in? && forum.recent_topic
return forum.recent_topic.last_updated_at > ((session[:forums] ||= {})[forum.id] || last_active)
end
-
- def topic_count
- pluralize current_site.topics.size, 'topic'
- end
-
- def post_count
- pluralize current_site.posts.size, 'post'
- end
def last_active
session[:last_active] ||= Time.now.utc
View
9 app/helpers/users_helper.rb
@@ -1,17 +1,20 @@
module UsersHelper
# todo: make this use "size" instead of "count" and maybe cache it
def user_count
- pluralize current_site.users.count, 'user'[:user]
+ count = current_site.users.count
+ I18n.t 'txt.count_users', :count => count, :num => number_with_delimiter(count)
end
# todo: cache this?
def active_user_count
- pluralize current_site.users.count(:conditions => "users.posts_count > 0"), 'active user'[:active_user]
+ count = current_site.users.count(:conditions => "posts_count > 0")
+ I18n.t 'txt.count_users_active', :count => count, :num => number_with_delimiter(count)
end
# todo: cache this?
def lurking_user_count
- pluralize current_site.users.count(:conditions => "users.posts_count < 1"), 'lurking user'[:lurking_user]
+ count = current_site.users.count(:conditions => "posts_count = 0")
+ I18n.t 'txt.count_users_lurking', :count => count, :num => number_with_delimiter(count)
end
#
View
6 app/models/user/validation.rb
@@ -3,6 +3,7 @@ class User
# Virtual attribute for the unencrypted password
attr_accessor :password
+ before_validation :normalize_login_and_email
validates_presence_of :login, :email
validates_presence_of :password, :if => :password_required?
validates_presence_of :password_confirmation, :if => :password_required?
@@ -11,7 +12,6 @@ class User
validates_length_of :login, :within => 3..40
validates_length_of :email, :within => 3..100
validates_uniqueness_of :login, :email, :scope => :site_id
- before_save :downcase_email_and_login
before_save :encrypt_password
before_create :set_first_user_as_admin
@@ -50,8 +50,10 @@ def set_first_user_as_admin
self.admin = true if site and site.users.size.zero?
end
- def downcase_email_and_login
+ def normalize_login_and_email
login.downcase!
+ login.strip!
email.downcase!
+ return true
end
end
View
6 app/views/forums/_form.html.erb
@@ -5,11 +5,11 @@
<table border="0" cellspacing="0" cellpadding="0" class="noborder nopad wide">
<td>
- <label><%= 'Title'[:title_title] %></label><br />
+ <label><%= I18n.t 'txt.views_forums.title', :default => 'Title' %></label><br />
<%= form.text_field :name, :class => "primary" %>
</td>
<td style="text-align:right">
- <label><%= 'Position'[:position_title] %></label><br />
+ <label><%= I18n.t 'txt.views_forums.position', :default => 'Position' %></label><br />
<%= form.text_field :position, :size => 5 %>
</td>
@@ -17,5 +17,5 @@
</p>
<p id="forum_descripion">
-<label><%= 'Description'[:description_title] %></label><br />
+<label><%= I18n.t 'txt.views_forums.desc', :default => 'Description' %></label><br />
<%= form.text_area :description, :rows => 7 %></p>
View
6 app/views/forums/edit.html.erb
@@ -1,12 +1,12 @@
<div class="crumbs">
- <%= link_to 'Forums'[:forums_title], root_path %> <span class="arrow">&rarr;</span>
+ <%= link_to I18n.t('txt.forums', :default => 'Forums'), root_path %> <span class="arrow">&rarr;</span>
</div>
-<h1><%= 'Edit Forum'[:edit_forum] %></h1>
+<h1><%= I18n.t 'txt.views_forums.edit', :default => 'Edit Forum' %></h1>
<% form_for :forum,
:url => forum_path(@forum),
:html => { :method => :put } do |f| -%>
<%= render :partial => "form", :object => f %>
-<%= submit_tag 'Save Forum'[:save_forum] %> or <%= link_to('Cancel'[:cancel], forums_path) %>
+<%= submit_tag I18n.t('txt.save', :default => 'Save Forum') %> <%= I18n.t 'txt.or', :default => 'or' %> <%= link_to(I18n.t('txt.cancel', :default => 'Cancel'), forums_path) %>
<% end -%>
View
49 app/views/forums/index.html.erb
@@ -1,57 +1,59 @@
<% content_for :right do %>
-<% if @current_site %>
-<%= @current_site.description %>
-<% else %>
-<%= main_site_description %>
-<% end %>
+<h5><%= I18n.t 'txt.sidebar.beast_title', :default => 'What is Beast?' %></h5>
+
+<p>
+ <%= I18n.t 'txt.sidebar.beast_desc', :default => "A small, light-weight forum in Rails with a scary name and a goal of around 500 lines of code when we're done." %>
+</p>
<% if admin? %>
-<h6><%= 'Admin'[:admin_title] %></h6>
-<p><%= link_to 'Create New Forum'[:create_new_forum], new_forum_path, :class => "utility" %></p>
+<h6><%= I18n.t 'txt.admin.title', :default => 'Admin' %></h6>
+<p><%= link_to I18n.t('txt.admin.create_new_forum', :default => 'Create New Forum'), new_forum_path, :class => "utility" %></p>
<% end %>
<% end %>
-<h1 style="margin-top:0;"><%= 'Forums'[:forums_title] %></h1>
+<h1 style="margin-top:0;"><%= I18n.t 'txt.forums', :default => 'Forums' %></h1>
<p class="subtitle">
-<%= feed_icon_tag "Recent Posts"[:recent_posts], formatted_posts_path(:format => 'atom') %>
-<%= topic_count %>, <%= post_count %> <%# OPTIMIZE ME voice_count %>
+<%= feed_icon_tag I18n.t('txt.recent_posts', :default => "Recent Posts"), formatted_posts_path(:format => 'atom') %>
+<%= I18n.t 'txt.count_topics', :count => current_site.topics.size, :num => number_with_delimiter(current_site.topics.size) %>,
+<%= I18n.t 'txt.count_posts', :count => current_site.posts.size, :num => number_with_delimiter(current_site.posts.size) %>
+<%# OPTIMIZE ME voice_count %>
+
</p>
<table border="0" cellspacing="0" cellpadding="0" class="wide forums">
<tr>
- <th class="la" width="70%" colspan="3"><%= 'Forum'[:forum_title] %></th>
- <th class="la" width="30%" colspan="1"><%= 'Last Post'[:last_post] %></th>
+ <th class="la" width="70%" colspan="3"><%= I18n.t 'txt.forum', :default => 'Forum' %></th>
+ <th class="la" width="30%" colspan="1"><%= I18n.t 'txt.latest_post', :default => 'Last Post' %></th>
</tr>
<% for forum in @forums do %>
<tr>
<td class="vat c1">
<% if recent_forum_activity(forum) %>
- <%= image_tag "clearbits/comment.gif", :class => "icon green", :title => 'Recent activity'[:recent_activity] %>
+ <%= image_tag "clearbits/comment.gif", :class => "icon green", :title => I18n.t('txt.recent_activity', :default => 'Recent activity') %>
<% else %>
- <%= image_tag "clearbits/comment.gif", :class => "icon grey", :title => 'No recent activity'[:no_recent_activity] %>
+ <%= image_tag "clearbits/comment.gif", :class => "icon grey", :title => I18n.t('txt.no_recent_activity', :default => 'No recent activity') %>
<% end %>
</td>
<td class="c2 vat">
<%= link_to h(forum.name), forum_path(forum), :class => "title" %>
<div class="posts">
- <%= '{count} topics'[(count=forum.topics.size)==1 ? :topic_count : :topics_count, number_with_delimiter(count)] %>,
- <%= '{count} posts'[(count=forum.posts.size)==1 ? :post_count : :posts_count, number_with_delimiter(count)] %>
+ <%= I18n.t 'txt.count_topics', :count => forum.topics.size, :num => number_with_delimiter(forum.topics.size) %>,
+ <%= I18n.t 'txt.count_posts', :count => forum.posts.size, :num => number_with_delimiter(forum.posts.size) %>
</div>
- <p class="desc"><%= forum.description_html %>
- </p>
+ <p class="desc"><%= forum.description_html %></p>
</td>
<td class="c3">
- <%= link_to 'Edit'[:edit_title], edit_forum_path(forum), :class => "tiny", :rel => "directory", :style => "float:right" if admin? %>
+ <%= link_to I18n.t('txt.edit', :default => 'Edit'), edit_forum_path(forum), :class => "tiny", :rel => "directory", :style => "float:right" if admin? %>
</td>
<td class="inv lp">
<% if forum.recent_post -%>
- <%= jstime forum.recent_post.created_at %><br />
- <%= 'by {user}'[:by_user,"<strong>#{h(forum.recent_post.user.display_name)}</strong>"] %>
- <span>(<%= link_to 'view'[], forum_topic_path(forum, forum.recent_post.topic, :page => forum.recent_post.topic.last_page, :anchor => dom_id(forum.recent_post)) %>)</span>
+ <%= I18n.t 'txt.post_age', :when => time_ago_in_words(forum.recent_post.created_at), :default => "posted {{when}} ago" %><br />
+ <strong><%= I18n.t 'txt.by_user', :default => 'by {{user}}', :user => "#{h(forum.recent_post.user.display_name)}" %></strong>
+ <span>(<%= link_to I18n.t('txt.view', :default => 'view'), forum_topic_path(forum, forum.recent_post.topic, :page => forum.recent_post.topic.last_page, :anchor => dom_id(forum.recent_post)) %>)</span>
<% end -%>
</td>
</tr>
@@ -59,7 +61,7 @@
</table>
<p>
- <%= link_to 'Recent posts'[:recent_posts], posts_path %>
+ <%= link_to I18n.t('txt.show_recent_posts', :default => 'Show recent posts'), posts_path %>
</p>
<%# TODO: online_users = User.currently_online -%>
@@ -72,4 +74,3 @@
</div>
</div>
<% end %>
-
View
6 app/views/forums/new.html.erb
@@ -1,10 +1,10 @@
<div class="crumbs">
- <%= link_to "Forums"[:forums_title], root_path %> <span class="arrow">&rarr;</span>
+ <%= link_to I18n.t('txt.forums', :default => 'Forums'), root_path %> <span class="arrow">&rarr;</span>
</div>
-<h1><%= 'New Forum'[:new_forum] %></h1>
+<h1><%= I18n.t('txt.views_forums.new', :default => 'New Forum') %></h1>
<% form_for :forum, :url => forums_path do |f| -%>
<%= render :partial => "form", :object => f %>
-<%= submit_tag 'Create'[:Create] %> or <%= link_to('Cancel'[:cancel], forums_path) %>
+<%= submit_tag I18n.t('txt.create', :default =>'Create') %> <%= I18n.t 'txt.or', :default => 'or' %> <%= link_to(I18n.t('txt.cancel', :default => 'Cancel'), forums_path) %>
<% end -%>
View
47 app/views/forums/show.html.erb
@@ -5,7 +5,7 @@
<hr />
<% end %>
-<h5 style="margin-bottom:1.0em;"><%= 'Moderators'[:moderators] %></h5>
+<h5 style="margin-bottom:1.0em;"><%= I18n.t 'txt.moderator', :count => @forum.moderators.size, :default => 'Moderator' %></h5>
<% unless @forum.moderators.empty? -%>
<ul class="flat" style="margin-top:1em;">
@@ -14,8 +14,7 @@
<% end -%>
</ul>
<% else -%>
-<p><%= 'This forum is currently unmoderated.'[:forum_is_unmoderated] %></p>
-<p><%= 'Please always be courteous.'[:please_be_courteous] %></p>
+<p><%= I18n.t 'txt.views_forums.unmoderated', :default => 'This forum is currently unmoderated.<br />Please always be courteous.' %></p>
<% end -%>
<% end %>
@@ -23,31 +22,29 @@
<% @page_title = @forum.name %>
<div class="crumbs">
-<%= link_to 'Forums'[:forums_title], root_path %> <span class="arrow">&rarr;</span>
+<%= link_to I18n.t('txt.forums', :default => 'Forums'), root_path %> <span class="arrow">&rarr;</span>
</div>
-<h1 style="margin-top:0.5em">
- <%= h @forum.name %>
-</h1>
+<h1 style="margin-top:0.5em"><%= h @forum.name %></h1>
<p class="subtitle">
- <%= feed_icon_tag @forum.name, formatted_forum_posts_path(@forum, :atom) %>
- <%= '{count} topic(s)'[(count=@forum.topics.size)==1 ? :topic_count : :topics_count, number_with_delimiter(count)] %>,
- <%= '{count} post(s)'[(count=@forum.posts.size)==1 ? :post_count : :posts_count, number_with_delimiter(count)] %>
+ <%= feed_icon_tag @forum.name, formatted_forum_posts_path(@forum, :atom) %>
+ <%= I18n.t 'txt.count_topics', :count => @forum.topics.size, :num => number_with_delimiter(@forum.topics.size) %>,
+ <%= I18n.t 'txt.count_posts', :count => @forum.posts.size, :num => number_with_delimiter(@forum.posts.size) %>
</p>
-<% if @topics.total_entries > 1 -%>
+<% if @topics.total_entries -%>
<% if logged_in? %>
-<p style="float:right; margin-top:0;"><%= link_to 'New topic'[], new_forum_topic_path(@forum), :class => "utility" %></p>
+<p style="float:right; margin-top:0;"><%= link_to I18n.t('txt.new_topic', :default => 'New topic'), new_forum_topic_path(@forum), :class => "utility" %></p>
<% end %>
<%= will_paginate @topics %>
<% end -%>
<table border="0" cellspacing="0" cellpadding="0" class="wide topics">
<tr>
- <th class="la" colspan="2"><%= 'Topic'[:topic_title] %></th>
- <th width="1%"><%= 'Posts'[:posts_title] %></th>
- <th width="1%"><%= 'Views'[:views_title] %></th>
- <th class="la"><%= 'Last post'[:last_post] %></th>
+ <th class="la" colspan="2"><%= I18n.t 'txt.topic', :default => 'Topic' %></th>
+ <th width="1%"><%= I18n.t 'txt.posts', :default => 'Posts' %></th>
+ <th width="1%"><%= I18n.t 'txt.views', :default => 'Views' %></th>
+ <th class="la"><%= I18n.t 'txt.latest_post', :default => 'Latest post' %></th>
</tr>
<% for topic in @topics %>
<tr class="hentry">
@@ -57,32 +54,32 @@
color = ""
if topic.locked?
icon = "lock"
- post = ", this topic is locked."[:comma_locked_topic]
+ post = I18n.t('txt.views_forums.comma_locked_topic', :default => ', this topic is locked.')
color = "darkgrey"
end
%>
<% if recent_topic_activity(topic) %>
- <%= image_tag "clearbits/#{icon}.gif", :class => "icon green", :title => "Recent activity"[]+"#{post}" %>
+ <%= image_tag "clearbits/#{icon}.gif", :class => "icon green", :title => I18n.t('txt.views_forums.recent_activity', :default => "Recent activity") + "#{post}" %>
<% else %>
- <%= image_tag "clearbits/#{icon}.gif", :class => "icon grey #{color}", :title => "No recent activity"[]+"#{post}" %>
+ <%= image_tag "clearbits/#{icon}.gif", :class => "icon grey #{color}", :title => I18n.t('txt.views_forums.no_recent_activity', :default => "No recent activity") + "#{post}" %>
<% end %>
</td>
<td class="c2">
- <%= "Sticky"[:sticky_title]+": <strong>" if topic.sticky? %>
+ <%= I18n.t('txt.sticky', :default => ('[sticky]' + '<strong>')) if topic.sticky? %>
<%= topic_title_link (topic), :class => "entry-title", :rel => "bookmark" %>
<%= "</strong>" if topic.sticky? %>
<% if topic.paged? -%>
- <small><%= link_to 'last'[], forum_topic_path(@forum, topic, :page => topic.last_page) %></small>
+ <small><%= link_to I18n.t('txt.goto_last_page', :default => 'last'), forum_topic_path(@forum, topic, :page => topic.last_page) %></small>
<% end -%>
</td>
<td class="ca inv stat"><%= topic.posts.size %></td>
<td class="ca inv stat"><%= number_with_delimiter(topic.hits) %></td>
<td class="lp">
- <abbr class="updated" title="<%= topic.last_updated_at.xmlschema %>"><%= jstime(topic.last_updated_at) %></abbr>
+ <abbr class="updated" title="<%= topic.last_updated_at.xmlschema %>"><%= I18n.t 'txt.post_age', :when => time_ago_in_words(topic.last_updated_at), :default => "posted {{when}} ago" %></abbr>
<% if topic.last_user -%>
- <%= 'by {user}'[:by_user, "<span class=\"author\"><strong class=\"fn\">#{h(topic.last_user.display_name)}</strong></span>"] %>
+ <%= I18n.t 'txt.by_user', :default => 'by {{user}}', :user => "<span class=\"author\"><strong class=\"fn\">#{h(topic.last_user.display_name)}</strong></span>" %>
<% end -%>
- <span><%= link_to 'view'[], forum_topic_path(@forum, topic, :page => topic.last_page, :anchor => "posts-#{topic.last_post_id}") %></span>
+ <span><%= link_to I18n.t('txt.view', :default => 'view'), forum_topic_path(@forum, topic, :page => topic.last_page, :anchor => dom_id(topic.recent_post)) %></span>
</td>
</tr>
<% end %>
@@ -91,5 +88,5 @@
<%= will_paginate @topics %>
<% if logged_in? %>
-<p><%= link_to 'New topic'[:new_topic], new_forum_topic_path(@forum), :class => "utility" %></p>
+ <p><%= link_to I18n.t('txt.new_topic', :default => 'New topic'), new_forum_topic_path(@forum), :class => "utility" %></p>
<% end%>
View
28 app/views/layouts/_head.html.erb
@@ -3,9 +3,10 @@
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
- <title><%= "#{h @page_title} - " if @page_title %> <%=h @current_site && current_site.name %></title>
+ <title><%=h @current_site && current_site.name || I18n.t('txt.beast_title', :default => 'Altered Beast') %><%= " - #{h @page_title}" if @page_title %></title>
<%= stylesheet_link_tag 'display' %>
- <%= javascript_include_tag "prototype", "effects", "lowpro", "time", "application", :cache => 'beast' %>
+ <%= stylesheet_link_tag 'captcha' %>
+ <%= javascript_include_tag "prototype", "effects", "lowpro", "application", :cache => 'beast' %>
<% unless @feed_icons.blank? -%>
<% @feed_icons.each do |feed| -%>
<%= auto_discovery_link_tag :atom, feed[:url], :title => "Subscribe to '#{feed[:title]}'" %>
@@ -17,27 +18,24 @@
<div id="header">
<ul id="nav">
- <li><%= link_to 'Forums'[:forums_title], root_path, :rel => 'home' %></li>
- <li><%= link_to 'Users'[:users_title], users_path %></li>
+ <li><%= link_to I18n.t('txt.forums', :default => 'Forums'), root_path, :rel => 'home' %></li>
+ <li><%= link_to I18n.t('txt.users', :default => 'Users'), users_path %></li>
<li id="search">
<% form_tag posts_path, :method => 'get' do -%>
<%= text_field_tag :q, params[:q], :size => 15, :id => :search_box %>
<% end -%>
</li>
- <li><%= link_to_function 'Search'[:search_title], "#", :href => root_path, :id => 'search-link' %></li>
+ <li><%= link_to_function I18n.t('txt.search', :default => 'Search'), "#", :href => root_path, :id => 'search-link' %></li>
<% if @current_site and logged_in? -%>
<li class="login"><%= link_to current_user.login, user_path(current_user) %></li>
- <li class="logout"><%= link_to 'Settings'[:settings_title], settings_path %></li>
- <li class="logout"><%= link_to 'Logout'[:logout_title], logout_path(:to => CGI.escape(request.request_uri)) %></li>
+ <li class="logout"><%= link_to I18n.t('txt.settings', :default => 'Settings'), settings_path %></li>
+ <li class="logout"><%= link_to I18n.t('txt.logout', :default => 'Logout'), logout_path(:to => CGI.escape(request.request_uri)) %></li>
<% else -%>
- <li><%= link_to 'Signup'[:signup_action], signup_path(:to => CGI.escape(request.request_uri)) %></li>
- <li><%= link_to 'Login'[:login_action], login_path(:to => CGI.escape(request.request_uri)) %></li>
+ <li><%= link_to I18n.t('txt.signup', :default => 'Signup'), signup_path(:to => CGI.escape(request.request_uri)) %></li>
+ <li><%= link_to I18n.t('txt.login', :default => 'Login'), login_path(:to => CGI.escape(request.request_uri)) %></li>
<% end -%>
</ul>
- <% if @current_site && current_site.name %>
- <h1><%= link_to current_site.name, root_path %></h1>
- <% else %>
- <h1><%= link_to main_site_name, root_path %></h1>
- <% end %>
-</div>
+ <% name = (site = @current_site || Site.first) && site.name %>
+ <h1><%= link_to name || I18n.t('txt.beast_title', :default => 'Altered Beast'), root_path %>
+</div>
View
45 app/views/layouts/application.html.erb
@@ -1,12 +1,11 @@
<%= render :partial => "layouts/head" %>
<div id="container">
-
<div id="content">
<%= content_tag 'p', h(flash[:notice]), :class => 'notice' if flash[:notice] %>
<%= content_tag 'p', h(flash[:error]), :class => 'notice error' if flash[:error] %>
-
+
<%= yield %>
</div>
@@ -19,25 +18,27 @@
</div>
<div id="footer">
-<!--
-<p class="legal">
-<a href="/legal/" style="color:#369;">Legal</a>
-</p>
--->
-<p class="disclaim">
- <strong>
- <% if @current_site %>
- <%= @current_site.tagline %>
- <% else main_site %>
- <%= main_site_tagline %>
- <% end %>
- </strong>
-</p>
-<p class="credit">
- <%= 'Powered by'[:powered_by] %> <a href="http://github.com/courtenay/altered_beast/">Altered Beast</a><br />
- &copy; 2006-2009 <a href="http://www.workingwithrails.com/person/5337-josh-goebel" class="subtle">Josh Goebel</a>, <a href="http://entp.com">Courtenay Gasking</a> <%= 'and'[:and] %> <a href="http://weblog.techno-weenie.net" class="subtle">Rick Olson</a>
-</p>
-<br style="clear:both;" />
+ <p class="disclaim">
+ <strong>
+ <% if site = @current_site || Site.first %>
+ <%= site.tagline %>
+ <% end %>
+ </strong>
+ </p>
+ <%
+ footers=[I18n.t('txt.footer_message', :default => "Two's company. Three's a forum. More's a Beast.")
+ ]
+ %>
+ <%= footers[rand(footers.size)]%>
+ </strong>
+ </p>
+ <p class="credit">
+ <%= I18n.t('txt.powered_by', :default => 'Powered by') %> <a href="http://github.com/courtenay/altered_beast/">Altered Beast</a><br />
+ &copy; 2006 - 2009 <a href="http://www.workingwithrails.com/person/5337-josh-goebel" class="subtle">Josh Goebel</a>,
+ <a href="http://blog.caboo.se">Courtenay Gasking</a> <%= I18n.t 'txt.and', :default => 'and' %>
+ <a href="http://weblog.techno-weenie.net" class="subtle">Rick Olson</a>
+ </p>
+ <br style="clear:both;" />
</div>
</body>
-</html>
+</html>
View
18 app/views/posts/_edit.html.erb
@@ -8,26 +8,16 @@
<%= f.text_area :body, :rows => 10, :id => "edit_post_body", :tabindex => 1 %>
</td>
<td valign="top">
- <%= link_to('delete post'[], forum_topic_post_path(@post.forum, @post.topic, @post, :page => current_page),
- :class => "utility", :method => :delete, :confirm => "Delete this post? Are you sure?"[:delete_post_conf]) %>
-
-
- <h5><%= 'Formatting Help'[] %></h5>
-
- <ul class="help">
- <li><%= '*bold*'[:formatting_bold] %></li>
- <li><%= '_italics_'[:formatting_italics] %></li>
- <li><%= 'bq. <span>(quotes)</span>'[:formatting_blockquote] %></li>
- <li>"IBM":http://www.ibm.com</li>
- <li><%= '* or # <span>(lists)</span>'[:formatting_list] %></li>
- </ul>
+ <%= link_to(I18n.t('txt.views_posts.delete', :default => 'delete post'), forum_topic_post_path(@post.forum, @post.topic, @post, :page => current_page),
+ :class => "utility", :method => :delete, :confirm => I18n.t('txt.views_posts.delete_sure', :default => 'Delete this post forever?')) %>
+ <%= render :partial => "formatting" %>
</td>
</tr>
<tr>
<td valign="bottom" style="padding-bottom:15px;">
<%= ajax_spinner_for "editbox", "spinner_black.gif" %>
- <%= submit_tag 'Save Changes'[], :tabindex => 2 %> or <%= link_to('cancel'[], '#', :id => 'edit-cancel') %>
+ <%= submit_tag I18n.t('txt.save_changes', :default => 'Save Changes'), :tabindex => 2 %> <span class="button_or"><%= I18n.t 'txt.or', :default => 'or' %> <%= link_to(I18n.t('txt.cancel', :default => 'cancel'), '#', :id => 'edit-cancel') %></span>
</td>
</tr>
</table>
View
9 app/views/posts/_formatting.erb
@@ -0,0 +1,9 @@
+<h5><%= I18n.t 'txt.views_posts.formatting_help', :default => 'Formatting Help' %></h5>
+
+<ul class="help">
+ <li><%= I18n.t 'txt.views_posts.formatting_bold', :default => '*bold*' %></li>
+ <li><%= I18n.t 'txt.views_posts.formatting_italics', :default => '_italics_' %></li>
+ <li><%= I18n.t 'txt.views_posts.formatting_blockquote', :default => 'bq. <span>(quotes)</span>' %></li>
+ <li>"IBM":http://www.ibm.com</li>
+ <li><%= I18n.t 'txt.views_posts.formatting_list', :default => '* or # <span>(lists)</span>' %></li>
+</ul>
View
8 app/views/posts/edit.html.erb
@@ -1,13 +1,13 @@
-<h1><%= 'Edit Post'[:edit_post] %></h1>
+<h1><%= I18n.t 'txt.views_posts.edit', :default => 'Edit Post' %></h1>
<h2><%= link_to h(@post.topic.title), forum_topic_path(@post.forum, @post.topic) %></h2>
-<%= link_to('Delete post'[], forum_topic_post_path(@post.forum, @post.topic, @post, :page => current_page),
- :class => "utility", :method => :delete, :confirm => 'Delete this post forever?'[:delete_post_conf]) %>
+<%= link_to(I18n.t('txt.views_posts.delete', :default => 'Delete post'), forum_topic_post_path(@post.forum, @post.topic, @post, :page => current_page),
+ :class => "utility", :method => :delete, :confirm => I18n.t('txt.views_posts.delete_sure', :default => 'Delete this post forever?')) %>
<%= error_messages_for :topic %>
<% form_for :post, :html => { :method => :put },
:url => forum_topic_post_path(@post.forum, @post.topic, @post, :page => current_page) do |f| -%>
<p id="post_body"><%= f.text_area :body %></p>
-<%= submit_tag 'Save'[:save_title] %> or <%= link_to 'cancel'[], forum_topic_path(@post.forum, @post.topic, :page => current_page) %>
+<%= submit_tag I18n.t('txt.views_posts.save', :default => 'Save post') %> <%= I18n.t 'txt.or', :default => 'or' %> <%= link_to link_to(I18n.t('txt.cancel', :default => 'cancel'), forum_topic_path(@post.forum, @post.topic, :page => current_page) %>
<% end -%>
View
12 app/views/posts/index.html.erb
@@ -4,12 +4,12 @@
<% if params[:q].blank? -%>
<%= @page_title %>
<% else -%>
- <%= 'Searching for'[] %> '<%= h params[:q] %>'
+ <%= I18n.t 'txt.search_results_for_searchterm', :default => "Search results for '{{searchterm}}'", :searchterm => h(params[:q]) %>
<% end -%>
</h1>
<p class="subtitle">
<%= feed_icon_tag @page_title, search_path(true) %>
- <%= '{count} post(s) found'[(count=@posts.total_entries)==1 ? :post_count_found : :posts_count_found, number_with_delimiter(count)] %>
+ <%= I18n.t 'txt.count_posts_found', :count => @posts.total_entries %>
</p>
<%= will_paginate @posts %>
@@ -25,18 +25,18 @@
<td class="author vcard">
<div class="date">
<abbr class="updated" title="<%= post.created_at.xmlschema %>">
- <%= jstime(post.created_at) %>
+ <%= I18n.t 'txt.post_age', :when => time_ago_in_words(post.created_at), :default => 'posted {{when}} ago' %>
</abbr>
</div>
<%= avatar_for @users[post.user_id] %>
<span class="fn"><%= link_to truncate(h(@users[post.user_id].display_name), :length => 15), user_path(post.user) %></span>
- <span class="posts"><%= '{count} posts'[(count=@users[post.user_id].posts.size)==1 ? :post_count : :posts_count, number_with_delimiter(count)] %></span>
+ <span class="posts"><%= I18n.t 'txt.count_posts', :count => @users[post.user_id].posts.size, :num => number_with_delimiter(@users[post.user_id].posts.size) %></span>
</td>
<td class="body entry-content">
<p class="topic">
- <%= "Topic"[:topic_title] %>: <%= link_to h(post.forum.name), forum_path(post.forum) %> /
- <%= link_to h(post.topic.title), forum_topic_path(post.forum, post.topic) %>
+ <%= I18n.t 'txt.forum', :default => 'Forum' %>: <%= link_to h(post.forum.name), forum_path(post.forum) %> &ndash;
+ <%= I18n.t 'txt.topic', :default => 'Topic' %>: <%= link_to h(post.topic.title), forum_topic_path(post.forum, post.topic) %>
</p>
<%= post.body_html %>
View
10 app/views/sessions/new.html.erb
@@ -1,16 +1,16 @@
-<h1>Log In</h1>
+<h1><%= I18n.t('txt.login', :default => 'Login') %></h1>
<% form_tag session_path do -%>
-<p><%= label_tag 'login' %><br />
+<p><%= label_tag I18n.t('txt.login_name', :default => 'Login') %><br />
<%= text_field_tag 'login', @login %></p>
-<p><%= label_tag 'password' %><br/>
+<p><%= label_tag I18n.t('txt.password', :default => 'Password') %><br/>
<%= password_field_tag 'password', nil %></p>
<!-- Uncomment this if you want this functionality
-<p><%= label_tag 'remember_me', 'Remember me' %>
+<p><%= label_tag 'remember_me', I18n.t('txt.remember_me', :default => 'Remember me') %>
<%= check_box_tag 'remember_me', '1', @remember_me %></p>
-->
-<p><%= submit_tag 'Log in' %></p>
+<p><%= submit_tag I18n.t('txt.log_in', :default => 'Log in') %></p>
<% end -%>
View
4 app/views/sessions/new.rhtml
@@ -1,8 +1,8 @@
<% form_tag session_path do -%>
-<p><label for="login">Login</label><br/>
+<p><label for="login"><%= I18n.t('txt.login', :default => 'Login') %></label><br/>
<%= text_field_tag 'login' %></p>
-<p><label for="password">Password</label><br/>
+<p><label for="password"><%= I18n.t('txt.password', :default => 'Password') %></label><br/>
<%= password_field_tag 'password' %></p>
<p><label for="remember_me">Remember me:</label>
View
8 app/views/sites/_form.html.erb
@@ -2,25 +2,25 @@
<table border="0" cellspacing="0" cellpadding="0" class="noborder nopad wide" id="site_name">
<tr>
<td>
- <label for="site_name"><%= 'Name'[:site_title] %></label><br />
+ <label for="site_name"><%= I18n.t 'txt.views_sites.site_title', :default => 'Name' %></label><br />
<%= form.text_field :name, :class => "primary" %>
</td>
</tr>
<tr>
<td>
- <label for="site_description"><%= 'Description'[:site_description] %></label><br />
+ <label for="site_description"><%= I18n.t 'txt.views_sites.description', :default => 'Description' %></label><br />
<%= form.text_area :description, :class => "primary", :size => "52x5" %>
</td>
</tr>
<tr>
<td>
- <label for="site_tagline"><%= 'Tagline'[:site_tagline] %></label><br />
+ <label for="site_tagline"><%= I18n.t 'txt.views_sites.tagline', :default => 'Tagline' %></label><br />
<%= form.text_field :tagline, :class => "primary" %>
</td>
</tr>
<tr>
<td>
- <label for="site_host"><%= 'Host'[:site_host] %></label><br />
+ <label for="site_host"><%= I18n.t 'txt.views_sites.site_host', :default => 'Host' %></label><br />
http://<%= form.text_field :host %>
</td>
</tr>
View
6 app/views/sites/edit.html.erb
@@ -1,12 +1,12 @@
<div class="crumbs">
- <%= link_to 'Sites'[:sites_title], sites_path %> <span class="arrow">&rarr;</span>
+ <%= link_to I18n.t('txt.sites', :default => 'Sites'), sites_path %> <span class="arrow">&rarr;</span>
</div>
-<h1><%= 'Edit Site'[:edit_site] %></h1>
+<h1><%= link_to I18n.t('txt.views_sites.edit', :default => 'Edit site') %></h1>
<% form_for :site,
:url => site_path(@site),
:html => { :method => :put } do |f| -%>
<%= render :partial => "form", :object => f %>
-<%= submit_tag 'Save Forum'[:save_site], :or => link_to('Cancel'[:cancel], sites_path) %>
+<%= submit_tag I18n.t('txt.save_changes', :default =>'Save changes') %> <%= I18n.t 'txt.or', :default => 'or' %> <%= link_to(I18n.t('txt.cancel', :default => 'Cancel'), sites_path) %>
<% end -%>
View
28 app/views/sites/index.html.erb
@@ -1,26 +1,26 @@
<% content_for :right do %>
-<% if @current_site %>
-<%= @current_site.description %>
-<% else %>
-<%= main_site_description %>
-<% end %>
+<h5><%= I18n.t 'txt.sidebar.beast_title', :default => 'What is Beast?' %></h5>
+
+<p>
+ <%= I18n.t 'txt.sidebar.beast_desc', :default => "A small, light-weight forum in Rails with a scary name and a goal of around 500 lines of code when we're done." %>
+</p>
<% if admin? %>
-<h6><%= 'Admin'[:admin_title] %></h6>
-<p><%= link_to 'Create New Site'[:create_new_site], new_site_path, :class => "utility" %></p>
+<h6><%= I18n.t 'txt.admin.title', :default => 'Admin' %></h6>
+<p><%= link_to I18n.t('txt.views_sites.create_new_site', :default => 'Create new site'), new_site_path, :class => "utility" %></p>
<% end %>
<% end %>
-<h1 style="margin-top:0;"><%= 'Sites'[:sites_title] %></h1>
+<h1 style="margin-top:0;"><%= I18n.t 'txt.views_sites.title', :default => 'Sites' %></h1>
<%= will_paginate @sites %>
<table border="0" cellspacing="0" cellpadding="0" class="wide forums">
<tr>
- <th class="la" width="60%"><%= 'Site'[:forum_title] %></th>
- <th class="la" width="15%"><%= 'Forums'[:forum_title] %></th>
- <th class="la" width="15%"><%= 'Users'[:user_title] %></th>
+ <th class="la" width="60%"><%= I18n.t 'txt.views_sites.site_title', :default => 'Name' %></th>
+ <th class="la" width="15%"><%= I18n.t 'txt.forums', :default => 'Forums' %></th>
+ <th class="la" width="15%"><%= I18n.t 'txt.users', :default => 'Users' %></th>
<th class="la" width="10%">&nbsp;</th>
</tr>
<% @sites.each do |site| -%>
@@ -30,13 +30,13 @@
<%= content_tag(:small, "(#{h(site.host)})") unless site.default? -%>
</td>
<td class="c2">
- <%= link_to pluralize(site.forums.count, 'Forum'[:forum]), forums_url(:host => site.host, :port => request.port) %>
+ <%= link_to I18n.t('txt.count_forums', :count => site.forums.count, :num => number_with_delimiter(site.forums.count)), forums_url(:host => site.host, :port => request.port) %>
</td>
<td class="c2">
- <%= link_to pluralize(site.users.count, 'User'[:user]), users_url(:host => site.host, :port => request.port) %>
+ <%= link_to I18n.t('txt.count_users', :count => site.users.count, :num => number_with_delimiter(site.users.count)), users_url(:host => site.host, :port => request.port) %>
</td>
<td class="c2">
- <%= link_to 'Edit'[:edit_title], edit_site_path(site), :class => "tiny", :rel => "directory" if admin? %>
+ <%= link_to I18n.t('txt.edit', :default => 'edit'), edit_site_path(site), :class => "tiny", :rel => "directory" if admin? %>
</td>
</tr>
<% end %>
View
8 app/views/sites/new.html.erb
@@ -1,11 +1,11 @@
<div class="crumbs">
- <%= link_to "Sites"[:sites_title], root_path %> <span class="arrow">&rarr;</span>
+ <%= link_to I18n.t('txt.sites', :default => 'Sites'), sites_path %> <span class="arrow">&rarr;</span>
</div>
-<h1><%= 'New Site'[:new_site] %></h1>
+<h1><%= I18n.t('txt.views_sites.new', :default => 'New site') %></h1>
<% form_for :site, :url => sites_path do |f| -%>
-<p><%= 'Welcome to your shiny new Altered Beast forum. Please name your site!'[:welcome_new_site] %></p>
+<p><%= I18n.t('txt.views_sites.new_desc', :default => 'Welcome to your shiny new Altered Beast forum. Please name your site!') %></p>
<%= render :partial => "form", :object => f %>
-<%= submit_tag 'Create'[:Create], :or => link_to('Cancel'[:cancel], sites_path) %>
+<%= submit_tag I18n.t('txt.create', :default =>'Create') %> <%= I18n.t 'txt.or', :default => 'or' %> <%= link_to(I18n.t('txt.cancel', :default => 'Cancel'), sites_path) %>
<% end -%>
View
8 app/views/sites/show.html.erb
@@ -1,4 +1,8 @@
+<div class="crumbs">
+ <%= link_to I18n.t('txt.sites', :default => "Sites"), sites_path %> <span class="arrow">&rarr;</span>
+</div>
+
<h1><%=h @site.name %></h1>
-<% if admin? %><%= link_to 'Edit', edit_site_path(@site) %> |<% end %>
-<%= link_to 'Sites', sites_path %>
+<% if admin? %><%= link_to I18n.t('txt.edit', :default => "Edit"), edit_site_path(@site) %> |<% end %>
+<%= link_to link_to I18n.t('txt.sites', :default => "Sites"), sites_path %>
View
10 app/views/topics/_form.html.erb
@@ -1,21 +1,21 @@
<p>
-<label for="topic_title"><%= 'Title'[:title_title] %></label><br />
+<label for="topic_title"><%= I18n.t('txt.views_topics.topic', :default => 'Name') %></label><br />
<%= form.text_field :title, :onchange => "/*TopicForm.editNewTitle(this);*/", :class => "primary", :tabindex => 10 %>
<% for_moderators_of @forum do -%>
<label style="margin-left:1em;">
-<%= form.check_box :sticky %> <%= 'Sticky'[:sticky_title] %>
+<%= form.check_box :sticky %> <%= I18n.t('txt.sticky', :default => 'sticky') %>
</label>
<label style="margin-left:1em;">
-<%= form.check_box :locked %> <%= 'Locked'[:locked_title] %>
+<%= form.check_box :locked %> <%= I18n.t('txt.locked', :default => 'locked') %>
</label>
<% end -%>
</p>
<% if @topic.new_record? -%>
<p>
- <label for="topic_body"><%= 'Body'[:body_title] %></label><br />
+ <label for="topic_body"><%= I18n.t('txt.views_topics.body', :default => 'Body') %></label><br />
<%= form.text_area :body, :rows => 12, :tabindex => 20 %>
</p>
<% end -%>
@@ -23,7 +23,7 @@
<% if admin? && !@topic.new_record? && forums = current_site.ordered_forums -%>
<% if forums.size > 1 -%>
<p id="topic_forum_id">
- <label for="topic_forum_id"><%= 'Forum'[:forum_title] %></label><br />
+ <label for="topic_forum_id"><%= I18n.t('txt.forum', :default => 'Forum') %></label><br />
<%= form.select :forum_id, forums.map {|x| [x.name, x.id] } %></p>
</p>
<% end -%>
View
4 app/views/topics/edit.html.erb
@@ -1,4 +1,4 @@
-<h1><%= 'Edit Topic'[] %></h1>
+<h1><%= I18n.t 'txt.views_topics.edit', :default => 'Edit Topic' %></h1>
<%= error_messages_for :topic %>
<% form_for :topic,
@@ -6,5 +6,5 @@
:html => { :method => :put } do |f| -%>
<%= render :partial => "form", :object => f %>
<br />
-<%= submit_tag 'Save Changes'[] %> or <%= link_to('Cancel'[], forum_topic_path(@forum, @topic)) %>
+<%= submit_tag I18n.t('txt.save_changes', :default => 'Save changes') %> <%= I18n.t 'txt.or', :default => 'or' %> <%= link_to(I18n.t('txt.cancel', :default => 'Cancel'), forum_topic_path) %>
<% end -%>
View
8 app/views/topics/new.html.erb
@@ -1,18 +1,18 @@
<div class="crumbs" xstyle="margin-top:1.1em;">
- <%= link_to 'Forums'[:forums_title], root_path %> <span class="arrow">&rarr;</span>
+ <%= link_to I18n.t('txt.forums', :default => 'Forums'), root_path %> <span class="arrow">&rarr;</span>
<%= link_to h(@forum.name), forum_path(@forum) %> <span class="arrow">&rarr;</span>
</div>
-<h1 id="new_topic"><%= 'New Topic'[] %></h1>
-<p class="subtitle"><%= 'by {user}'[:by_user, current_user.display_name] %></p>
+<h1 id="new_topic"><%= I18n.t 'txt.new_topic', :default => 'New topic' %></h1>
+<p class="subtitle"><%= I18n.t 'txt.by_user', :default => 'by {{user}}', :user => current_user.display_name %></p>
<%= error_messages_for :topic %>
<% form_for :topic,
:url => forum_topics_path(@forum) do |f| -%>
<%= render :partial => "form", :object => f %>
-<%= submit_tag 'Post Topic'[], :or => link_to('Cancel'[], forum_path(@forum)) %>
+<%= submit_tag I18n.t('txt.post_topic', :default => 'Post topic') %>
<% end -%>
<%= javascript_tag "$('topic_title').focus();" %>
View
63 app/views/topics/show.html.erb
@@ -3,7 +3,7 @@
<% content_for :right do -%>
-<h5><%= 'Voices'[:voices_title] %></h5>
+<h5><%= I18n.t 'txt.voices', :default => 'Voices' %></h5>
<ul class="flat talking">
<% @topic.voices.each do | user | %>
<li><%= link_to h(user.display_name), user_path(user) %></li>
@@ -19,7 +19,7 @@
<div>
<input id="monitor_checkbox" type="checkbox" <%= "checked='checked'" if @monitoring %>
onclick="if (this.checked) {<%= remote_function :url => monitorship_path(@forum, @topic) %>} else {<%= remote_function :url => monitorship_path(@forum, @topic), :method => :delete %>}" />
- <label id="monitor_label" for="monitor_checkbox"><%= @monitoring ? 'Monitoring topic'[] : 'Monitor topic'[] %></label>
+ <label id="monitor_label" for="monitor_checkbox"><%= @monitoring ? I18n.t('txt.monitoring_topic', :default => 'Monitoring topic') : I18n.t('txt.monitor_topic', :default => 'Monitor topic') %></label>
<%= hidden_field_tag '_method', 'delete' if @monitoring %>
<%= submit_tag :Set, :id => 'monitor_submit' %>
</div>
@@ -29,13 +29,13 @@
<div class="crumbs">
- <%= link_to "Forums"[:forums_title], root_path %> <span class="arrow">&rarr;</span>
+ <%= link_to I18n.t('txt.forums', :default => 'Forums'), root_path %> <span class="arrow">&rarr;</span>
<%= link_to h(@topic.forum.name), forum_path(@topic.forum) %>
<%
page=session[:forum_page] ? session[:forum_page][@topic.forum.id] : nil
if page and page!=1 %>
<small style="color:#ccc">
- (<%= link_to 'page {page}'[:page, page], forum_path(:id => @topic.forum, :page => page) %>)
+ (<%= link_to I18n.t('txt.page_nr', :default => 'page {{nr}}'), forum_path(:id => @topic.forum, :page => page) %>)
</small>
<% end %>
<span class="arrow">&rarr;</span>
@@ -45,13 +45,13 @@
<%= h @topic.title %>
<% if @topic.locked? %>
- <span>(<%= 'locked'[] %>)</span>
+ <span>(<%= I18n.t 'txt.topic', :default => 'Topic' %> <%= I18n.t 'txt.locked', :default => 'locked' %>)</span>
<% end %>
<% if logged_in? %>
<span style="display:none;" id="topic_mod">
<% if @topic.editable_by?(current_user) -%>
- <%= link_to('edit'[], edit_forum_topic_path(@forum, @topic), :class => "utility") %> |
- <%= link_to('delete'[], forum_topic_path(@forum, @topic), :class => "utility", :method => :delete, :confirm => 'Delete this topic forever?'[:delete_topic_conf]) %>
+ <%= link_to(I18n.t('txt.edit', :default => 'edit'), edit_forum_topic_path(@forum, @topic), :class => "utility") %> |
+ <%= link_to(I18n.t('txt.delete', :default => 'delete'), forum_topic_path(@forum, @topic), :class => "utility", :method => :delete, :confirm => I18n.t('txt.views_topics.delete_sure', :default => 'Delete this topic forever?')) %>
<% end -%>
</span>
<% end %>
@@ -59,8 +59,8 @@
<p class="subtitle">
<%= feed_icon_tag @topic.title, formatted_forum_topic_posts_path(@forum, @topic, 'atom') %>
- <%= '{count} post(s)'[(count=@topic.posts.size)==1 ? :post_count : :posts_count, number_with_delimiter(count)] %>,
- <%= '{count} voice(s)'[(count=@topic.voices.size)==1 ? :voice_count : :voices_count, number_with_delimiter(count)] %>
+ <%= I18n.t 'txt.count_posts', :count => @topic.posts.size, :num => number_with_delimiter(@topic.posts.size) %>,
+ <%= I18n.t 'txt.count_voices', :count => @topic.voices.size, :num => number_with_delimiter(@topic.voices.size) %>
</p>
<% unless @posts.empty? -%>
@@ -82,7 +82,7 @@
<div class="date">
<a href="#<%= dom_id post %>" rel="bookmark">
<abbr class="updated" title="<%= post.created_at.xmlschema %>">
- <%= jstime(post.created_at) %>
+ <%= I18n.t 'txt.post_age', :when => time_ago_in_words(post.created_at), :default => "posted {{when}} ago" %>
</abbr>
</a>
</div>
@@ -92,22 +92,22 @@
<% if post.user.admin? || post.forum.moderators.include?(post.user) || !post.user.active? %>
<span class="admin">
<% if post.user.admin? %>
- <%= 'Administrator'[:administrator_title] %>
+ <%= I18n.t 'txt.user_is_administrator', :default => 'Administator' %>
<% elsif post.forum.moderators.include?(post.user) %>
- <%= 'Moderator'[:moderator_title] %>
+ <%= I18n.t 'txt.user_is_moderator', :default => 'Moderator' %>
<% elsif post.user.suspended? %>
- <%=h post.user.state %>
+ <%=h post.user.state %>
<% end %>
</span>
<% end %>
- <span class="posts"><%= '{count} post(s)'[(count=post.user.posts.size)==1 ? :post_count : :posts_count, number_with_delimiter(count)] %></span>
+ <span class="posts"><%= I18n.t 'txt.count_posts', :count => post.user.posts.size, :num => number_with_delimiter(post.user.posts.size) %></span>
<% if logged_in? && post.editable_by?(current_user) -%>
<p>
<span class="edit">
<%= ajax_spinner_for "edit-post-#{post.id}", "spinner_bounce.gif" %>
- <%= link_to 'Edit post'[], edit_forum_topic_post_path(@forum, @topic, post, :page => current_page), :class => 'utility' %>
+ <%= link_to I18n.t('txt.admin.edit_post', :default => 'Edit post'), edit_forum_topic_post_path(@forum, @topic, post, :page => current_page), :class => 'utility' %>
</span>
</p>
<% end -%>
@@ -115,13 +115,13 @@
</td>
<td class="body entry-content" id="post-body-<%= post.id %>">
-<!--
- <%= link_to_function image_tag('clearbits/comment.gif', :class => 'icon reply'), "$('reply').toggle()" if logged_in? %>
--->
+
+ <%= link_to_function image_tag('clearbits/comment.gif', :class => 'icon reply'), "$('reply').toggle()" if logged_in? && @posts.first == post %>
+
<% if post.user.active? %>
<%= post.body_html %>
<% else %>
- <p><% "(This post has been removed)"[:suspended_user_post] %></p>
+ <p>(<% I18n.t 'txt.suspended_user_post', :default => 'This post has been removed' %>)</p>
<% end %>
</td>
</tr>
@@ -136,13 +136,13 @@
<div id="edit"></div>
<% if @topic.locked? -%>
<p>
- <%= image_tag "clearbits/lock.gif", :class => "icon grey", :title => "Topic locked"[:topic_locked_title] %>
+ <%= image_tag "clearbits/lock.gif", :class => "icon grey", :title => I18n.t('txt.views_topics.topic_locked', :default => "Topic locked") %>
<label>
- <%= 'This topic is locked'[:locked_topic] %>.</label>
+ <%= I18n.t 'txt.views_topics.locked_topic', :default => 'This topic is locked.' %></label>
</p>
<% else -%>
-<p><%= link_to 'Reply to topic'[], "#reply", :class => "utility", :id => 'reply-link' %></p>
+<p><%= link_to I18n.t('txt.reply_to_topic', :default => 'Reply to topic'), "#reply", :class => "utility", :id => 'reply-link' %></p>
<div id="reply" class="editbox">
<div class="container">
@@ -154,25 +154,12 @@
<%= f.text_area :body, :rows => 8 %>
</td>
<td valign="top">
-
-
- <h5><%= 'Formatting Help'[] %></h5>
-
- <ul class="help">
- <li><%= '*bold*'[:formatting_bold] %>
- &nbsp; &nbsp; &nbsp;
- <%= '_italics_'[:formatting_italics] %>
- &nbsp; &nbsp; &nbsp;<br />
- <%= 'bq. <span>(quotes)</span>'[:formatting_blockquote] %></li>
- <li>"IBM":http://www.ibm.com</li>
- <li><%= '* or # <span>(lists)</span>'[:formatting_list] %></li>
- </ul>
-
+ <%= render :partial => "posts/formatting" %>
</td>
</tr>
<tr>
<td valign="bottom" style="padding-bottom:15px;">
- <%= submit_tag "Save Reply"[] %><span class="button_or">or <%= link_to 'cancel'[], '#', :id => 'reply-cancel' %></span>
+ <%= submit_tag I18n.t('txt.views_topics.save_reply', :default => 'Save reply') %> <span class="button_or"><%= I18n.t 'txt.or', :default => 'or' %> <%= link_to link_to(I18n.t('txt.cancel', :default => 'cancel'), '#', :id => 'reply-cancel') %></span>
</td>
</tr>
</table>
@@ -183,6 +170,6 @@
<% end %>
<div class="crumbs" style="margin-top:1.1em;">
- <%= link_to "Forums"[:forums_title], root_path %> <span class="arrow">&rarr;</span>
+ <%= link_to I18n.t('txt.forums', :default => 'Forums'), root_path %> <span class="arrow">&rarr;</span>
<%= link_to h(@topic.forum.name), forum_path(@topic.forum) %> <span class="arrow">&rarr;</span>
</div>
View
14 app/views/users/_contact_info.html.erb
@@ -1,25 +1,25 @@
-<h3><%= 'User Profile'[] %></h3>
+<h3><%= I18n.t 'txt.views_users.profile', :default => 'User profile' %></h3>
<p>
- <label for="display_name"><%= 'Display Name'[:display_name_title] %></label><br />
+ <label for="display_name"><%= I18n.t 'txt.views_users.display_name', :default => 'Display name' %></label><br />
<%= settings.text_field :display_name %>
</p>
<p>
- <label for="user_openid_url"><%= 'Identity Url'[:openid_url_title] %></label><br />
- <p class="help"><%= 'Enter your OpenID Identity Url if you know it'[:open_id_field ]%>.</p>
+ <label for="user_openid_url"><%= I18n.t 'txt.views_users.openid_url_title', :default => 'Identity Url' %></label><br />
+ <p class="help"><%= I18n.t 'txt.views_users.open_id_field', :default => 'Enter your OpenID Identity Url if you know it.' %></p>
<%= settings.text_field :openid_url %>
</p>
<p>
- <label for="user_website"><%= 'Website'[:website_title] %></label><br />
+ <label for="user_website"><%= I18n.t 'txt.views_users.website_title', :default => 'Website' %></label><br />
<%= settings.text_field :website %>
<span class="entryhelp">
- (<%= 'without http://'[:without_http] %>)
+ (<%= I18n.t 'txt.views_users.without_http', :default => 'without http://' %>)
</span>
</p>
<p>
- <label for="user_bio"><%= 'Bio'[:bio_title] %></label><br />
+ <label for="user_bio"><%= I18n.t 'txt.views_users.bio_title', :default => 'Bio' %></label><br />
<%= settings.text_area :bio, :rows => 10, :style => "width:99%" %>
</p>
View
18 app/views/users/_settings.html.erb
@@ -1,14 +1,14 @@
-<h3><%= 'Basics'[:basics_title] %></h3>
+<h3><%= I18n.t 'txt.views_users.basics_title', :default => 'Basics' %></h3>
<% if not @user.valid? and @user.errors.on(:login) %>
<p>
- <label for="login"><%= 'Login'[:login_title] %></label></p>
+ <label for="login"><%= I18n.t 'txt.views_users.login_title', :default => 'Login' %></label></p>
<p class="help">
- <strong><%= 'Please change your login'[:change_login] %>.</strong>
- <%= 'Logins should start with least 2 characters and may consist of letters, numbers, or the underscore'[:login_field] %>.
+ <strong><%= I18n.t 'txt.views_users.change_login', :default => 'Please change your login' %>.</strong>
+ <%= I18n.t 'txt.views_users.login_field', :default => 'Logins should start with least 2 characters and may consist of letters, numbers, or the underscore' %>.
</p>
<p>
<%= settings.text_field :login %>
@@ -16,15 +16,15 @@
<% end %>
<p>
- <label for="user_email"><%= 'Email'[:email_title] %></label><br />
+ <label for="user_email"><%= I18n.t 'txt.views_users.email_title', :default => 'Email' %></label><br />
<%= settings.text_field :email %>
</p>
<div>
- <label for="user_password"><%= 'Password'[:password_title] %></label><br />
- <p class="entryhelp" style="margin-top:0.5em;"><%= 'Enter a new password twice to change your password. (must be longer than 5 characters)'[:password_field] %></p>
+ <label for="user_password"><%= I18n.t 'txt.views_users.password_title', :default => 'Password' %></label><br />
+ <p class="entryhelp" style="margin-top:0.5em;"><%= I18n.t 'txt.views_users.password_field', :default => 'Enter a new password twice to change your password. (must be longer than 5 characters)' %></p>
<%= settings.password_field :password, :size => 16 %>
- <span class="entryhelp">(<%= 'once'[] %>)</span><br />
+ <span class="entryhelp">(<%= I18n.t 'txt.views_users.once', :default => 'once' %>)</span><br />
<%= settings.password_field :password_confirmation, :size => 16 %>
- <span class="entryhelp">(<%= 'and again'[] %>)</span>
+ <span class="entryhelp">(<%= I18n.t 'txt.views_users.and_again', :default => 'and again' %>)</span>
</div>
View
16 app/views/users/edit.html.erb
@@ -1,14 +1,14 @@
<% content_for :right do %>
- <h5><%= 'Avatars'[:avatars_title] %></h5>
- <p><%= 'To have your very own avatar displayed on this forum visit {gravatar} and sign up for a free gravatar.'[:gravatar_notice, %(<a href="http://www.gravatar.com/">gravatar.com</a>)] %></p>
+ <h5><%= I18n.t 'txt.views_users.avatars_title', :default => 'Avatars' %></h5>
+ <p><%= I18n.t 'txt.views_users.gravatar_notice', :default => 'To have your very own avatar displayed on this forum visit {{gravatar}} and sign up for a free gravatar.', :gravatar => '<a href="http://www.gravatar.com/" title="Gravatar - Globally Recognized Avatars">Gravatar</a>' %></p>
<% if current_user.admin? %>
<% form_for @user, :url => make_admin_user_path(@user) do |f| %>
<h5>Admin</h5>
<p>
<%= f.check_box :admin %>
- <label for="user_admin"><%= 'User is an administrator'[] %></label>
+ <label for="user_admin"><%= I18n.t 'txt.admin.user_is_an_administrator', :default => 'User is an administrator' %></label>
</p>
<p>
<%= submit_tag 'Save'[:save] %>
@@ -18,9 +18,9 @@
<% end %>
-<h1><%= 'Settings'[:settings_title] %></h1>
+<h1><%= I18n.t 'txt.views_users.settings', :default => 'Settings' %></h1>
-<p class="subtitle"><%= 'for {user}'[:for_user, @user.display_name] %>
+<p class="subtitle"><%= I18n.t 'txt.views_users.for_user', :default => 'for {{user}}', :user => @user.display_name %>
<% if @user.login!=@user.display_name %>
(<%= @user.login %>)
<% end %>
@@ -30,12 +30,12 @@
<% form_for :user, :url => user_path(@user), :html => { :method => :put } do |f| -%>
<%= render :partial => "settings", :object => f %>
- <p><%= submit_tag 'Change e-mail or password'[:change_email_or_password], :or => link_to( "cancel"[], "/") %></p>
+ <p><%= submit_tag I18n.t('txt.views_users.change_email_or_password', :default => 'Change e-mail or password') %></p>
<% end -%>
<br />
<% form_for :user, :url => user_path(@user), :html => { :method => :put } do |f| -%>
<%= render :partial => "contact_info", :locals => { :settings => f } %>
- <p><%= submit_tag 'Update Profile'[], :or => link_to( "cancel"[], "/") %></p>
-<% end -%>
+ <%= submit_tag I18n.t('txt.views_users.update_profile', :default => 'Update profile') %> <%= I18n.t 'txt.or', :default => 'or' %> <%= link_to(I18n.t('txt.cancel', :default => 'Cancel'), user_path(@user)) %>
+<% end -%>
View
20 app/views/users/index.html.erb
@@ -1,33 +1,33 @@
-<h5><%= 'Find a User'[] %></h5>
+<h5><%= I18n.t 'txt.views_users.find_a_user', :default => 'Find a User' %></h5>
<% form_tag users_path, :method => 'get' do -%>
<p>
-<label><%= 'Display name or login'[] %></label>
+<label><%= I18n.t 'txt.views_users.display_name_or_login', :default => 'Display name or login' %></label>
<%= text_field_tag :q, params[:q] %>
-<%= submit_tag "Search"[:search_title] %></p>
+<%= submit_tag I18n.t('txt.views_users.search_title', :default => "Search") %></p>
<% end -%>
-<h1 style="margin-top:0;"><%= 'Users'[:users_title] %></h1>
+<h1 style="margin-top:0;"><%= I18n.t 'txt.users', :default => 'Users' %></h1>
<p class="subtitle">
- <%= user_count %>, <%= active_user_count %>, <%= lurking_user_count %>
+ <%= user_count %>: <%= active_user_count %>, <%= lurking_user_count %>
</p>
<%= will_paginate @users %>
<table border="0" cellspacing="0" cellpadding="0" class="wide forums">
<tr>
- <th class="la" width="88%"><%= 'Name / Login'[:name_or_login] %></th>
+ <th class="la" width="88%"><%= I18n.t 'txt.views_users.name_or_login', :default => 'Name / Login' %></th>
<% if logged_in? && current_user.admin? -%>
- <th><%= "Current Status"[:current_status_title] %></th>
+ <th><%= I18n.t 'txt.views_users.current_status_title', :default => "Current Status" %></th>
<% end -%>
- <th><%= 'Website'[:website_title] %></th>
- <th width="1%"><%= 'Posts'[:posts_title] %></th>
+ <th><%= I18n.t 'txt.views_users.website_title', :default => 'Website' %></th>
+ <th width="1%"><%= I18n.t 'txt.views_users.posts_title', :default => 'Posts' %></th>
</tr>
<% @users.each do |user|-%>
<tr>
<td><%= link_to h(user.display_name || user.login), user, :class => (user.admin? ? "admin" : nil) %>
<span style="color:#666">
- <%= "(admin)"[:admin_in_parens] if user.admin? %>
+ <%= I18n.t('txt.views_users.admin_in_parens', :default => "(admin)") if user.admin? %>
</span>
</td>
<% if logged_in? && current_user.admin? -%>
View
12 app/views/users/new.rhtml
@@ -1,16 +1,18 @@
<%= error_messages_for :user %>
<% form_for :user, :url => users_path do |f| -%>
-<p><label for="login">Login</label><br/>
+<p><label for="login"><%= I18n.t 'txt.login_name', :default => 'Login' %></label><br/>
<%= f.text_field :login %></p>
-<p><label for="email">Email</label><br/>
+<p><label for="email"><%= I18n.t 'txt.email', :default => 'Email' %></label><br/>
<%= f.text_field :email %></p>
-<p><label for="password">Password</label><br/>
+<p><label for="password"><%= I18n.t 'txt.password', :default => 'Password' %></label><br/>
<%= f.password_field :password %></p>
-<p><label for="password_confirmation">Confirm Password</label><br/>
+<p><label for="password_confirmation"><%= I18n.t 'txt.password_confirm', :default => 'Confirm Password' %></label><br/>
<%= f.password_field :password_confirmation %></p>
-<p><%= submit_tag 'Sign up' %></p>
+<%= render :partial => '/captcha' %>
+
+<p><%= submit_tag I18n.t('txt.sign_up', :default => 'Sign up') %></p>
<% end -%>
View
30 app/views/users/show.html.erb
@@ -4,16 +4,16 @@
<% if admin? %>
<% if @user.active? && !@user.suspended? %>
<% form_for @user.moderatorships.build do |f| -%>
- <h6><%= 'Admin &amp; Moderation'[:admin_and_moderation] %></h6>
+ <h6><%= I18n.t 'txt.admin.admin_and_moderation', :default => 'Admin &amp; Moderation' %></h6>
<% unless @user.forums.empty? -%>
- <p><%= 'This user can moderate the following forums. Click one to remove.'[:remove_moderated_forum] %></p>
+ <p><%= I18n.t 'txt.admin.remove_moderated_forum', :default => 'This user can moderate the following forums. Click one to remove.' %></p>
<ul class="flat">
<% @user.forums.moderatable.each do |forum| -%>
<li>
- <%= link_to forum.name, moderatorship_path(forum.moderatorship_id), :method => :delete, :confirm => "#{'Remove user as moderator for'[:remove_user_as_moderator]} #{forum.name}?" %>
+ <%= link_to forum.name, moderatorship_path(forum.moderatorship_id), :method => :delete, :confirm => I18n.t('txt.admin.remove_user_as_moderator', :default => 'Remove user as moderator for {{forum}}?', :forum => forum.name) %>
</li>
<% end -%>
</ul>
@@ -21,22 +21,23 @@
<% unless @user.available_forums.empty? -%>
<p>
- <label><%= 'Add as moderator'[] %></label><br />
+ <label><%= I18n.t 'txt.admin.add_as_moderator', :default => 'Add as moderator' %></label><br />
<%= f.select :forum_id, @user.available_forums.collect { |forum| [forum.name, forum.id] }, :include_blank => " - " %>
</p>
<p>
- <%= f.submit 'Save'[:save_title] %>
+ <%= f.submit I18n.t 'txt.save', :default => 'Save' %>
<%= f.hidden_field :user_id %>
</p>
<% end -%>
<% end -%>
- <p><label><%= 'User is an administrator'[] %></label></p>
- <p><%= link_to "Suspend user account", suspend_user_path(@user), :method => :put %></p>
+
+ <p><%= link_to I18n.t('txt.admin.suspend_user_account', :default => "Suspend user account"), suspend_user_path(@user), :method => :put %></p>
+
<% else %>
- <p><%= "User account is suspended."[] %> <%= link_to "Unsuspend user account", unsuspend_user_path(@user), :method => :put %></p>
+ <p><%= I18n.t