forge
Explore
Log in

Don't you dare go Hollow

forge

Clone
★ 0

0 watching0 forksRustAGPL-3.07.1 MiB490f099Tahinli7 hours ago322 commits

push.rs115 lines, 4.7 KiBHistoryRawDownload
1//! Strings for Web Push: the device card in notification settings, the push notification text and
2//! the test message. Shared strings (Notifications, Save) come from `super::Key`.
3
4use super::Lang;
5
6#[derive(Clone, Copy, Debug, PartialEq, Eq)]
7pub enum K {
8 // Settings card: this device.
9 DeviceHeading,
10 DeviceUnsupported,
11 DeviceNeedsHttps,
12 DeviceIosHint,
13 DeviceDenied,
14 DeviceOn,
15 DeviceOff,
16 DeviceError,
17 TurnOn,
18 TurnOff,
19 SendTest,
20 TestNoDevices,
21 // Settings card: the devices list.
22 DevicesHeading,
23 DevicesEmpty,
24 RemoveDevice,
25 DeviceRemoved,
26 NeverDelivered,
27 // The notification the device shows.
28 TestTitle,
29 TestBody,
30}
31
32/// The phrase for `key`.
33pub fn t(lang: Lang, key: K) -> &'static str {
34 use K::*;
35 match (key, lang) {
36 (DeviceHeading, Lang::En) => "Push notifications on this device",
37 (DeviceHeading, Lang::Tr) => "Bu cihazda anlık bildirimler",
38 (DeviceUnsupported, Lang::En) => "This browser does not support push notifications.",
39 (DeviceUnsupported, Lang::Tr) => "Bu tarayıcı anlık bildirimleri desteklemiyor.",
40 (DeviceNeedsHttps, Lang::En) => "Push notifications need an HTTPS connection.",
41 (DeviceNeedsHttps, Lang::Tr) => "Anlık bildirimler için HTTPS bağlantısı gerekir.",
42 (DeviceIosHint, Lang::En) => {
43 "On iPhone and iPad, add Forge to your Home Screen, open it from there, then turn push on."
44 }
45 (DeviceIosHint, Lang::Tr) => {
46 "iPhone ve iPad'de önce Forge'u Ana Ekrana ekleyin, oradan açın, sonra anlık bildirimleri açın."
47 }
48 (DeviceDenied, Lang::En) => {
49 "Notifications are blocked for this site. Allow them in the browser's site settings, then try again."
50 }
51 (DeviceDenied, Lang::Tr) => {
52 "Bu site için bildirimler engellenmiş. Tarayıcının site ayarlarından izin verip yeniden deneyin."
53 }
54 (DeviceOn, Lang::En) => "Push is on for this device.",
55 (DeviceOn, Lang::Tr) => "Bu cihazda anlık bildirimler açık.",
56 (DeviceOff, Lang::En) => "Push is off for this device.",
57 (DeviceOff, Lang::Tr) => "Bu cihazda anlık bildirimler kapalı.",
58 (DeviceError, Lang::En) => "Push could not be turned on. Try again.",
59 (DeviceError, Lang::Tr) => "Anlık bildirimler açılamadı. Yeniden deneyin.",
60 (TurnOn, Lang::En) => "Turn on for this device",
61 (TurnOn, Lang::Tr) => "Bu cihazda aç",
62 (TurnOff, Lang::En) => "Turn off for this device",
63 (TurnOff, Lang::Tr) => "Bu cihazda kapat",
64 (SendTest, Lang::En) => "Send test notification",
65 (SendTest, Lang::Tr) => "Test bildirimi gönder",
66 (TestNoDevices, Lang::En) => "No device has push on yet. Turn it on first.",
67 (TestNoDevices, Lang::Tr) => "Henüz anlık bildirimi açık bir cihaz yok. Önce bunu açın.",
68 (DevicesHeading, Lang::En) => "Devices",
69 (DevicesHeading, Lang::Tr) => "Cihazlar",
70 (DevicesEmpty, Lang::En) => "No device has push on.",
71 (DevicesEmpty, Lang::Tr) => "Anlık bildirimi açık cihaz yok.",
72 (RemoveDevice, Lang::En) => "Remove",
73 (RemoveDevice, Lang::Tr) => "Kaldır",
74 (DeviceRemoved, Lang::En) => "Device removed.",
75 (DeviceRemoved, Lang::Tr) => "Cihaz kaldırıldı.",
76 (NeverDelivered, Lang::En) => "Nothing delivered yet",
77 (NeverDelivered, Lang::Tr) => "Henüz teslim edilmedi",
78 (TestTitle, Lang::En) => "Forge test notification",
79 (TestTitle, Lang::Tr) => "Forge test bildirimi",
80 (TestBody, Lang::En) => "Push notifications work on this device.",
81 (TestBody, Lang::Tr) => "Anlık bildirimler bu cihazda çalışıyor.",
82 }
83}
84
85/// "Test sent to 2 devices." for the settings notice.
86pub fn test_sent(lang: Lang, devices: usize) -> String {
87 match lang {
88 Lang::En => format!("Test sent to {devices} device(s)."),
89 Lang::Tr => format!("Test {devices} cihaza gönderildi."),
90 }
91}
92
93/// The label before a device's added time: "Added 3 days ago" with the time after it.
94pub fn added_label(lang: Lang) -> &'static str {
95 match lang {
96 Lang::En => "Added",
97 Lang::Tr => "Eklendi",
98 }
99}
100
101/// The label before a device's last delivery: "Last delivered 5 minutes ago".
102pub fn last_delivered_label(lang: Lang) -> &'static str {
103 match lang {
104 Lang::En => "Last delivered",
105 Lang::Tr => "Son teslim",
106 }
107}
108
109/// "3 new security alerts" for the push about advisories.
110pub fn advisory_alerts(lang: Lang, count: u64) -> String {
111 match lang {
112 Lang::En => format!("{count} new security alerts"),
113 Lang::Tr => format!("{count} yeni güvenlik uyarısı"),
114 }
115}