Translate value labels

This commit is contained in:
ricola 2025-10-13 20:10:15 +02:00
parent b07b0da672
commit 8d8bce3207
2 changed files with 3 additions and 3 deletions

View file

@ -23,7 +23,7 @@
<% @vote.candidates.each do |candidate| %> <% @vote.candidates.each do |candidate| %>
<% if rating = @vote.ratings.find { |rating| rating.user == user and rating.candidate == candidate } %> <% if rating = @vote.ratings.find { |rating| rating.user == user and rating.candidate == candidate } %>
<% value = settings.values.select { |e| e[:id] == rating.value }.first %> <% value = settings.values.select { |e| e[:id] == rating.value }.first %>
<td class="value-<%= value[:id] %>"><%= value[:label] %></td> <td class="value-<%= value[:id] %>"><%= _(value[:label]) %></td>
<% end %> <% end %>
<% end %> <% end %>
</tr> </tr>
@ -47,7 +47,7 @@
<td><%= i %></td> <td><%= i %></td>
<td><%= candidate.name %></td> <td><%= candidate.name %></td>
<% value = settings.values.select { |e| e[:id] == candidate.mj.mj }.first %> <% value = settings.values.select { |e| e[:id] == candidate.mj.mj }.first %>
<td class="value-<%= value[:id] %>"><%= value[:label] %></td> <td class="value-<%= value[:id] %>"><%= _(value[:label]) %></td>
<td><%= candidate.mj.proponents %></td> <td><%= candidate.mj.proponents %></td>
<td><%= candidate.mj.opponents %></td> <td><%= candidate.mj.opponents %></td>
</tr> </tr>

View file

@ -32,7 +32,7 @@
<%= markdown(candidate.description) %> <%= markdown(candidate.description) %>
<ul> <ul>
<% settings.values.reverse.each do |v| %> <% settings.values.reverse.each do |v| %>
<li><input type="radio" name="<%= candidate.id %>" id="<%= candidate.id %>-<%= v[:id] %>" value="<%= v[:id] %>" <% if value == v[:id] %>checked<% end %>><label for="<%= candidate.id %>-<%= v[:id] %>" class="value-<%= v[:id] %>"><%= v[:label] %></label></li> <li><input type="radio" name="<%= candidate.id %>" id="<%= candidate.id %>-<%= v[:id] %>" value="<%= v[:id] %>" <% if value == v[:id] %>checked<% end %>><label for="<%= candidate.id %>-<%= v[:id] %>" class="value-<%= v[:id] %>"><%= _(v[:label]) %></label></li>
<% end %> <% end %>
</ul> </ul>
</li> </li>