What is the best approach in order to localize images (buttons and other content) in a i18n rails app?
"he occlusal technique is a method used to examine large ai. s of the upper or lower jaw. exposed at different angles, can be used as a localization technique.
Image localization is the practice of adapting the images in your digital content for a new audience in a different location.
I usually inject the locale name in every path or in the image name. In the first case, create different folders for different locales
/public/images/en/file.png
/public/images/it/file.png
image_tag("#{I18n.locale}/file.png")
In the second case
/public/images/file.it.png
/public/images/file.en.png
image_tag("file.#{I18n.locale}.png")
I usually prefer the second solution because there are many assets I don't need to localize and I often need to keep translated/common assets in the same folders to take advantage of convenction-over-configuration pattern.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With