diff src/site.js @ 91:76baf48ea36b

add translation
author Franklin Schmidt <fschmidt@gmail.com>
date Fri, 02 May 2025 17:17:52 -0600
parents
children
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/site.js	Fri May 02 17:17:52 2025 -0600
@@ -0,0 +1,11 @@
+'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;
+}