I'm about to launch a website which is available in three languages : English, French, German.
Right now we use a detection of the user's browser's language to display the right language automatically.
Each of the text objects in the HTML is assigned an id and we use innerHTML in a javascript file to replace text with the right language.
Here's an example of what we have in the JS :
function adjust_languages() {
// change all object text, if french
if (sprache == "french") {
document.getElementById("hello").innerHTML = "Bonjour";
}
// change all objects if german
else if (sprache == "german") {
document.getElementById("hello").innerHTML = "Hallo";
}
else {
// PUT ALL THE ENGLISH HERE
document.getElementById("hello").innerHTML = "Hello";
}
}
I'm curious to know if this method could also work for multilingual meta descriptions.
What I want is that Google displays the meta description of the website depending on the user's browser's language.
For example, if the user types in French keywords, or just simply types the name of the website in a browser whose default language is set as French, I want Google to display the French version of the website in the results (therefore with a French meta description).
Will the innerHTML method work in this case as well ?