Answer the question
In order to leave comments, you need to log in
Multilanguage in JS scripts: how to do it right?
Friends,
Please advise the right approaches for creating JS scripts with support for several languages in string parameters inside the script code (for creating a multilingual site).
Preferably, without reassigning the js file handler (AddHandler)...
Thanks in advance, everyone.
--------------
UPD1: A clear answer is here .
Answer the question
In order to leave comments, you need to log in
You can create separate language files (.js or .ini), and depending on the condition, load the desired file. And in the script, use the constants \ variables defined in the file. For example:
var language = {
'lang_header': 'Заголовок"
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question