How to add localized images to your site
How it works
You can add an image with text localized for different languages via a custom HTML code. This feature will help you make the site more informative for users from different countries. You may use an existing solution or add your own code.
How to get it
Using an existing solution
- Open your project in Publisher Account.
- In the side bar click Site Builder.
- Click Open Site Builder.
- In the Header block, set up the Translations component.
- Select the language(s) you want to add to a localized image.
- Insert the following code to the Custom code block:
Copy
- html
<style>
.localised-image {
text-align: center;
padding: 4em 1em;
}
.localised-image img {
width: 100%;
}
</style>
<div class="localised-image">
<img class="lazy loaded" data-src="https://cdn3.xsolla.com/files/uploaded/2340/d9d69114bb9f7c60f0981639aaa4bf3a.jpeg" />
</div>
- Put the link to each image to the
img
element of thedata-src
attribute. Supported image formats: JPEG, PNG, GIF. - To add several localized images, duplicate the block with the
div
tag and change the image URLs. - Click Preview to see your changes.
Watch the tutorial video for this instruction:
Adding your own code
- In the Builder, click Add block and choose Custom code.
- Insert your own code to the block.
Was this article helpful?
Thank you for your feedback!
We’ll review your message and use it to help us improve your experience.Rate this page
Rate this page
Don’t want to answer
Thank you for your feedback!
Useful links
Last updated: February 14, 2023Found a typo or other text error? Select the text and press Ctrl+Enter.