Skip to content

Commit 1b6d0d0

Browse files
committed
WIP remove dynamic detection of latest version
regression: "latest version" is not translated
1 parent 1096390 commit 1b6d0d0

17 files changed

+7
-93
lines changed

locales/en-US/homepage.ftl

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
## index.hbs
33
tagline = A language empowering everyone { $linebreak } to build reliable and efficient software.
44
get-started = Get Started
5-
homepage-version = Version { $number }
65
76
87
## components/panels/production.hbs

locales/es/homepage.ftl

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
tagline = El lenguaje que empodera a todos { $linebreak } para construir software fiable y eficiente.
44
get-started = Comienza
5-
homepage-version = Versión { $number }
65
76
## components/panels/production.hbs
87

locales/fa/homepage.ftl

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
## index.hbs
22

33
get-started = شروع کنید
4-
homepage-version = نسخه { $number }
54
65
## components/panels/production.hbs
76

locales/fr/homepage.ftl

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
tagline = Un langage qui offre à tous le pouvoir { $linebreak } de construire des logiciels fiables et efficaces.
44
get-started = Commencer
5-
homepage-version = Version { $number }
65
76
## components/panels/production.hbs
87

locales/it/homepage.ftl

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
tagline = Un linguaggio che permette a chiunque { $linebreak } di sviluppare software affidabile ed efficiente.
44
get-started = Inizia
5-
homepage-version = Versione { $number }
65
76
## components/panels/production.hbs
87

locales/ja/homepage.ftl

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
tagline = 効率的で信頼できるソフトウェアを { $linebreak } 誰もがつくれる言語
44
get-started = はじめる
5-
homepage-version = バージョン { $number }
65
76
## components/panels/production.hbs
87

locales/ko/homepage.ftl

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
## index.hbs
22

33
get-started = 시작하기
4-
homepage-version = 버전 { $number }
54
65
## components/panels/production.hbs
76

locales/pl/homepage.ftl

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
tagline = Język umożliwiający każdemu { $linebreak } budowanie niezawodnego i wydajnego oprogramowania.
44
get-started = Rozpocznij
5-
homepage-version = Wersja { $number }
65
76
## components/panels/production.hbs
87

locales/pt-BR/homepage.ftl

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
tagline = Uma linguagem empoderando todos { $linebreak } a construir softwares confiáveis e eficientes.
44
get-started = Comece Agora
5-
homepage-version = Versão { $number }
65
76
## components/panels/production.hbs
87

locales/ru/homepage.ftl

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
tagline = Язык, позволяющий каждому { $linebreak } создавать надёжное и эффективное программное обеспечение
44
get-started = Начало
5-
homepage-version = Версия { $number }
65
76
## components/panels/production.hbs
87

locales/tr/homepage.ftl

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
tagline = Güvenilir ve verimli bir yazılım { $linebreak } oluşturmak için herkesi teşvik eden bir dil.
44
get-started = Başlayın
5-
homepage-version = Sürüm { $number }
65
76
## components/panels/production.hbs
87

locales/xx-AU/homepage.ftl

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
# index.hbs
22
tagline = ˙ǝɹɐʍʇɟos ʇuǝᴉɔᴉɟɟǝ puɐ ǝlqɐᴉlǝɹ plᴉnq oʇ ⁩ʞɐǝɹqǝuᴉl$⁨ ǝuoʎɹǝʌǝ ƃuᴉɹǝʍodɯǝ ǝƃɐnƃuɐl ∀
33
get-started = pǝʇɹɐʇS ʇǝפ
4-
homepage-version = { $number } uoᴉsɹǝΛ
54
65
# components/panels/production.hbs
76
production-title = uoᴉʇɔnpoɹd uᴉ ʇsnɹ

locales/zh-CN/homepage.ftl

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
tagline = 一门赋予每个人{ $linebreak }构建可靠且高效软件能力的语言。
44
get-started = 马上开始
5-
homepage-version = 版本 { $number }
65
76
## components/panels/production.hbs
87

locales/zh-TW/homepage.ftl

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
tagline = 讓每個人都能打造出{ $linebreak }可靠又高效軟體的程式語言
44
get-started = 立即開始
5-
homepage-version = 版本 { $number }
65
76
## components/panels/production.hbs
87

src/main.rs

Lines changed: 6 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,13 @@ mod category;
44
mod headers;
55
mod i18n;
66
mod redirect;
7-
mod rust_version;
87
mod teams;
98

109
use cache::Cache;
1110
use cache::Cached;
1211
use rocket::catch;
1312
use rocket::get;
1413
use rocket::tokio::sync::RwLock;
15-
use rust_version::RustVersion;
1614
use serde::Serialize;
1715
use teams::RustTeams;
1816
use teams::encode_zulip_stream;
@@ -155,13 +153,13 @@ fn robots_txt() -> Option<content::RawText<&'static str>> {
155153
}
156154

157155
#[get("/")]
158-
async fn index(version_cache: &Cache<RustVersion>) -> Template {
159-
render_index(ENGLISH.into(), version_cache).await
156+
async fn index() -> Template {
157+
render_index(ENGLISH.into()).await
160158
}
161159

162160
#[get("/<locale>", rank = 3)]
163-
async fn index_locale(locale: SupportedLocale, version_cache: &Cache<RustVersion>) -> Template {
164-
render_index(locale.0, version_cache).await
161+
async fn index_locale(locale: SupportedLocale) -> Template {
162+
render_index(locale.0).await
165163
}
166164

167165
#[get("/<category>")]
@@ -320,17 +318,9 @@ fn concat_app_js(files: Vec<&str>) -> String {
320318
String::from(&js_path[1..])
321319
}
322320

323-
async fn render_index(lang: String, version_cache: &Cache<RustVersion>) -> Template {
324-
#[derive(Serialize)]
325-
struct IndexData {
326-
rust_version: String,
327-
}
328-
321+
async fn render_index(lang: String) -> Template {
329322
let page = "index";
330-
let data = IndexData {
331-
rust_version: rust_version::rust_version(version_cache).await,
332-
};
333-
let context = Context::new(page, "", true, data, lang);
323+
let context = Context::new(page, "", true, (), lang);
334324
Template::render(page, context)
335325
}
336326

@@ -418,13 +408,11 @@ async fn rocket() -> _ {
418408
.register_helper("encode-zulip-stream", Box::new(encode_zulip_stream));
419409
});
420410

421-
let rust_version = RustVersion::fetch().await.unwrap_or_default();
422411
let teams = RustTeams::fetch().await.unwrap_or_default();
423412

424413
rocket::build()
425414
.attach(templating)
426415
.attach(headers::InjectHeaders)
427-
.manage(Arc::new(RwLock::new(rust_version)))
428416
.manage(Arc::new(RwLock::new(teams)))
429417
.mount(
430418
"/",

src/rust_version.rs

Lines changed: 0 additions & 60 deletions
This file was deleted.

templates/index.html.hbs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
{{fluent "get-started"}}
1313
</a>
1414
<p class="tc f3 f2-l mt3">
15-
<a href="https://blog.rust-lang.org/releases/latest" class="download-link">{{#fluent "homepage-version"}}{{#fluentparam "number"}}{{data.rust_version}}{{/fluentparam}}{{/fluent}}</a>
15+
<a href="https://blog.rust-lang.org/releases/latest" class="download-link">latest release</a>
1616
</p>
1717
</div>
1818
</div>

0 commit comments

Comments
 (0)