Internationalization of stylesheets

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Internationalization of stylesheets

Norm Scherer
My application supports a dozen locales.  I use different stylesheets for each locale because things differ and it looks better if the styles fit the locale.
Currently I use <%= stylesheet_link_tag "/stylesheets/#{I18n.locale}.css", :media => "screen" %> in my layouts as needed.
This works but I do not get the advantages of fingerprinting and minification that one would get with assets.

Is there a better way to do this?

Thanks
Norm

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/24f69bd7-9e1f-785c-90e3-46f3c3eb56b4%40earthlink.net.
Reply | Threaded
Open this post in threaded view
|

Re: Internationalization of stylesheets

Ariel Juodziukynas
Do the style for each locale differ a lot?

Personally, I would use a class or attribute to se the language on the body or the html element and put all languages on the same file and add the language as the selector for the things that should be different. It the difference is little you shouldn't have any problem with the size since minification and gzip compression should be enough.

If the styles are too different, I'm not sure.

El mar., 15 oct. 2019 a las 18:25, Norm Scherer (<[hidden email]>) escribió:
My application supports a dozen locales.  I use different stylesheets for each locale because things differ and it looks better if the styles fit the locale.
Currently I use <%= stylesheet_link_tag "/stylesheets/#{I18n.locale}.css", :media => "screen" %> in my layouts as needed.
This works but I do not get the advantages of fingerprinting and minification that one would get with assets.

Is there a better way to do this?

Thanks
Norm

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/24f69bd7-9e1f-785c-90e3-46f3c3eb56b4%40earthlink.net.

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/CAPS3bcDOh%3Dt%3D-p%3DPZ1hUZ%2BXtvFHjTWKUGt1wQLNrBxYw8K_%3DmQ%40mail.gmail.com.