How to make a website in two languages?

Hi all.
I read here advice to create a website in several languages. I have two: eng/ru.
Do not fully understand the implementation. The original site on the domain. com, on the eng language. On this landing page (the site has only 1 page) to add a switch to eng. I read that you should use json and set the value for the two languages. The question is, what about the content of the site? So practically what algorithm / where to set the values for another language ?
And the second question: if you have selected on the website specific language - how to make so that when you refresh the page it was, and didn't switch to primary language ?

Third question: is it possible to make the second page, fully in another language and connect it to a menu for language selection?

Thank you.
March 19th 20 at 08:52
2 answers
March 19th 20 at 08:54
If only two, then it is most convenient (for the customer) to upload both languages in one page, the more it's landing and long journey to the site and content are planned.

Thus, you need to:
1) keeping the current language in a cookie or in local storage.
2) If a user on the website automatically detect the language. The easiest way to do it through JS using navigator.language, navigator.languages, etc. (have to Google).
3) a Button to switch languages, where you want.
4) Language changes without reloading the page. It is also JS.
5) IMHO, it is also important that the site work without JS for example, in English. Although the server can also specify the language and rearrange the content, but in General this is unnecessary, if not enough pay for the work.
March 19th 20 at 08:56
the second thing is localStorage

such as localStorage.setItem('lang', 'EN')

window.onload = function() {
 lang = localStorage.getItem('lang');
 if(lang === 'EN') {

 } else {

thank you - darian.Osinski commented on March 19th 20 at 08:59

Find more questions by tags HTMLJavaScriptCSS