Skip to content

Commit

Permalink
More work toward translating classify page
Browse files Browse the repository at this point in the history
  • Loading branch information
brian-c committed Mar 19, 2013
1 parent 5dbaa86 commit 7002c2b
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 13 deletions.
6 changes: 0 additions & 6 deletions app/controllers/animal_menu_item.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,6 @@ class AnimalMenuItem extends Controller

constructor: ->
super

@html template @

@model.bind 'change', @onModelChange

onModelChange: =>
@caption.html @model.label

module.exports = AnimalMenuItem
12 changes: 7 additions & 5 deletions app/views/animal_details.eco
Original file line number Diff line number Diff line change
Expand Up @@ -9,30 +9,32 @@
</div>

<div class="content">
<p class="label"><%- @label %></p>
<p><%- @description %></p>
<p class="label"><%- translate span: "animals.#{@id}.label" %></p>
<p><%- translate span: "animals.#{@id}.description" %></p>

<% differences = try translate "differences.#{@id}" %>
<% if differences?: %>
<p><%- translate 'classify.oftenConfused' %>
<% for animalId of differences: %>
<% animal = try Animal.find animalId %>
<% if animal: %>
<button name="confusion" data-popup=".<%- animal.id %>.confusion-popup" data-popup-position="center bottom, center top, 10"><%- animal.label %></button>
<button name="confusion" data-popup=".<%- animal.id %>.confusion-popup" data-popup-position="center bottom, center top, 10"><%- translate span: "animals.#{animal.id}.label" %></button>
<% else: %>
<button name="confusion" data-popup=".<%- animalId.replace /\s/g, '' %>.confusion-popup" data-popup-position="center bottom, center top, 10"><%- animalId %></button>
<% end %>
<% end %>
</p>

<!-- TODO: Differences still don't change languages right. -->

<% for animalId, difference of differences: %>
<% animal = try Animal.find animalId %>
<div class="<%= animalId.replace /\s/g, '' %> confusion-popup">
<% if animal: %>
<div class="image"></div>
<div class="description">
<p class="label"><%- animal.label %></p>
<p><%- difference %></p>
<p class="label"><%- translate "animals.#{animal.id}.label" %></p>
<p><%- translate span: "differences.#{@id}.#{animal.id}" %></p>
</div>
<% else: %>
<%- difference %>
Expand Down
4 changes: 3 additions & 1 deletion app/views/animal_menu_item.eco
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
<% translate = require 't7e' %>

<figure>
<img src="<%- @model.image %>" />
<figcaption><%- @model.label %></figcaption>
<figcaption><%- translate span: "animals.#{@model.id}.label" %></figcaption>
</figure>
2 changes: 1 addition & 1 deletion app/views/animal_selector.eco
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
<% for animal in @set.items: %>
<div data-animal="<%= animal.id %>" tabindex="0">
<div class="image"><!--Space for sprite--></div>
<span class="label"><%- animal.label %></span>
<span class="label"><%- translate span: "animals.#{animal.id}.label" %></span>
</div>
<% end %>

Expand Down

0 comments on commit 7002c2b

Please sign in to comment.