Your best bet in organization is to have different style sheets specific to localization, then set up a condition in your layout on what style sheets to render based of the locale.
Just only put local specific style, and if you think about it...it shouldn't effect load times that much because I believe you are only changing font sizes.
UPDATE from OP:
Here is what I have configured to have this working:
- I created a
locales
directory under app/assets/stylesheets
- I put locale specific stylesheets inside, such as
fr.sass
- I setup the condition in the
layouts/application.html.erb
to reference the css files:
<% if I18n.locale != :en %>
<%= stylesheet_link_tag "locales/" + I18n.locale.to_s %>
<% end %>
- I setup the pre-compile rules in
config/application.rb
config.assets.precompile += 'locales/*.css'
Note that I am white-listing the assets I want to compile into application.css
, so the locale specific styles will not get into the application.css
.