diff --git a/src/main.rs b/src/main.rs index 1fc3489..c6eb4a2 100644 --- a/src/main.rs +++ b/src/main.rs @@ -8,9 +8,6 @@ use askama::i18n::{langid, Locale}; askama::i18n::load!(LOCALES); use crate::model::{Division, Game, GamePlayer, League, Player, Shot, Team, Language}; - -use serde::{Serialize, Deserialize}; - use views::{GoalDetails, PlayerStats, ShotDetails, TeamStats, IihfStatsI64}; use languages::SupportedLanguage; @@ -28,7 +25,7 @@ use sqlx::{Pool, Postgres}; use std::net::SocketAddr; use std::sync::Arc; -const VERSION: &str = "0.2.9"; +const VERSION: &str = "0.2.10"; #[derive(Template)] #[template(path = "hello.html")] @@ -102,6 +99,8 @@ struct IihfTeamStatsTableTemplate<'a> { #[derive(Template)] #[template(path = "game_list.html")] struct GameListTemplate<'a> { + #[locale] + locale: Locale<'a>, division: Division, iihf_team_stats_table: IihfTeamStatsTableTemplate<'a>, games: Vec, @@ -294,6 +293,7 @@ async fn games_for_division_html( .await .unwrap(); let games_template = GameListTemplate { + locale: lang.into(), division, iihf_team_stats_table: IihfTeamStatsTableTemplate { locale: lang.into(), diff --git a/templates/game_list.html b/templates/game_list.html index 969fea2..30cdf93 100644 --- a/templates/game_list.html +++ b/templates/game_list.html @@ -10,10 +10,10 @@

Games

    {% for game in games %} -
  1. {{ game.name }}
  2. +
  3. {{ game.name }}
  4. {% endfor %}
{% else %} -

No games have been recorded.

+

{{ localize("no-games") }}

{% endif %} {% endblock %} diff --git a/templates/partials/iihf_team_stats_table.html b/templates/partials/iihf_team_stats_table.html index 563bc41..5b487d8 100644 --- a/templates/partials/iihf_team_stats_table.html +++ b/templates/partials/iihf_team_stats_table.html @@ -1,7 +1,7 @@ - + diff --git a/templates/partials/play_by_play_table.html b/templates/partials/play_by_play_table.html index 184c1ab..e6cfb62 100644 --- a/templates/partials/play_by_play_table.html +++ b/templates/partials/play_by_play_table.html @@ -17,9 +17,9 @@ diff --git a/translations/en-CA/terms.ftl b/translations/en-CA/terms.ftl index 576f1fb..a9ba81f 100644 --- a/translations/en-CA/terms.ftl +++ b/translations/en-CA/terms.ftl @@ -1,4 +1,5 @@ game-of-division = { $game } of the { $division } +no-games = No games have been recorded. play-by-play = play-by-play box-score = box score individual = individual @@ -12,6 +13,8 @@ league_ibihf = IBIHF Leagues language_selection = Please choose your language game = game game_plural = games +shot = shot +shot_plural = shots point = point point_plural = points goal = goal diff --git a/translations/en-CA/urls.ftl b/translations/en-CA/urls.ftl index f80243c..85cfc43 100644 --- a/translations/en-CA/urls.ftl +++ b/translations/en-CA/urls.ftl @@ -1,5 +1,5 @@ -game_url = /:lang/games/:id/ -game_url_tmpl = /{ $lang }/games/{ $id }/ +game_url = /:lang/game/:id/ +game_url_tmpl = /{ $lang }/game/{ $id }/ league_url = /:lang/league/:id/ league_url_tmpl = /{ $lang }/league/{ $id }/ division_url = /:lang/division/:id/ diff --git a/translations/fr-CA/terms.ftl b/translations/fr-CA/terms.ftl index d663684..b9d6136 100644 --- a/translations/fr-CA/terms.ftl +++ b/translations/fr-CA/terms.ftl @@ -1,4 +1,5 @@ game-of-division = { $game } de le { $division } +no-games = Aucun match n’a été enregistré. play-by-play = jeu-par-jeu box-score = score de la boîte individual = individu @@ -15,6 +16,8 @@ point = point point_plural = points goal = but goal_plural = buts +shot = tiré +shot_plural = tirs assist = aide assist_plural = aides name = nom
{{ localize("game_plural") }}{{ localize("team") }} {{ localize("point_plural") }} {{ localize("reg_wins_short") }} {{ localize("reg_losses_short") }}{{ shot.player_number }} {% if shot.is_goal %} - Goal + {{ localize("goal") }} {% else %} - Shot + {{ localize("shot") }} {% endif %} {{ shot.period_short_name }}