I make a website in html without a template according to this scheme:
At the root of the site is
index.htmland two folders,enandru, with the English and Russian versions of the site, respectively.index.html, which is at the root, they have a common one and it has a built-in language switch code taken from the answer to the question “Language switch on JQ” . This code works great / I just plugged in the pictures of flags, instead of text links.
Here is the code index.html :
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="content-type" content="text/html; charset=utf-8" /> <title>R2FBT amateur radio station</title> <meta name="keywords" content="amateur, radio, station" /> <meta name="description" content="Home page R2FBT" /> <link href="style.css" rel="stylesheet" type="text/css" /> </head> <body> <div id="bg"> <div id="main"> <!-- header begins --> <div id="header"> <ul class="menu-main"> <li><a href="index.html" class="but_t" title="">HOME</a></li> <li><a href="biography.html" class="but" title="">BIOGRAPHY</a></li> <li><a href="eqipment.html" class="but" title="">EQIPMENT</a></li> <li><a href="qsl.html" class="but" title="">QSL</a></li> <li><a href="logbook.html" class="but" title="">LOGBOOK</a></li> <li><a href="dx_cluster.html" class="but" title="">DX CLUSTER</a></li> <li><a href="rbn_map.html" class="but" title="">RBN map</a></li> <li><a href="rbn_graph.html" class="but" title="">RBN on graph</a></li> <li><a href="products.html" class="but" title="">PRODUCTS</a></li> <li><a href="contacts.html" class="but" title="">CONTACTS</a></li> </ul> <script src="/r2fbt.ru/logbook/js/jquery-1.7.2.js" type="text/javascript"> </script> <ul class="language-select"> <li class="active" data-lang="en" style="background: url('images/en.png') no-repeat left center;"></li> <li data-lang="ru" style="background: url('images/ru.png') no-repeat left center;"></li> </ul> <script> $('.language-select').click(function(){ $(this).toggleClass('open'); }) $('.language-select li').click(function(){ var setLang = $('.language-select').data('location'), dataLangSelect = $(this).data('lang') $('.language-select').data('location', dataLangSelect); $('.language-select li').removeClass('active'); $(this).toggleClass('active'); }) </script> The question is how to connect this script to the site so that when choosing for example English in the menu, the path to the English pages is substituted:
<li><a href="/r2fbt.ru/en/biography.html" class="but" title="">BIOGRAPHY</a></li> and when choosing the Russian language - to the Russian pages:
<li><a href="/r2fbt.ru/ru/biography.html" class="but" title="">BIOGRAPHY</a></li>