view website/src/site.js @ 2141:c62dfd37545f nginx_decoupled

use regex trick to stop stop_nginx.sh from detecting itself
author Violet7
date Mon, 19 Jan 2026 20:56:48 -0800
parents 31f006c64782
children
line wrap: on
line source

'use strict';

function setLanguage(lang) {
	console.log(lang);
	let path = location.pathname;
	if( path.match(/^\/[a-z]{2}\//) )
		path = path.substring(3);
	if( lang !== 'en' )
		path = "/" + lang + path;
	location = path;
}