Skip to content

Commit e788965

Browse files
committed
demonlist: localization support for new demon info
1 parent 4b33430 commit e788965

File tree

2 files changed

+34
-5
lines changed

2 files changed

+34
-5
lines changed

locales/en/overview.ftl

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@ extended-list = Extended List
77
legacy-list = Legacy List
88
.info = These are demons that used to be on the list, but got pushed off as new demons were added. They are here for nostalgic reasons. This list is in no order whatsoever and will not be maintained any longer at all. This means no new records will be added for these demons.
99
10+
demon-info = published by { $publisher }
11+
.score = { $minimal-score } ({ $requirement }%) — { $total-score } (100%) points
12+
.personal-score = { $score } points
13+
1014
## Time machine
1115
time-machine = Time Machine
1216
.info = Enter the date you want to view the demonlist at below. For technical reasons, the earliest possible date is January 4th 2017. Note however that data before August 4th 2017 is only provided on a best-effort basis and not guaranteed to be 100% accurate. Particularly data from before April 4th 2017 contains significant errors!
@@ -17,6 +21,9 @@ time-machine = Time Machine
1721
.destination-validator-valuemissing = Please specify a value
1822
.destination-validator-rangeunderflow = You cannot go back in time that far!
1923
24+
.active-position = Currently #{ $position }
25+
.active-position-legacy = Currently Legacy
26+
2027
.active-info = You are currently looking at the demonlist how it was on
2128
.return = Go to present
2229

pointercrate-demonlist-pages/src/overview.rs

Lines changed: 27 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ use crate::{
77
statsviewer::stats_viewer_panel,
88
};
99
use maud::{html, Markup, PreEscaped};
10+
use pointercrate_core::{localization::tr, trp};
1011
use pointercrate_core_pages::{head::HeadLike, PageFragment};
1112
use pointercrate_demonlist::player::FullPlayer;
1213
use pointercrate_demonlist::{
@@ -158,26 +159,47 @@ impl OverviewPage {
158159
}
159160
}
160161
h3 style = "text-align: left" {
161-
"published by " a.underdotted href = {"/demonlist/statsviewer?player="(demon.publisher.id)} {(demon.publisher.name)}
162+
(PreEscaped(trp!(
163+
"demon-info",
164+
(
165+
"publisher",
166+
html! {
167+
a.underdotted href = {"/demonlist/statsviewer?player="(demon.publisher.id)} {(demon.publisher.name)}
168+
}.into_string()
169+
)
170+
)))
162171
}
163172
div style="text-align: left; font-size: 0.8em" {
164173
@if let Some(current_position) = current_position {
165174
@if current_position > list_config::extended_list_size() {
166-
"Currently Legacy"
175+
(tr("time-machine.active-position-legacy"))
167176
}
168177
@else {
169-
"Currently #"(current_position)
178+
(trp!(
179+
"time-machine.active-position",
180+
("position", current_position)
181+
))
170182
}
171183
}
172184
@else {
173-
(minimal_score) " (" (demon.requirement) "%) — " (total_score) " (100%) points"
185+
(trp!(
186+
"demon-info.score",
187+
("minimal-score", minimal_score),
188+
("requirement", demon.requirement),
189+
("total-score", total_score)
190+
))
174191
}
175192
}
176193
}
177194
@if self.claimed_player.is_some() {
178195
div.flex.col.no-mobile style = "font-weight: bold; text-align: right" {
179196
span style = "font-size: 300%" { (progress) "%" }
180-
span style = "font-size: 0.8em"{ (progress_score) " points"}
197+
span style = "font-size: 0.8em"{
198+
(trp!(
199+
"demon-info.personal-score",
200+
("score", progress_score)
201+
))
202+
}
181203
}
182204
}
183205
}

0 commit comments

Comments
 (0)