It works
but this solution is using liquid, and liquid is server side, means you need to refresh the page to see the change.
To be more clear here a detailed response
-
open 2 browser screens, one on your admin panel settings/files, the other on themes edit code.
-
on edit code search the folder locales, the are the translation json files by languajes. On every one of this files create an arborescence, I like Images with soubgroup the section of the page an there the image you need.
Someting like this: (en.default.json)
{
"images": {
"slider_section": {
"first": "here add the image",
"second": "here add other image",
},
"footer": {
"other_image": "here other image"
}
}
// the rest of the translations file
}
add this on every languaje you need, but dont translate the keys, just the content.
- Start adding the images you need on files and save the file name on the locales json.
The name of the files is up to you but I recommend you add the language on the filename.
At the end the locales files should looks like this:
en.default.json
{
"images": {
"slider_section": {
"first": "slider1_en.jpg",
"second": "slider2_en.jpg",
},
"footer": {
"other_image": "otherImage_en.json"
}
}
// the rest of the translations file
}
fr.json
{
"images": {
"slider_section": {
"first": "slider1_fr.jpg",
"second": "slider2_fr.jpg",
},
"footer": {
"other_image": "otherImage_fr.json"
}
}
// the rest of the translations file
}
- now we are ready to use the files on our template, you can use it on any place of the template. just use
set the size you prefers, more CSS, class and any you need this is a regular html image. Do the same for each image, just change the key and it’s done!
When you change the language and refresh the page your page will show a different image.