forge
Explore
Log in

Don't you dare go Hollow

im

Clone
★ 0

0 watching0 forksRustAGPL-3.0542.8 KiBb9f0726Tahinli27 days ago34 commits

shell.rs43 lines, 1.8 KiBHistoryRawDownload
1//! Strings of the shell and of the first pages: the topbar, the restart bar, the 404 page and the
2//! start page. Area modules hold their own strings as they arrive.
3
4use super::Lang;
5
6/// One variant per phrase. Add a variant, then its English and Turkish texts in [`t`].
7#[derive(Clone, Copy, Debug, PartialEq, Eq)]
8pub enum K {
9 /// The badge shown beside an administrator's name.
10 Admin,
11 /// The link on the 404 page that returns to the start page.
12 BackHome,
13 /// The sentence under the 404 title.
14 NotFoundBody,
15 /// The title of the 404 page.
16 NotFoundTitle,
17 /// The bar shown while the server cannot be reached.
18 ServerRestarting,
19 /// The accessible name of the service switcher.
20 Services,
21 /// The first link on every page, which jumps past the topbar.
22 SkipToContent,
23}
24
25/// The text of `key` in `lang`.
26pub fn t(lang: Lang, key: K) -> &'static str {
27 match (key, lang) {
28 (K::Admin, Lang::En) => "Admin",
29 (K::Admin, Lang::Tr) => "Yönetici",
30 (K::BackHome, Lang::En) => "Back to the start",
31 (K::BackHome, Lang::Tr) => "Başlangıca dön",
32 (K::NotFoundBody, Lang::En) => "The page does not exist, or you do not have access to it.",
33 (K::NotFoundBody, Lang::Tr) => "Sayfa yok ya da bu sayfayı görme izniniz yok.",
34 (K::NotFoundTitle, Lang::En) => "Page not found",
35 (K::NotFoundTitle, Lang::Tr) => "Sayfa bulunamadı",
36 (K::ServerRestarting, Lang::En) => "The server is restarting. Reconnecting…",
37 (K::ServerRestarting, Lang::Tr) => "Sunucu yeniden başlatılıyor. Yeniden bağlanılıyor…",
38 (K::Services, Lang::En) => "Services",
39 (K::Services, Lang::Tr) => "Hizmetler",
40 (K::SkipToContent, Lang::En) => "Skip to content",
41 (K::SkipToContent, Lang::Tr) => "İçeriğe geç",
42 }
43}