Mercurial Hosting > luan
comparison website/src/site.js @ 1929:31f006c64782
translation
author | Franklin Schmidt <fschmidt@gmail.com> |
---|---|
date | Thu, 01 May 2025 18:31:05 -0600 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
1928:e16f38f4fdfc | 1929:31f006c64782 |
---|---|
1 'use strict'; | |
2 | |
3 function setLanguage(lang) { | |
4 console.log(lang); | |
5 let path = location.pathname; | |
6 if( path.match(/^\/[a-z]{2}\//) ) | |
7 path = path.substring(3); | |
8 if( lang !== 'en' ) | |
9 path = "/" + lang + path; | |
10 location = path; | |
11 } |