diff options
author | Colin Reeder <colin@vpzom.click> | 2020-07-21 21:02:32 -0600 |
---|---|---|
committer | Colin Reeder <colin@vpzom.click> | 2020-07-21 21:02:32 -0600 |
commit | 2a92758f2a18f4b918d940979d4cffb6364c952a (patch) | |
tree | 8323e6b8e73dad99ce8b5bab62c69e0685784a6a | |
parent | ff37f13ba8d0cccd8c06db9b52001cd6388e029e (diff) | |
parent | 6bdc3a603dfa72293c3698c34ed8b99407e7ad88 (diff) |
Merge branch 'lang'
-rw-r--r-- | Cargo.lock | 409 | ||||
-rw-r--r-- | Cargo.toml | 5 | ||||
-rw-r--r-- | res/lang/en.ftl | 103 | ||||
-rw-r--r-- | res/lang/eo.ftl | 103 | ||||
-rw-r--r-- | src/components/mod.rs | 67 | ||||
-rw-r--r-- | src/components/timeago.rs | 70 | ||||
-rw-r--r-- | src/main.rs | 91 | ||||
-rw-r--r-- | src/routes/communities.rs | 140 | ||||
-rw-r--r-- | src/routes/mod.rs | 257 | ||||
-rw-r--r-- | src/routes/posts.rs | 57 |
10 files changed, 887 insertions, 415 deletions
@@ -17,12 +17,6 @@ dependencies = [ [[package]] name = "autocfg" -version = "0.1.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1d49d90015b3c36167a20fe2810c5cd875ad504b39cff3d4eae7977e6b7c1cb2" - -[[package]] -name = "autocfg" version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f8aac770f1885fd7e387acedd76065302551364496e46b3dd00860b2f8359b9d" @@ -34,6 +28,12 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cf1de2fe8c75bc145a2f577add951f8134889b4795d47466a54a5c846d691693" [[package]] +name = "byteorder" +version = "1.3.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "08c48aae112d48ed9f069b33538ea9e3e90aa263cfa3d1c24309612b1f7472de" + +[[package]] name = "bytes" version = "0.5.4" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -63,15 +63,6 @@ dependencies = [ ] [[package]] -name = "cloudabi" -version = "0.0.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ddfc5b9aa5d4507acaf872de71051dfd0e309860e88966e1051e462a077aac4f" -dependencies = [ - "bitflags", -] - -[[package]] name = "core-foundation" version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -100,6 +91,46 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4443176a9f2c162692bd3d352d745ef9413eec5782a80d8fd6f8a1ac692a07f7" [[package]] +name = "fluent" +version = "0.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3c3b6132d1377d8776409a337c6851d342aee4e85277c96ecd2755c4e0efde1d" +dependencies = [ + "fluent-bundle", + "unic-langid", +] + +[[package]] +name = "fluent-bundle" +version = "0.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "01a094d494ab2ed06077e9a95f4e47f446c376de95f6c93045dd88c499bfcd70" +dependencies = [ + "fluent-langneg", + "fluent-syntax", + "intl-memoizer", + "intl_pluralrules", + "rental", + "smallvec", + "unic-langid", +] + +[[package]] +name = "fluent-langneg" +version = "0.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2c4ad0989667548f06ccd0e306ed56b61bd4d35458d54df5ec7587c0e8ed5e94" +dependencies = [ + "unic-langid", +] + +[[package]] +name = "fluent-syntax" +version = "0.9.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ac0f7e83d14cccbf26e165d8881dcac5891af0d85a88543c09dd72ebd31d91ba" + +[[package]] name = "fnv" version = "1.0.7" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -121,12 +152,6 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "00b0228411908ca8685dba7fc2cdd70ec9990a6e753e89b6ac91a84c40fbaf4b" [[package]] -name = "fuchsia-cprng" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a06f77d526c1a601b7c4cdd98f54b5eaabffc14d5f2f0296febdc7f357c6d3ba" - -[[package]] name = "fuchsia-zircon" version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -192,6 +217,15 @@ dependencies = [ ] [[package]] +name = "fxhash" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c31b6d751ae2c7f11320402d34e41349dd1016f8d5d45e48c4312bc8625af50c" +dependencies = [ + "byteorder", +] + +[[package]] name = "getrandom" version = "0.1.14" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -237,18 +271,21 @@ dependencies = [ "ammonia", "chrono", "fallible-iterator", + "fluent", + "fluent-langneg", "ginger", "http", "hyper", "hyper-tls", + "lazy_static", "render", "serde", "serde_derive", "serde_json", "serde_urlencoded", - "timeago", "tokio", "trout", + "unic-langid", "urlencoding", ] @@ -347,26 +384,36 @@ version = "1.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c398b2b113b55809ceb9ee3e753fcbac793f1956663f3c36549c1346015c2afe" dependencies = [ - "autocfg 1.0.0", + "autocfg", ] [[package]] -name = "iovec" -version = "0.1.4" +name = "intl-memoizer" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b2b3ea6ff95e175473f8ffe6a7eb7c00d054240321b84c57051175fe3c1e075e" +checksum = "8a0ed58ba6089d49f8a9a7d5e16fc9b9e2019cdf40ef270f3d465fa244d9630b" dependencies = [ - "libc", + "type-map", + "unic-langid", ] [[package]] -name = "isolang" -version = "1.0.0" +name = "intl_pluralrules" +version = "7.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "265ef164908329e47e753c769b14cbb27434abf0c41984dca201484022f09ce5" +checksum = "6c271cdb1f12a9feb3a017619c3ee681f971f270f6757341d6abe1f9f7a98bc3" dependencies = [ - "phf 0.7.24", - "phf_codegen 0.7.24", + "tinystr", + "unic-langid", +] + +[[package]] +name = "iovec" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b2b3ea6ff95e175473f8ffe6a7eb7c00d054240321b84c57051175fe3c1e075e" +dependencies = [ + "libc", ] [[package]] @@ -425,8 +472,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "aae38d669396ca9b707bfc3db254bc382ddb94f57cc5c235f34623a669a01dab" dependencies = [ "log", - "phf 0.8.0", - "phf_codegen 0.8.0", + "phf", + "phf_codegen", "serde", "serde_derive", "serde_json", @@ -531,7 +578,7 @@ version = "0.1.43" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8d59457e662d541ba17869cf51cf177c0b5f0cbf476c66bdc90bf1edac4f875b" dependencies = [ - "autocfg 1.0.0", + "autocfg", "num-traits", ] @@ -541,7 +588,7 @@ version = "0.2.12" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ac267bcc07f48ee5f8935ab0d24f316fb722d7a1292e2913f0cc196b29ffd611" dependencies = [ - "autocfg 1.0.0", + "autocfg", ] [[package]] @@ -570,7 +617,7 @@ version = "0.9.58" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a842db4709b604f0fe5d1170ae3565899be2ad3d9cbc72dedc789ac0511f78de" dependencies = [ - "autocfg 1.0.0", + "autocfg", "cc", "libc", "pkg-config", @@ -585,30 +632,11 @@ checksum = "d4fd5641d01c8f18a23da7b6fe29298ff4b55afcccdf78973b24cf3175fee32e" [[package]] name = "phf" -version = "0.7.24" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b3da44b85f8e8dfaec21adae67f95d93244b2ecf6ad2a692320598dcc8e6dd18" -dependencies = [ - "phf_shared 0.7.24", -] - -[[package]] -name = "phf" version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3dfb61232e34fcb633f43d12c58f83c1df82962dcdfa565a4e866ffc17dafe12" dependencies = [ - "phf_shared 0.8.0", -] - -[[package]] -name = "phf_codegen" -version = "0.7.24" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b03e85129e324ad4166b06b2c7491ae27fe3ec353af72e72cd1654c7225d517e" -dependencies = [ - "phf_generator 0.7.24", - "phf_shared 0.7.24", + "phf_shared", ] [[package]] @@ -617,18 +645,8 @@ version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cbffee61585b0411840d3ece935cce9cb6321f01c45477d30066498cd5e1a815" dependencies = [ - "phf_generator 0.8.0", - "phf_shared 0.8.0", -] - -[[package]] -name = "phf_generator" -version = "0.7.24" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "09364cc93c159b8b06b1f4dd8a4398984503483891b0c26b867cf431fb132662" -dependencies = [ - "phf_shared 0.7.24", - "rand 0.6.5", + "phf_generator", + "phf_shared", ] [[package]] @@ -637,17 +655,8 @@ version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "17367f0cc86f2d25802b2c26ee58a7b23faeccf78a396094c13dced0d0182526" dependencies = [ - "phf_shared 0.8.0", - "rand 0.7.3", -] - -[[package]] -name = "phf_shared" -version = "0.7.24" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "234f71a15de2288bcb7e3b6515828d22af7ec8598ee6d24c3b526fa0a80b67a0" -dependencies = [ - "siphasher 0.2.3", + "phf_shared", + "rand", ] [[package]] @@ -656,7 +665,7 @@ version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c00cf8b9eafe68dde5e9eaa2cef8ee84a9336a47d566ec55ca16589633b65af7" dependencies = [ - "siphasher 0.3.3", + "siphasher", ] [[package]] @@ -736,6 +745,12 @@ dependencies = [ ] [[package]] +name = "proc-macro-hack" +version = "0.5.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7e0456befd48169b9f13ef0f0ad46d492cf9d2dbb918bcf38e01eed4ce3ec5e4" + +[[package]] name = "proc-macro2" version = "1.0.18" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -755,45 +770,16 @@ dependencies = [ [[package]] name = "rand" -version = "0.6.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6d71dacdc3c88c1fde3885a3be3fbab9f35724e6ce99467f7d9c5026132184ca" -dependencies = [ - "autocfg 0.1.7", - "libc", - "rand_chacha 0.1.1", - "rand_core 0.4.2", - "rand_hc 0.1.0", - "rand_isaac", - "rand_jitter", - "rand_os", - "rand_pcg 0.1.2", - "rand_xorshift", - "winapi 0.3.8", -] - -[[package]] -name = "rand" version = "0.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6a6b1679d49b24bbfe0c803429aa1874472f50d9b363131f0e89fc356b544d03" dependencies = [ "getrandom", "libc", - "rand_chacha 0.2.2", - "rand_core 0.5.1", - "rand_hc 0.2.0", - "rand_pcg 0.2.1", -] - -[[package]] -name = "rand_chacha" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "556d3a1ca6600bfcbab7c7c91ccb085ac7fbbcd70e008a98742e7847f4f7bcef" -dependencies = [ - "autocfg 0.1.7", - "rand_core 0.3.1", + "rand_chacha", + "rand_core", + "rand_hc", + "rand_pcg", ] [[package]] @@ -803,26 +789,11 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f4c8ed856279c9737206bf725bf36935d8666ead7aa69b52be55af369d193402" dependencies = [ "ppv-lite86", - "rand_core 0.5.1", -] - -[[package]] -name = "rand_core" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a6fdeb83b075e8266dcc8762c22776f6877a63111121f5f8c7411e5be7eed4b" -dependencies = [ - "rand_core 0.4.2", + "rand_core", ] [[package]] name = "rand_core" -version = "0.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c33a3c44ca05fa6f1807d8e6743f3824e8509beca625669633be0acbdf509dc" - -[[package]] -name = "rand_core" version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "90bde5296fc891b0cef12a6d03ddccc162ce7b2aff54160af9338f8d40df6d19" @@ -832,64 +803,11 @@ dependencies = [ [[package]] name = "rand_hc" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7b40677c7be09ae76218dc623efbf7b18e34bced3f38883af07bb75630a21bc4" -dependencies = [ - "rand_core 0.3.1", -] - -[[package]] -name = "rand_hc" version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ca3129af7b92a17112d59ad498c6f81eaf463253766b90396d39ea7a39d6613c" dependencies = [ - "rand_core 0.5.1", -] - -[[package]] -name = "rand_isaac" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ded997c9d5f13925be2a6fd7e66bf1872597f759fd9dd93513dd7e92e5a5ee08" -dependencies = [ - "rand_core 0.3.1", -] - -[[package]] -name = "rand_jitter" -version = "0.1.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1166d5c91dc97b88d1decc3285bb0a99ed84b05cfd0bc2341bdf2d43fc41e39b" -dependencies = [ - "libc", - "rand_core 0.4.2", - "winapi 0.3.8", -] - -[[package]] -name = "rand_os" -version = "0.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7b75f676a1e053fc562eafbb47838d67c84801e38fc1ba459e8f180deabd5071" -dependencies = [ - "cloudabi", - "fuchsia-cprng", - "libc", - "rand_core 0.4.2", - "rdrand", - "winapi 0.3.8", -] - -[[package]] -name = "rand_pcg" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "abf9b09b01790cfe0364f52bf32995ea3c39f4d2dd011eac241d2914146d0b44" -dependencies = [ - "autocfg 0.1.7", - "rand_core 0.4.2", + "rand_core", ] [[package]] @@ -898,25 +816,7 @@ version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "16abd0c1b639e9eb4d7c50c0b8100b0d0f849be2349829c740fe8e6eb4816429" dependencies = [ - "rand_core 0.5.1", -] - -[[package]] -name = "rand_xorshift" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cbf7e9e623549b0e21f6e97cf8ecf247c1a8fd2e8a992ae265314300b2455d5c" -dependencies = [ - "rand_core 0.3.1", -] - -[[package]] -name = "rdrand" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "678054eb77286b51581ba43620cc911abf02758c91f93f479767aed0f90458b2" -dependencies = [ - "rand_core 0.3.1", + "rand_core", ] [[package]] @@ -954,6 +854,27 @@ dependencies = [ ] [[package]] +name = "rental" +version = "0.5.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8545debe98b2b139fb04cad8618b530e9b07c152d99a5de83c860b877d67847f" +dependencies = [ + "rental-impl", + "stable_deref_trait", +] + +[[package]] +name = "rental-impl" +version = "0.5.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "475e68978dc5b743f2f40d8e0a8fdc83f1c5e78cbf4b8fa5e74e73beebc340de" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] name = "ryu" version = "1.0.5" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -1034,12 +955,6 @@ dependencies = [ [[package]] name = "siphasher" -version = "0.2.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b8de496cf83d4ed58b6be86c3a275b8602f6ffe98d3024a869e124147a9a3ac" - -[[package]] -name = "siphasher" version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fa8f3741c7372e75519bd9346068370c9cdaabcc1f9599cbcf2a2719352286b7" @@ -1069,6 +984,12 @@ dependencies = [ ] [[package]] +name = "stable_deref_trait" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a8f112729512f8e442d81f95a8a7ddf2b7c6b8a1a6f509a95864142b30cab2d3" + +[[package]] name = "string_cache" version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -1076,7 +997,7 @@ checksum = "2940c75beb4e3bf3a494cef919a747a2cb81e52571e212bfbd185074add7208a" dependencies = [ "lazy_static", "new_debug_unreachable", - "phf_shared 0.8.0", + "phf_shared", "precomputed-hash", "serde", ] @@ -1087,8 +1008,8 @@ version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f24c8e5e19d22a726626f1a5e16fe15b132dcf21d10177fa5a45ce7962996b97" dependencies = [ - "phf_generator 0.8.0", - "phf_shared 0.8.0", + "phf_generator", + "phf_shared", "proc-macro2", "quote", ] @@ -1123,7 +1044,7 @@ checksum = "7a6e24d9338a0a5be79593e2fa15a648add6138caa803e2d5bc782c371732ca9" dependencies = [ "cfg-if", "libc", - "rand 0.7.3", + "rand", "redox_syscall", "remove_dir_all", "winapi 0.3.8", @@ -1171,14 +1092,10 @@ dependencies = [ ] [[package]] -name = "timeago" -version = "0.2.1" +name = "tinystr" +version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aff2f3f1ac92d664adfdea85496dceb8c044f66d62e7d953a059023385967cfc" -dependencies = [ - "chrono", - "isolang", -] +checksum = "4bac79c4b51eda1b090b1edebfb667821bbb51f713855164dc7cec2cb8ac2ba3" [[package]] name = "tokio" @@ -1256,6 +1173,58 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e604eb7b43c06650e854be16a2a03155743d3752dd1c943f6829e26b7a36e382" [[package]] +name = "type-map" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9d2741b1474c327d95c1f1e3b0a2c3977c8e128409c572a33af2914e7d636717" +dependencies = [ + "fxhash", +] + +[[package]] +name = "unic-langid" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "73328fcd730a030bdb19ddf23e192187a6b01cd98be6d3140622a89129459ce5" +dependencies = [ + "unic-langid-impl", + "unic-langid-macros", +] + +[[package]] +name = "unic-langid-impl" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1a4a8eeaf0494862c1404c95ec2f4c33a2acff5076f64314b465e3ddae1b934d" +dependencies = [ + "tinystr", +] + +[[package]] +name = "unic-langid-macros" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "18f980d6d87e8805f2836d64b4138cc95aa7986fa63b1f51f67d5fbff64dd6e5" +dependencies = [ + "proc-macro-hack", + "tinystr", + "unic-langid-impl", + "unic-langid-macros-impl", +] + +[[package]] +name = "unic-langid-macros-impl" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "29396ffd97e27574c3e01368b1a64267d3064969e4848e2e130ff668be9daa9f" +dependencies = [ + "proc-macro-hack", + "quote", + "syn", + "unic-langid-impl", +] + +[[package]] name = "unicode-bidi" version = "0.3.4" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -23,4 +23,7 @@ ammonia = "3.1.0" urlencoding = "1.1.1" http = "0.2.1" chrono = "0.4.13" -timeago = "0.2.1" +fluent-langneg = "0.13.0" +fluent = "0.12.0" +lazy_static = "1.4.0" +unic-langid = { version = "0.9.0", features = ["macros"] } diff --git a/res/lang/en.ftl b/res/lang/en.ftl new file mode 100644 index 0000000..34430d4 --- /dev/null +++ b/res/lang/en.ftl @@ -0,0 +1,103 @@ +about = About +about_title = About this instance +about_what_is = What is lotide? +about_text1 = lotide is an attempt to build a federated forum. Users can create communities to share links and text posts and discuss them with other users, include those registered on other servers through +about_text2 = For more information or to view the source code, check out the +about_sourcehut = SourceHut page +about_versions = This instance is running hitide { $hitide_version } on { $backend_name } { $backend_version }. +add_by_remote_id = Add by ID: +all = All +all_title = The Whole Known Network +by = by +comment = Comment +comment_delete_title = Delete Comment +comment_delete_question = Delete this comment? +comment_submit = Post Comment +communities = Communities +community_create = Create Community +community_create_submit = Create +community_edit = Customize Community +community_edit_link = Customize +community_remote_note = This is a remote community, information on this page may be incomplete. +delete = delete +delete_yes = Yes, delete +description = Description +edit = Edit +fetch = Fetch +follow = Follow +follow_request_sent = Follow request sent! +follow_undo = Unfollow +home_follow_prompt1 = Why not +home_follow_prompt2 = follow some communities? +like = Like +like_undo = Unlike +local = Local +login = Login +login_signup_link = create a new account +lookup_nothing = Nothing found. +lookup_title = Lookup +name_prompt = Name: +no_cancel = No, cancel +nothing = Looks like there's nothing here. +nothing_yet = Looks like there's nothing here (yet!). +on = on +or_start = Or +password_prompt = Password: +post_delete_question = Delete this post? +post_delete_title = Delete Post +post_new = New Post +register = Register +remote = Remote +reply = reply +reply_submit = Reply +submit = Submit +submitted = Submitted +text_with_markdown = Text (markdown supported) +timeago_years = + { $years } { $years -> + [one] year + *[other] years + } ago +timeago_months = + { $months } { $months -> + [one] month + *[other] months + } ago +timeago_weeks = + { $weeks } { $weeks -> + [one] week + *[other] weeks + } ago +timeago_days = + { $days } { $days -> + [one] day + *[other] days + } ago +timeago_hours = + { $hours } { $hours -> + [one] hour + *[other] hours + } ago +timeago_minutes = + { $minutes } { $minutes -> + [one] minute + *[other] minutes + } ago +timeago_seconds = + { $seconds } { $seconds -> + [one] second + *[other] seconds + } ago +timeago_now = now +timeago_future = in the future +title = Title +to = to +url = URL +user_edit_description_prompt = Profile Description: +user_edit_not_you = You can only edit your own profile. +user_edit_submit = Save +user_edit_title = Edit Profile +user_remote_note = This is a remote user, information on this page may be incomplete. +username_prompt = Username: +view_at_source = View at Source +view_more_comments = View More Comments diff --git a/res/lang/eo.ftl b/res/lang/eo.ftl new file mode 100644 index 0000000..cd526e9 --- /dev/null +++ b/res/lang/eo.ftl @@ -0,0 +1,103 @@ +about = Pri +about_title = Pri ĉi tiu servilo +about_what_is = Kio estas lotide? +about_text1 = lotide estas provo konstrui federacian forumon. Uzantoj povas krei komunumojn por disdoni ligilojn kaj tekstpoŝtojn kaj diskuti ilin kun aliaj uzantoj, inkluzive de tiuj en aliaj serviloj per +about_text2 = Por pli da informo aŭ vidi la fontkodon, kontrolu la +about_sourcehut = SourceHut paĝon +about_versions = Ĉi tiu servilo uzas hitide { $hitide_version } kun { $backend_name } { $backend_version }. +add_by_remote_id = Aldoni per ID: +all = Ĉiuj +all_title = La Tuta Konata Reto +by = de +comment = Komento +comment_delete_title = Forigi Komenton +comment_delete_question = Ĉu vi volas forigi ĉi tiun komenton? +comment_submit = Afiŝi Komenton +communities = Komunumoj +community_create = Krei Komunumon +community_create_submit = Krei +community_edit = Agordi Komunumon +community_edit_link = Agordi +community_remote_note = Ĉi tiu estas fora komunumo, informo en ĉi tiu paĝo eble neplenas. +delete = forigi +delete_yes = Jes, forigi +description = Priskribo +edit = Redakti +fetch = Alporti +follow = Aboni +follow_request_sent = Abonado peto senditas! +follow_undo = Ne plu aboni +home_follow_prompt1 = Kial ne +home_follow_prompt2 = aboni iujn komunumojn? +like = Ŝati +like_undo = Ne plu ŝati +local = Loka +login = Ensaluti +login_signup_link = krei novan konton +lookup_nothing = Nenio troveblas. +lookup_title = Serĉi +name_prompt = Nomo: +no_cancel = Ne, nuligi +nothing = Ŝajnas, ke estas nenio ĉi tie. +nothing_yet = Ŝajnas, ke estas nenio ĉi tie (ĝis nun!). +on = sur +or_start = Aŭ +password_prompt = Pasvorto: +post_delete_question = Ĉu vi volas forigi ĉi tiun poŝton? +post_delete_title = Forigi Poŝton +post_new = Nova Poŝto +register = Registriĝi +remote = Fora +reply = respondi +reply_submit = Respondi +submit = Sendi +submitted = Afiŝita +text_with_markdown = Teksto (markdown estas permesita) +timeago_years = + antaŭ { $years } { $years -> + [one] jaro + *[other] jaroj + } +timeago_months = + antaŭ { $months } { $months -> + [one] monato + *[other] monatoj + } +timeago_weeks = + antaŭ{ $weeks } { $weeks -> + [one] semajno + *[other] semajnoj + } +timeago_days = + antaŭ { $days } { $days -> + [one] tago + *[other] tagoj + } +timeago_hours = + antaŭ { $hours } { $hours -> + [one] horo + *[other] horoj + } +timeago_minutes = + antaŭ { $minutes } { $minutes -> + [one] minuto + *[other] minutoj + } +timeago_seconds = + antaŭ { $seconds } { $seconds -> + [one] sekundo + *[other] sekundoj + } +timeago_now = nune +timeago_future = estontece +title = Titolo +to = al +url = URL +user_edit_description_prompt = Priskribo de Profilo +user_edit_not_you = Vi nur rajtas redakti vian propran profilon. +user_edit_submit = Konservi +user_edit_title = Redakti Profilon +user_remote_note = Ĉi tiu estas fora uzanto, informo en ĉi tiu paĝo eble neplenas. +username_prompt = Uzantnomo: +view_at_source = Vidi ĉe Fonto +view_more_comments = Vidi Pli da Komentoj diff --git a/src/components/mod.rs b/src/components/mod.rs index f6b5785..b7a3b39 100644 --- a/src/components/mod.rs +++ b/src/components/mod.rs @@ -1,3 +1,5 @@ +pub mod timeago; + use std::borrow::{Borrow, Cow}; use std::collections::HashMap; @@ -8,17 +10,20 @@ use crate::resp_types::{ use crate::util::{abbreviate_link, author_is_me}; use crate::PageBaseData; +pub use timeago::TimeAgo; + #[render::component] -pub fn Comment<'comment, 'base_data>( - comment: &'comment RespPostCommentInfo<'comment>, - base_data: &'base_data PageBaseData, +pub fn Comment<'a>( + comment: &'a RespPostCommentInfo<'a>, + base_data: &'a PageBaseData, + lang: &'a crate::Translator, ) { render::rsx! { <li> <small> <cite><UserLink user={comment.author.as_ref()} /></cite> {" "} - <TimeAgo since={chrono::DateTime::parse_from_rfc3339(&comment.created).unwrap()} /> + <TimeAgo since={chrono::DateTime::parse_from_rfc3339(&comment.created).unwrap()} lang /> </small> <Content src={comment} /> <div class={"actionList"}> @@ -30,18 +35,18 @@ pub fn Comment<'comment, 'base_data>( if comment.your_vote.is_some() { render::rsx! { <form method={"POST"} action={format!("/comments/{}/unlike", comment.id)}> - <button type={"submit"}>{"Unlike"}</button> + <button type={"submit"}>{lang.tr("like_undo", None)}</button> </form> } } else { render::rsx! { <form method={"POST"} action={format!("/comments/{}/like", comment.id)}> - <button type={"submit"}>{"Like"}</button> + <button type={"submit"}>{lang.tr("like", None)}</button> </form> } } } - <a href={format!("/comments/{}", comment.id)}>{"reply"}</a> + <a href={format!("/comments/{}", comment.id)}>{lang.tr("reply", None)}</a> </> }) } else { @@ -51,7 +56,7 @@ pub fn Comment<'comment, 'base_data>( { if author_is_me(&comment.author, &base_data.login) { Some(render::rsx! { - <a href={format!("/comments/{}/delete", comment.id)}>{"delete"}</a> + <a href={format!("/comments/{}/delete", comment.id)}>{lang.tr("delete", None)}</a> }) } else { None @@ -66,7 +71,7 @@ pub fn Comment<'comment, 'base_data>( { replies.iter().map(|reply| { render::rsx! { - <Comment comment={reply} base_data /> + <Comment comment={reply} base_data lang /> } }) .collect::<Vec<_>>() @@ -80,7 +85,7 @@ pub fn Comment<'comment, 'base_data>( { if comment.replies.is_none() && comment.has_replies { Some(render::rsx! { - <ul><li><a href={format!("/comments/{}", comment.id)}>{"-> View More Comments"}</a></li></ul> + <ul><li><a href={format!("/comments/{}", comment.id)}>{"-> "}{lang.tr("view_more_comments", None)}</a></li></ul> }) } else { None @@ -174,6 +179,7 @@ impl<'a, T: HavingContent + 'a> render::Render for Content<'a, T> { #[render::component] pub fn HTPage<'a, Children: render::Render>( base_data: &'a PageBaseData, + lang: &'a crate::Translator, title: &'a str, children: Children, ) { @@ -190,19 +196,19 @@ pub fn HTPage<'a, Children: render::Render>( <header class={"mainHeader"}> <div class={"left actionList"}> <a href={"/"} class={"siteName"}>{"lotide"}</a> - <a href={"/all"}>{"All"}</a> - <a href={"/communities"}>{"Communities"}</a> - <a href={"/about"}>{"About"}</a> + <a href={"/all"}>{lang.tr("all", None)}</a> + <a href={"/communities"}>{lang.tr("communities", None)}</a> + <a href={"/about"}>{lang.tr("about", None)}</a> </div> <div class={"right actionList"}> { match &base_data.login { Some(login) => Some(render::rsx! { - <a href={format!("/users/{}", login.user.id)}>{"👤︎"}</a> + <a href={format!("/users/{}", login.user.id)}>{Cow::Borrowed("👤︎")}</a> }), None => { Some(render::rsx! { - <a href={"/login"}>{"Login"}</a> + <a href={"/login"}>{lang.tr("login", None)}</a> }) } } @@ -217,7 +223,12 @@ pub fn HTPage<'a, Children: render::Render>( } #[render::component] -pub fn PostItem<'post>(post: &'post RespPostListPost<'post>, in_community: bool, no_user: bool) { +pub fn PostItem<'a>( + post: &'a RespPostListPost<'a>, + in_community: bool, + no_user: bool, + lang: &'a crate::Translator, +) { render::rsx! { <li> <a href={format!("/posts/{}", post.as_ref().id)}> @@ -236,14 +247,14 @@ pub fn PostItem<'post>(post: &'post RespPostListPost<'post>, in_community: bool, } } <br /> - {"Submitted"} + {lang.tr("submitted", None)} { if no_user { None } else { Some(render::rsx! { <> - {" by "}<UserLink user={post.author.as_ref()} /> + {" "}{lang.tr("by", None)}{" "}<UserLink user={post.author.as_ref()} /> |