Permalink
Browse files

add I18n

  • Loading branch information...
1 parent baf4f2b commit 02b84989563e0a51ed9b4a9bf46be63cce523df1 @sashapro committed Jun 5, 2012
View

Large diffs are not rendered by default.

Oops, something went wrong.
@@ -6,7 +6,9 @@
</span>
<span class="content"><%= comment.content %></span>
<span class="timestamp">
- Posted <%= time_ago_in_words(comment.created_at) %> ago.
+ <%= t "posted" %>
+ <%= time_ago_in_words(comment.created_at) %>
+ <%= t "ago" %>
</span>
<% if can? :destroy, comment %>
<%= link_to "delete", comment, method: :delete,
@@ -1,7 +1,9 @@
<li>
<span class="content"><%= micropost.content %></span>
<span class="timestamp">
- Posted <%= time_ago_in_words(micropost.created_at) %> ago.
+ <%= t "posted" %>
+ <%= time_ago_in_words(micropost.created_at) %>
+ <%= t "ago" %>
</span>
<% if can? :destroy, micropost %>
<%= link_to "delete", micropost, method: :delete,
@@ -5,7 +5,9 @@
</span>
<span class="content"><%= feed_item.content %></span>
<span class="timestamp">
- Posted <%= time_ago_in_words(feed_item.created_at) %> ago.
+ <%= t "posted" %>
+ <%= time_ago_in_words(feed_item.created_at) %>
+ <%= t "ago" %>.
</span>
</li>
@@ -1,7 +1,7 @@
<%= form_for(Micropost.new) do |f| %>
<%= render 'shared/error_messages', object: f.object %>
<div class="field">
- <%= f.text_area :content, placeholder: "Compose new micropost...", size:"24x2" %>
+ <%= f.text_area :content, placeholder: (t "shared._micropost_form.place_holder"), size:"24x2" %>
</div>
- <%= f.submit "Post", class: "btn btn-large btn-primary" %>
+ <%= f.submit (t "post"), class: "btn btn-large btn-primary" %>
<% end %>
@@ -4,12 +4,12 @@
<strong id="following" class="stat">
<%= @user.followed_users.count %>
</strong>
- following
+ <%= t "shared._stats.following" %>
</a>
<a href="<%= followers_user_path(@user) %>">
<strong id="followers" class="stat">
<%= @user.followers.count %>
</strong>
- followers
+ <%= t "shared._stats.followers" %>
</a>
</div>
@@ -5,9 +5,9 @@
<%= current_user.name %>
</h1>
<span>
- <%= link_to "view my profile", current_user %>
+ <%= link_to (t "shared._user_info.my_profile"), current_user %>
</span>
<span>
- <%= pluralize(current_user.microposts.count, "micropost") %>
+ <%= pluralize(current_user.microposts.count, (t "shared._user_info.micropost.")) %>
</span>
@@ -12,21 +12,18 @@
</section>
</aside>
<div class="span8">
- <h3>Micropost Feed</h3>
+ <h3><%= t ".feed" %></h3>
<%= render 'shared/feed' %>
</div>
</div>
<% else %>
<div class="center hero-unit">
- <h1>Welcome to the BoBlog</h1>
+ <h1><%= t ".title" %></h1>
- <h2>
- This is the home page for the
- Ruby on Rails
- BoBlog.
+ <h2><%= t ".description"%>
</h2>
- <%= link_to "Sign up now!", signup_path, class: "btn btn-large btn-primary" %>
+ <%= link_to (t ".sign_up"), signup_path, class: "btn btn-large btn-primary" %>
</div>
<%= link_to image_tag("rails.png", alt: "Rails"), 'http://rubyonrails.org/' %>
View
@@ -2,4 +2,32 @@
# See https://github.com/svenfuchs/rails-i18n/tree/master/rails%2Flocale for starting points.
en:
- hello: "Hello world"
+ comments:
+ layouts:
+ microposts:
+
+ shared:
+ _user_info:
+ my_profile: "view my profile"
+ micropost: "micropost"
+
+ _stats:
+ following: "following"
+ followers: "followers"
+
+ _micropost_form:
+ place_holder: "Compose new micropost..."
+
+
+ static_pages:
+ home:
+ feed: "Micropost Feed"
+ title: "Welcome to the BoBlog"
+ description: " This is the home page for the
+ Ruby on Rails
+ BoBlog."
+ sign_up: "Sign up now!"
+
+ users:
+
+ post: "Post"
Oops, something went wrong.

0 comments on commit 02b8498

Please sign in to comment.