view src/site.js @ 114:3be211f0f703 default tip

X Community
author Franklin Schmidt <fschmidt@gmail.com>
date Sat, 06 Dec 2025 16:10:50 -0700
parents 76baf48ea36b
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;
}