Compare commits

...

3 commits

Author SHA1 Message Date
om 942b948bb2 Merge pull request 'Detect language based on URL' (#4) from feature/automatic-language-switch into master
Reviewed-on: #4
2022-10-13 19:07:39 +00:00
om 2d13672dde Use URLSearchParams for more robust lang selection 2022-10-10 07:30:58 +02:00
om 758367ba69 Detect language based on URL
If the outer website is english/danish, the chatapp will use the same
language.
2022-10-09 22:13:21 +02:00
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"> <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"> <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. Lær mere om ChatControllen og hvorfor det er en dårlig idé, i vores interaktive ChatControl film ude til venstre.
</p> </p>

View file

@ -32,7 +32,7 @@ will be treated as suspects for child abuse.
</p> </p>
<div id="app-area"> <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"> <p id="movie-sidetext">
Learn more about Chat Control and why it is a bad idea by watching our Learn more about Chat Control and why it is a bad idea by watching our
interactive film on the left. interactive film on the left.

View file

@ -68,7 +68,9 @@ 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 = new URLSearchParams(location.search).get('lang') ?? 'da';
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