This repository is private.
All pages are served over SSL and all pushing and pulling is done over SSH.
No one may fork, clone, or view it unless they are added as a member.
Every repository with this icon (
) is private.
Every repository with this icon (
This repository is public.
Anyone may fork, clone, or view it.
Every repository with this icon (
) is public.
Every repository with this icon (
Helpers
Ideas
1. Spice up the #translate helper by passing results to arbitrary helpers:
# setup
Globalize.format_view_translations do |translation|
c = ["translation", "locale-#{translation.locale}"]
c += ["fallback", "requested_locale-#{translation.requested_locale}"] if translation.fallback?
content_tag 'span', translation, :class => c.join(' ')
end
# use
<%= t :foo %>
# output
<span class="translation locale-en fallback requested_locale-de-DE">Foo</span>
2. It’s always possible to use activesupport `with_options`:
<% I18n.with_options :scope => [:foo, :bar] |locale| %>
<%= locale.t :baz %>
<% end %>
But it might be helpful to make this a little shorter:
<% Globalize.with_options :scope => [:foo, :bar] do %>
<%= t :baz %>
<% end %>






