Mobile app version of vmapp.org
Login or Join
Cooney243

: 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

@Cooney243

Posted in: #Inkscape #Svg #WebsiteDesign

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?

10.01% popularity Vote Up Vote Down


Login to follow query

More posts by @Cooney243

1 Comments

Sorted by latest first Latest Oldest Best

 

@Smith574

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

10% popularity Vote Up Vote Down


Back to top | Use Dark Theme