: Multilingual SVG for the web Is there a way to create multilingual SVG files for the web? I have an SVG with text that I use on a website. Now if the user changes the language on the website
Is there a way to create multilingual SVG files for the web?
I have an SVG with text that I use on a website.
Now if the user changes the language on the website I should normally create a new images for that language. Is there a way to add translation strings to an SVG that change based on some parameter?
More posts by @Cooney243
1 Comments
Sorted by latest first Latest Oldest Best
If I were you I would use jQuery to detect what language the browser is and use separate files, such as:
icon_de.svg
icon_en.svg
icon_se_svg
Then with jQuery use navigator.language to detect the language and if you have that SVG set then append to icon_.svg.
Example for navigator.language:
if (window.navigator.language != "en") {
doLangSelect(window.navigator.language);
}
Research:
NavigatorLanguage.language
Insert “t” into an images path using JQuery
JavaScript for detecting browser language preference
jQuery browser language detection
Language Codes
Terms of Use Create Support ticket Your support tickets Stock Market News! © vmapp.org2024 All Rights reserved.