Your best bet in an organization is to have different stylesheets specific to localization, and then set up a condition in your layout on which stylesheets will be displayed based on the locale.
Just set only the local specific style, and if you think about it ... it should not have a big impact on the load time, because I believe that you only change the font size.
UPDATE from OP:
Here is what I set up to work:
- I created the
locales
directory in app/assets/stylesheets
- I put internal locale style sheets inside e.g.
fr.sass
- I set a condition in
layouts/application.html.erb
to link to css files: <% if I18n.locale != :en %> <%= stylesheet_link_tag "locales/" + I18n.locale.to_s %> <% end %>
- I set precompilation rules in
config/application.rb
config.assets.precompile += 'locales/*.css'
Note that I am whitelisting the assets that I want to compile in application.css
, so locale-specific styles will not get into application.css
.
source share