Merge pull request 'Detect language based on URL' (#4) from feature/automatic-language-switch into master

Reviewed-on: om/chatcontrol_dk#4
This commit is contained in:
om 2022-10-13 19:07:39 +00:00
commit 942b948bb2
3 changed files with 5 additions and 3 deletions

View file

@ -31,7 +31,7 @@ vil være mistænkte for børnemisbrug.
<div id="app-area">
<object id="movie" data="../img/chatapp.svg" type="image/svg+xml"></object>
<object id="movie" data="../img/chatapp.svg?lang=da" type="image/svg+xml"></object>
<p id="movie-sidetext">
Lær mere om ChatControllen og hvorfor det er en dårlig idé, i vores interaktive ChatControl film ude til venstre.
</p>

View file

@ -32,7 +32,7 @@ will be treated as suspects for child abuse.
</p>
<div id="app-area">
<object id="movie" data="../img/chatapp.svg" type="image/svg+xml"></object>
<object id="movie" data="../img/chatapp.svg?lang=en" type="image/svg+xml"></object>
<p id="movie-sidetext">
Learn more about Chat Control and why it is a bad idea by watching our
interactive film on the left.

View file

@ -68,7 +68,9 @@ const typing_speed = 50;
var conversation_count = 0;
var current_dialog = null;
var current_language = "da";
var current_language = new URLSearchParams(location.search).get('lang') ?? 'da';
var current_dialog_fn = null;
/// SVG 1.1 doesn't do proper text splitting into several lines.

Before

Width:  |  Height:  |  Size: 27 KiB

After

Width:  |  Height:  |  Size: 27 KiB