Detect language based on URL #4

Merged
om merged 2 commits from feature/automatic-language-switch into master 2022-10-13 19:07:39 +00:00
Showing only changes of commit 758367ba69 - Show all commits

View file

@ -68,7 +68,14 @@ const typing_speed = 50;
var conversation_count = 0; var conversation_count = 0;
var current_dialog = null; var current_dialog = null;
var current_language = "da"; var current_language = "da";
if(location.protocol.startsWith('http')) { // avoid X-origin errors
if(parent.location.href.match(/\ben\b/)) {
current_language = 'en';
}
} // else: Just stick to danish
var current_dialog_fn = null; var current_dialog_fn = null;
/// SVG 1.1 doesn't do proper text splitting into several lines. /// SVG 1.1 doesn't do proper text splitting into several lines.

Before

Width:  |  Height:  |  Size: 27 KiB

After

Width:  |  Height:  |  Size: 27 KiB