diff --git a/changelog.toml b/changelog.toml index 3a3369d..db431a5 100644 --- a/changelog.toml +++ b/changelog.toml @@ -14,22 +14,22 @@ version = "2.0.0" date = 2026-12-01 en = [ - "European edition: this year's pictures come from all over Europe.", + "Europe edition: this year's pictures come from all over Europe.", "New scoring: points go down smoothly the further off you are, and the clock wraps around midnight (23:50 is 20 minutes away from 00:10).", "Same-day bonus: +20 points if you guess before the next picture unlocks.", "You can sign up with an email and a password. Discord, GitHub and Microsoft still work.", "New players get a random animal name, like brave-badger. You can change it from your profile page.", "Players from 2025 keep their account and their name.", - "Last year's game is archived: switch to the Sweden 2025 edition on the leaderboard or on your profile to see the final ranking and your guesses.", + "Last year's game is archived: switch to 2025 on the leaderboard or on your profile to see the final ranking and your guesses.", "The whole site was rebuilt from scratch on sturdier foundations.", ] fr = [ - "Édition européenne : les photos de cette année viennent de toute l'Europe.", + "Édition Europe : les photos de cette année viennent de toute l'Europe.", "Nouveau calcul des points : ils baissent progressivement avec ton écart, et l'horloge fait le tour de minuit (23:50 est à 20 minutes de 00:10).", "Bonus du jour : +20 points si tu devines avant que la photo suivante se débloque.", "Tu peux t'inscrire avec un e-mail et un mot de passe. Discord, GitHub et Microsoft marchent toujours.", "Les nouveaux joueurs reçoivent un nom d'animal au hasard, comme brave-badger. Tu peux le changer depuis ta page de profil.", "Les joueurs de 2025 gardent leur compte et leur nom.", - "Le jeu de l'an dernier est archivé : passe à l'édition Stockholm 2025 sur le classement ou sur ton profil pour revoir le classement final et tes réponses.", + "Le jeu de l'an dernier est archivé : passe à 2025 sur le classement ou sur ton profil pour revoir le classement final et tes réponses.", "Tout le site a été reconstruit de zéro, sur des bases plus solides.", ] diff --git a/locales/en.toml b/locales/en.toml index 8c34dd8..41889e3 100644 --- a/locales/en.toml +++ b/locales/en.toml @@ -3,7 +3,7 @@ check_point_system = "Check point system" [edition] y2025 = "Sweden 2025 edition" -y2026 = "European 2026 edition" +y2026 = "Europe 2026 edition" [index] about = "About" diff --git a/locales/fr.toml b/locales/fr.toml index b9f93dd..906d9da 100644 --- a/locales/fr.toml +++ b/locales/fr.toml @@ -3,7 +3,7 @@ check_point_system = "Calcul du score" [edition] y2025 = "Édition Stockholm 2025" -y2026 = "Édition européenne 2026" +y2026 = "Édition Europe 2026" [index] about = "À Propos" diff --git a/src/web/pages.rs b/src/web/pages.rs index bf2d39e..50213d1 100644 --- a/src/web/pages.rs +++ b/src/web/pages.rs @@ -32,18 +32,18 @@ fn pick_edition(raw: Option<&str>) -> Option<&'static Edition> { struct EditionLink { href: String, - label: &'static str, + year: i32, selected: bool, } -/// The edition switcher on `path`, newest first. -fn edition_links(t: Tr, path: &str, selected: &Edition) -> Vec { +/// The edition switcher on `path`, newest first. It shows only years: the page header names the edition. +fn edition_links(path: &str, selected: &Edition) -> Vec { game::EDITIONS .iter() .rev() .map(|e| EditionLink { href: format!("{path}?edition={}", e.year), - label: edition_label(t, e), + year: e.year, selected: e.year == selected.year, }) .collect() @@ -391,7 +391,7 @@ pub async fn leaderboard(ctx: Ctx, State(state): State, Query(query): t: ctx.t, year: edition.year, edition_label: edition_label(ctx.t, edition), - editions: edition_links(ctx.t, "/leaderboard", edition), + editions: edition_links("/leaderboard", edition), archived: edition.year != game::current().year, max_score_text, rows, @@ -482,7 +482,7 @@ pub async fn profile(ctx: Ctx, State(state): State, Query(query): Quer render(ProfilePage { t: ctx.t, edition_label: edition_label(ctx.t, edition), - editions: edition_links(ctx.t, "/me", edition), + editions: edition_links("/me", edition), archived: edition.year != game::current().year, name: user.name, account_label: provider, diff --git a/src/web/tests.rs b/src/web/tests.rs index 0807c64..31fb5dc 100644 --- a/src/web/tests.rs +++ b/src/web/tests.rs @@ -275,7 +275,7 @@ async fn static_pages_render() { let footer = format!(r#"v{}"#, crate::changelog::VERSION); assert!(get(&app, "/", None).await.body.contains(&footer)); - assert!(get(&app, "/changelog", None).await.body.contains("European edition")); + assert!(get(&app, "/changelog", None).await.body.contains("Europe edition")); } #[tokio::test] @@ -338,7 +338,10 @@ async fn past_editions_stay_visible() { let board = get(&app, "/leaderboard?edition=2025", None).await; assert!(board.body.contains(&alice.name) && board.body.contains(&format!(r#"{points} "#))); - assert!(board.body.contains("Sweden 2025 edition") && board.body.contains(r#"href="/leaderboard?edition=2026""#)); + assert!( + board.body.contains("Sweden 2025 edition") + && board.body.contains(r#"2026"#) + ); assert!( !board.body.contains("/about#faq-point-system"), "the about page explains this year's scoring" diff --git a/templates/editions.html b/templates/editions.html index 59a3e97..2746c6b 100644 --- a/templates/editions.html +++ b/templates/editions.html @@ -1,5 +1,5 @@ {% if editions.len() > 1 %}

- {% for e in editions %}{% if !loop.first %} · {% endif %}{% if e.selected %}{{ e.label }}{% else %}{{ e.label }}{% endif %}{% endfor %} + {% for e in editions %}{% if !loop.first %} · {% endif %}{% if e.selected %}{{ e.year }}{% else %}{{ e.year }}{% endif %}{% endfor %}

{% endif %}