It turns out it is not necessary to downcase and underscore locale names to use the globalize-accessor gem. The gem will automatically underscore the locale name when defining and calling the accessor methods.
28 lines
972 B
Plaintext
28 lines
972 B
Plaintext
<% I18n.available_locales.each do |locale| %>
|
|
<%= link_to t("admin.translations.remove_language"), "#",
|
|
id: "delete-#{locale}",
|
|
style: show_delete?(locale),
|
|
class: 'float-right delete js-delete-language',
|
|
data: { locale: locale } %>
|
|
|
|
<% end %>
|
|
|
|
<ul class="tabs" data-tabs id="globalize_locale">
|
|
<% I18n.available_locales.each do |locale| %>
|
|
<li class="tabs-title">
|
|
<%= link_to name_for_locale(locale), "#",
|
|
style: css_to_display_translation?(resource, locale),
|
|
class: "js-globalize-locale-link #{highlight_current?(locale)}",
|
|
data: { locale: locale },
|
|
remote: true %>
|
|
</li>
|
|
<% end %>
|
|
</ul>
|
|
|
|
<div class="small-12 medium-6">
|
|
<%= select_tag :translation_locale,
|
|
options_for_locale_select,
|
|
prompt: t("admin.translations.add_language"),
|
|
class: "js-globalize-locale" %>
|
|
</div>
|