Skip to content

Commit

Permalink
added localisation for plurals, en and fi work -- but we need es. closes
Browse files Browse the repository at this point in the history
  • Loading branch information
brianflanagan committed Jun 6, 2014
1 parent 9d34072 commit d885583
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 10 deletions.
2 changes: 1 addition & 1 deletion app/views/polls/new.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
%li.ends_at
= f.label :ends_in_hours, t('poll_ends_in')
= f.text_field :ends_in_hours
%label.addendum= t('poll_hours')
%label.addendum= t(:poll_hours)

%ul.actions
%li= f.submit "#{ t('poll_create') }"
12 changes: 6 additions & 6 deletions app/views/polls/show.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -10,21 +10,21 @@
- @poll.options.by_position.each do |option|
%li{class: ( (@poll.winning_option == option) ? 'winner' : nil )}
%div.graph
%label <strong>#{ option.text }</strong> #{ pluralize(option.votes.size, t('poll_vote')) }
%label <strong>#{ option.text }</strong> #{ t(:votes, count: option.votes.size) }
%div{style: "width: #{ (option.votes.size * 100) / (@poll.votes.size) }%;"}
%label <strong>#{ option.text }</strong> #{ pluralize(option.votes.size, t('poll_vote')) }
%label <strong>#{ option.text }</strong> #{ t(:votes, count: option.votes.size) }

- else

%p.no-votes= @poll.is_over? ? t('no_votes_were_cast') : t('no_votes_have_been_cast')

%em.deadline
#{ pluralize(@poll.votes.size, t('poll_vote')) } #{ t('poll_cast') } &bull;
#{ t(:votes, count: @poll.votes.size) } #{ t('poll_cast') } &bull;

- if @poll.is_over?
#{ t('poll_closed') } <strong>#{ pluralize(@poll.ends_in_hours, t('poll_hour')) } ago</strong>
#{ t('poll_closed') } <strong>#{ t(:hours, count: @poll.ends_in_hours) } ago</strong>
- else
#{ t('poll_closes_in') } <strong>#{ pluralize(@poll.ends_in_hours, t('poll_hour')) }</strong>
#{ t('poll_closes_in') } <strong>#{ t(:hours, count: @poll.ends_in_hours) }</strong>

- else

Expand All @@ -46,4 +46,4 @@
%abbr{title: 'selected'} √
#{ option.text }

%em.deadline #{ pluralize(@poll.votes.size, t('poll_vote')) } #{ t('poll_cast') } &bull; #{ t('poll_closes_in') } <strong>#{ pluralize(@poll.ends_in_hours, t('poll_hour')) }</strong>
%em.deadline #{ t(:votes, count: @poll.votes.size) } #{ t('poll_cast') } &bull; #{ t('poll_closes_in') } <strong>#{ t(:hours, count: @poll.ends_in_hours) }</strong>
13 changes: 10 additions & 3 deletions config/locales/en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,19 @@ en:
poll_prompt_placeholder: "Where should we get dinner?"
poll_options: "options"
poll_ends_in: "close poll in"
poll_hours: "hours"
poll_hour: "hour"
poll_create: "create poll"
poll_hour: "hour"
poll_hours: "hours"
poll_vote: "vote"
poll_votes: "votes"
poll_cast: "cast"
poll_closed: "closed"
poll_closes_in: "closes in"
no_votes_were_cast: 'No votes were cast.'
no_votes_have_been_cast: 'No votes have been cast.'
no_votes_have_been_cast: 'No votes have been cast.'
votes:
one: "%{count} vote"
other: "%{count} votes"
hours:
one: "%{count} hour"
other: "%{count} hours"
7 changes: 7 additions & 0 deletions config/locales/fi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,13 @@ fi:
poll_hour: "tunnissa"
poll_create: "käynnistä äänestys"
poll_vote: "ääniä"
poll_votes: "ääniä"
poll_cast: "annettu"
poll_closed: "suljettu"
poll_closes_in: "sulkeutuu"
votes:
one: "%{count} ääniä"
other: "%{count} ääniä"
hours:
one: "%{count} tunnissa"
other: "%{count} tunnissa"

0 comments on commit d885583

Please sign in to comment.