From b90590d3b59247c9c06adf13e18ae6674a72d6bb Mon Sep 17 00:00:00 2001 From: Philipp Hofer Date: Sun, 3 Aug 2025 12:20:12 +0200 Subject: [PATCH] move emojis into locales, to be able to run maudfmt --- locales/de.yml | 6 ++ locales/en.yml | 6 ++ src/game.rs | 46 +++++++-------- src/index.rs | 45 ++++++--------- src/page.rs | 148 +++++++++++++++++++++++-------------------------- 5 files changed, 118 insertions(+), 133 deletions(-) diff --git a/locales/de.yml b/locales/de.yml index e0b87be..14e9ef0 100644 --- a/locales/de.yml +++ b/locales/de.yml @@ -1,2 +1,8 @@ _version: 1 digital_shadows: "Digitaler Schatten" +icon_home: "🏠" +icon_camera: "📸" +found_camera_title: "Kamera '%{name}' gefunden" +found_camera_body: "✨ You are a star ✨ Star dust sprinkle, sprinkle." +ask_to_change_name: "%{name}, do you want to be named something different? No worries, change here 👇" +funny_name_change_placeholder: "✨ Your new name starts here ✨" diff --git a/locales/en.yml b/locales/en.yml index 14fbbab..09fa542 100644 --- a/locales/en.yml +++ b/locales/en.yml @@ -1,2 +1,8 @@ _version: 1 digital_shadows: "Digital Shadows" +icon_home: "🏠" +icon_camera: "📸" +found_camera_title: "Camera '%{name}' found" +found_camera_body: "✨ You are a star ✨ Star dust sprinkle, sprinkle." +ask_to_change_name: "%{name}, do you want to be named something different? No worries, change here 👇" +funny_name_change_placeholder: "✨ Your new name starts here ✨" diff --git a/src/game.rs b/src/game.rs index 27db6e7..ea29f0a 100644 --- a/src/game.rs +++ b/src/game.rs @@ -29,27 +29,21 @@ async fn index( let mut page = Page::new(req.lang); page.messages(messages); let markup = page.content(html! { - hgroup { - h1 { "Who finds the most cameras?" } - } - p { - mark { "TODO: Explanation of AEF / digital shadows / search game" } - } - - div.mb-sm { - (client.get_display_name()) - ", do you want to be named something different? No worries, change here 👇" - } - - form action="/name" method="post" { - fieldset role="group" { - input - name="name" - placeholder="✨ Your new name starts here ✨" - aria-label="Name"; - input type="submit" value="Save"; + hgroup { + h1 { "Who finds the most cameras?" } + } + p { + mark { "TODO: Explanation of AEF / digital shadows / search game" } + } + + div.mb-sm { (t!("ask_to_change_name", name = client.get_display_name())) } + + form action="/name" method="post" { + fieldset role="group" { + input name="name" placeholder=(t!("funny_name_change_placeholder")) aria-label="Name"; + input type="submit" value="Save"; + } } - } p.mb-0 { "You have found " @@ -62,9 +56,7 @@ async fn index( ol.flex.small { @for sighting in &sightings { - li { - (sighting.camera.name) - } + li { (sighting.camera.name) } } } @@ -79,7 +71,11 @@ async fn index( (rank.client.get_display_name()) @if rank.client == client { (PreEscaped("")) } } - span.font-headline.font-lg { (rank.amount) (PreEscaped(" ")) "📸" } + span.font-headline.font-lg { + (rank.amount) + (PreEscaped(" ")) + (t!("icon_camera")) + } } } } @@ -120,7 +116,7 @@ async fn game( async fn not_found(cookies: CookieJar, headers: HeaderMap) -> Markup { let lang = language(&cookies, &headers); Page::new(lang).content(html! { - h1 { "uups" } + h1 { "uups" } }) } diff --git a/src/index.rs b/src/index.rs index 8b03d37..3ce2c3b 100644 --- a/src/index.rs +++ b/src/index.rs @@ -24,9 +24,7 @@ pub(super) async fn index(cookies: CookieJar, headers: HeaderMap) -> Markup { } p { "Artists: René Mayrhofer (AT), Philipp Hofer (AT), Laura Poulbot (FR), Airan Berg (AT), Andrea Hummer (AT), Ilona Roth (DE/AT), Linda Huber (AT), Gisela Klammsteiner (AT), Sara Koniarek (AT), Simon Sharkey (GB), Valerio Iurato (IT), Doris Roth (DE), Alina Lugovskaya (UA/RU), Selina Nowak (AT), JeanClaude Grieco (AR/AT), Florian Böttcher (AT), Ethem Saygieder-Fischer (AT)" - span.easteregg { - ", Marie Birner (Couch)" - } + span.easteregg { ", Marie Birner (Couch)" } } blockquote { "Digital Shadows confronts visitors with their digital self – copied, measured, analyzed. An experiment on data power, visibility, and control in the digital age." @@ -38,41 +36,32 @@ pub(super) async fn index(cookies: CookieJar, headers: HeaderMap) -> Markup { "Digital Shadows invites the participants to experience questions of digital and physical identity, data security, and control. In immersive zones woven with choreographic elements, visitors encounter themselves mirrored, copied, measured and simultaneously lose themselves in a system that knows more about them than they intend to reveal. Between play and analysis, concealment and transparency, a reflection emerges on identity in the age of facial recognition, deepfakes, and algorithmic profiling. How does one fool a camera? How visible do I want to be? Who owns what I leave behind, and who profits from it? This experiment is a collaborative endeavor between science and art, making power, visibility, and self-determination in digital space tangible. Through an exploration of digital materiality and algorithmic intelligence, a sometimes absurd, always immediate reflection unfolds on our role in data-driven worlds until we face our digital dilemma, and the choice is still ours to make." } - h2 { - "What to do with this information?" - } + h2 { "What to do with this information?" } div.grid.gap-lg { - article { - header { - "Visit our booth" - } + article { + header { "Visit our booth" } - "We will be delighted to see you at our booth in the Post City Linz, where our team will show you, what happens when your Digital Shadow becomes allmighty. " + "We will be delighted to see you at our booth in the Post City Linz, where our team will show you, what happens when your Digital Shadow becomes allmighty. " - a href="https://www.jku.at/ars-electronica-2025-panic-yes-no/digital-shadows/" target="_blank" title="Go to JKU Information Page" { - "Find out more" - } + a + href="https://www.jku.at/ars-electronica-2025-panic-yes-no/digital-shadows/" + target="_blank" + title="Go to JKU Information Page" { + "Find out more" + } - footer { - "Where: Postcity Linz" - } - } - article { - header { - "Play our game" + footer { "Where: Postcity Linz" } } + article { + header { "Play our game" } - "Ever wandered through Linz with the aim to find (hidden) cameras? Well, if you are that kind of person than our 'Discover cameras' game will be ideal for you! " + "Ever wandered through Linz with the aim to find (hidden) cameras? Well, if you are that kind of person than our 'Discover cameras' game will be ideal for you! " - a href="/game" title="Go to Game Page" { - "Find out more" - } + a href="/game" title="Go to Game Page" { "Find out more" } - footer { - "Where: all over Linz" + footer { "Where: all over Linz" } } - } } } ) diff --git a/src/page.rs b/src/page.rs index 658b4c2..186264f 100644 --- a/src/page.rs +++ b/src/page.rs @@ -47,103 +47,91 @@ impl Page { } pub fn content(self, content: Markup) -> Markup { + rust_i18n::set_locale(self.lang.to_locale()); + html! { (DOCTYPE) html lang=(self.lang) { - head { - meta charset="utf-8"; - meta name="viewport" content="width=device-width, initial-scale=1.0"; - link rel="stylesheet" href="/static/pico.min.css"; - link rel="stylesheet" href="/static/style.css"; - title { "Digital Shadows" } - } - body { - header.container { - nav { - ul { - li { - a href="/" { - strong { "Digital Shadows" } - } - } - } - ul { - li { - a href="/" { - span role="img" aria-label="home" { "🏠" } - } - } - li { - a href="/game" { - span role="img" aria-label="camera" { "📸" } - } - } - li { - span id="theme_switcher" {} - } - - li { - button id="lang-toggle" lang=(self.lang.next_language()) { - (self.lang.next_language()) - } - } - } - } + head { + meta charset="utf-8"; + meta name="viewport" content="width=device-width, initial-scale=1.0"; + link rel="stylesheet" href="/static/pico.min.css"; + link rel="stylesheet" href="/static/style.css"; + title { "Digital Shadows" } } + body { + header.container { + nav { + ul { + li { + a href="/" { + strong { "Digital Shadows" } + } + } + } + ul { + li { + a href="/" { + span role="img" aria-label="home" { (t!("icon_home")) } + } + } + li { + a href="/game" { + span role="img" aria-label="camera" { (t!("icon_home")) } + } + } + li { + span id="theme_switcher" {} + } - main.container { - @if let Some(found_camera) = &self.found_camera { - article class="succ w-full" { - header { - "Camera " - (found_camera) - " found" - } - "✨ You are a star ✨ Star dust sprinkle, sprinkle. " - a href="#ranking" { - "See your ranking" - } - footer { - "Rear Exit Cam" + li { + button id="lang-toggle" lang=(self.lang.next_language()) { + (self.lang.next_language()) + } + } } } } - @if self.new_name { - article class="name w-full" { - header { - "New name!" + main.container { + @if let Some(found_camera) = &self.found_camera { + article class="succ w-full" { + header { (t!("found_camera", name = found_camera)) } + (t!("found_camera_body")) + a href="#ranking" { "See your ranking" } + footer { (found_camera) } } - "Welcome" } + @if self.new_name { + article class="name w-full" { + header { "New name!" } + "Welcome" + } + } + @if let Some(err) = &self.err { + article class="error w-full" { + header { (err.0) } + (err.1) + footer { (err.2) } + } + } + + section { (content) } } - @if let Some(err) = &self.err { - article class="error w-full" { - header { - (err.0) - } - (err.1) - footer { - (err.2) + footer.container { + small { + "Footer " + mark { "to be completed" } + a href="#" { "with links" } + " • " + a target="_blank" href="https://www.digidow.eu/impressum/" { + "Impressum" } } } - - section { (content) } + script src="/static/theme.js" {} } - - footer.container { - small { - "Footer " - mark { "to be completed" } - a href="#" { "with links" } - " • " - a target="_blank" href="https://www.digidow.eu/impressum/" { "Impressum" } - } - } - script src="/static/theme.js" {} - } } } }