From 70af57c6e1a6d0ddf0841b843c513eeade5fe271 Mon Sep 17 00:00:00 2001 From: Baptiste Gelez Date: Thu, 6 Dec 2018 18:54:16 +0100 Subject: [PATCH] Use Ructe (#327) All the template are now compiled at compile-time with the `ructe` crate. I preferred to use it instead of askama because it allows more complex Rust expressions, where askama only supports a small subset of expressions and doesn't allow them everywhere (for instance, `{{ macro!() | filter }}` would result in a parsing error). The diff is quite huge, but there is normally no changes in functionality. Fixes #161 and unblocks #110 and #273 --- .editorconfig | 4 +- .gitignore | 3 +- .travis.yml | 2 +- Cargo.lock | 588 ++++++++---------- Cargo.toml | 30 +- build.rs | 15 + docs/DEVELOPMENT.md | 25 +- docs/INTERNATIONALIZATION.md | 11 +- plume-common/Cargo.toml | 6 +- plume-common/src/lib.rs | 3 +- plume-common/src/utils.rs | 8 +- plume-models/Cargo.toml | 6 +- plume-models/src/comments.rs | 24 +- plume-models/src/instance.rs | 21 +- plume-models/src/lib.rs | 2 +- plume-models/src/medias.rs | 121 ++-- plume-models/src/notifications.rs | 99 +-- plume-models/src/posts.rs | 16 +- plume-models/src/users.rs | 31 +- po/LINGUAS | 9 - po/de.po | 156 +++-- po/en.po | 87 +-- po/fr.po | 152 ++--- po/gl.po | 153 +++-- po/it.po | 152 +++-- po/ja.po | 225 ++++--- po/nb.po | 159 ++--- po/pl.po | 176 +++--- po/plume.pot | 78 +-- po/ru.po | 164 +++-- rust-toolchain | 2 +- src/api/apps.rs | 4 +- src/api/mod.rs | 11 +- src/api/posts.rs | 6 +- src/main.rs | 22 +- src/routes/blogs.rs | 98 +-- src/routes/comments.rs | 54 +- src/routes/errors.rs | 42 +- src/routes/instance.rs | 212 ++++--- src/routes/likes.rs | 9 +- src/routes/medias.rs | 42 +- src/routes/mod.rs | 67 +- src/routes/notifications.rs | 25 +- src/routes/posts.rs | 229 +++---- src/routes/reshares.rs | 9 +- src/routes/search.rs | 53 +- src/routes/session.rs | 79 ++- src/routes/tags.rs | 24 +- src/routes/user.rs | 326 +++++----- src/routes/well_known.rs | 15 +- src/template_utils.rs | 160 +++++ static/css/main.css | 19 +- templates/{base.html.tera => base.rs.html} | 62 +- templates/blogs/details.html.tera | 50 -- templates/blogs/details.rs.html | 49 ++ templates/blogs/new.html.tera | 15 - templates/blogs/new.rs.html | 14 + templates/errors/403.html.tera | 5 - templates/errors/404.html.tera | 6 - templates/errors/500.html.tera | 6 - templates/errors/base.html.tera | 15 - templates/errors/base.rs.html | 9 + templates/errors/csrf.html.tera | 6 - templates/errors/csrf.rs.html | 12 + templates/errors/not_authorized.rs.html | 8 + templates/errors/not_found.rs.html | 10 + templates/errors/server_error.rs.html | 9 + templates/instance/about.html.tera | 41 -- templates/instance/about.rs.html | 34 + templates/instance/admin.html.tera | 35 -- templates/instance/admin.rs.html | 39 ++ templates/instance/description.html.tera | 32 - templates/instance/federated.html.tera | 23 - templates/instance/federated.rs.html | 31 + templates/instance/feed.html.tera | 25 - templates/instance/feed.rs.html | 27 + templates/instance/index.html.tera | 25 - templates/instance/index.rs.html | 34 + templates/instance/list.html.tera | 33 - templates/instance/list.rs.html | 32 + templates/instance/local.html.tera | 23 - templates/instance/local.rs.html | 32 + templates/instance/users.html.tera | 30 - templates/instance/users.rs.html | 33 + templates/macros.html.tera | 112 ---- templates/medias/details.html.tera | 35 -- templates/medias/details.rs.html | 36 ++ templates/medias/index.html.tera | 31 - templates/medias/index.rs.html | 29 + templates/medias/new.html.tera | 17 - templates/medias/new.rs.html | 28 + templates/notifications/index.html.tera | 66 -- templates/notifications/index.rs.html | 33 + templates/partials/comment.rs.html | 27 + templates/partials/home_feed.rs.html | 14 + .../partials/instance_description.rs.html | 33 + templates/partials/post_card.rs.html | 29 + templates/posts/details.html.tera | 152 ----- templates/posts/details.rs.html | 146 +++++ templates/posts/new.html.tera | 68 -- templates/posts/new.rs.html | 67 ++ templates/search/index.html.tera | 50 -- templates/search/index.rs.html | 43 ++ templates/search/result.html.tera | 26 - templates/search/result.rs.html | 27 + templates/session/login.html.tera | 19 - templates/session/login.rs.html | 18 + templates/tags/index.html.tera | 23 - templates/tags/index.rs.html | 22 + templates/users/dashboard.html.tera | 41 -- templates/users/dashboard.rs.html | 41 ++ templates/users/details.html.tera | 41 -- templates/users/details.rs.html | 36 ++ templates/users/edit.html.tera | 34 - templates/users/edit.rs.html | 30 + templates/users/followers.html.tera | 24 - templates/users/followers.rs.html | 24 + templates/users/header.html.tera | 44 -- templates/users/header.rs.html | 43 ++ templates/users/new.html.tera | 22 - templates/users/new.rs.html | 22 + 121 files changed, 3132 insertions(+), 3260 deletions(-) create mode 100644 build.rs delete mode 100644 po/LINGUAS create mode 100644 src/template_utils.rs rename templates/{base.html.tera => base.rs.html} (50%) delete mode 100644 templates/blogs/details.html.tera create mode 100644 templates/blogs/details.rs.html delete mode 100644 templates/blogs/new.html.tera create mode 100644 templates/blogs/new.rs.html delete mode 100644 templates/errors/403.html.tera delete mode 100644 templates/errors/404.html.tera delete mode 100644 templates/errors/500.html.tera delete mode 100644 templates/errors/base.html.tera create mode 100644 templates/errors/base.rs.html delete mode 100644 templates/errors/csrf.html.tera create mode 100644 templates/errors/csrf.rs.html create mode 100644 templates/errors/not_authorized.rs.html create mode 100644 templates/errors/not_found.rs.html create mode 100644 templates/errors/server_error.rs.html delete mode 100644 templates/instance/about.html.tera create mode 100644 templates/instance/about.rs.html delete mode 100644 templates/instance/admin.html.tera create mode 100644 templates/instance/admin.rs.html delete mode 100644 templates/instance/description.html.tera delete mode 100644 templates/instance/federated.html.tera create mode 100644 templates/instance/federated.rs.html delete mode 100644 templates/instance/feed.html.tera create mode 100644 templates/instance/feed.rs.html delete mode 100644 templates/instance/index.html.tera create mode 100644 templates/instance/index.rs.html delete mode 100644 templates/instance/list.html.tera create mode 100644 templates/instance/list.rs.html delete mode 100644 templates/instance/local.html.tera create mode 100644 templates/instance/local.rs.html delete mode 100644 templates/instance/users.html.tera create mode 100644 templates/instance/users.rs.html delete mode 100644 templates/macros.html.tera delete mode 100644 templates/medias/details.html.tera create mode 100644 templates/medias/details.rs.html delete mode 100644 templates/medias/index.html.tera create mode 100644 templates/medias/index.rs.html delete mode 100644 templates/medias/new.html.tera create mode 100644 templates/medias/new.rs.html delete mode 100644 templates/notifications/index.html.tera create mode 100644 templates/notifications/index.rs.html create mode 100644 templates/partials/comment.rs.html create mode 100644 templates/partials/home_feed.rs.html create mode 100644 templates/partials/instance_description.rs.html create mode 100644 templates/partials/post_card.rs.html delete mode 100644 templates/posts/details.html.tera create mode 100644 templates/posts/details.rs.html delete mode 100644 templates/posts/new.html.tera create mode 100644 templates/posts/new.rs.html delete mode 100644 templates/search/index.html.tera create mode 100644 templates/search/index.rs.html delete mode 100644 templates/search/result.html.tera create mode 100644 templates/search/result.rs.html delete mode 100644 templates/session/login.html.tera create mode 100644 templates/session/login.rs.html delete mode 100644 templates/tags/index.html.tera create mode 100644 templates/tags/index.rs.html delete mode 100644 templates/users/dashboard.html.tera create mode 100644 templates/users/dashboard.rs.html delete mode 100644 templates/users/details.html.tera create mode 100644 templates/users/details.rs.html delete mode 100644 templates/users/edit.html.tera create mode 100644 templates/users/edit.rs.html delete mode 100644 templates/users/followers.html.tera create mode 100644 templates/users/followers.rs.html delete mode 100644 templates/users/header.html.tera create mode 100644 templates/users/header.rs.html delete mode 100644 templates/users/new.html.tera create mode 100644 templates/users/new.rs.html diff --git a/.editorconfig b/.editorconfig index 71300769..824d5aa1 100644 --- a/.editorconfig +++ b/.editorconfig @@ -5,10 +5,10 @@ end_of_line = lf insert_final_newline = true trim_trailing_whitespace = true -[*.{js,rs,css,tera}] +[*.{js,rs,css,tera,html}] charset = utf-8 -[*.{rs,tera,css}] +[*.{rs,tera,css,html}] indent_style = space indent_size = 4 diff --git a/.gitignore b/.gitignore index a611d075..cdcfc757 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,3 @@ - rls /target **/*.rs.bk @@ -14,4 +13,6 @@ docker-compose.yml *.sqlite *.sqlite3 *.swp +tags.* +!tags.rs search_index diff --git a/.travis.yml b/.travis.yml index 12f3f84c..ad7bfd3c 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,6 +1,6 @@ language: rust rust: - - nightly-2018-07-17 + - nightly-2018-10-06 cache: cargo: true directories: diff --git a/Cargo.lock b/Cargo.lock index 063ec443..06d2c958 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -89,11 +89,6 @@ name = "array_tool" version = "1.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -[[package]] -name = "arrayref" -version = "0.3.5" -source = "registry+https://github.com/rust-lang/crates.io-index" - [[package]] name = "arrayvec" version = "0.4.7" @@ -107,6 +102,11 @@ name = "ascii" version = "0.9.1" source = "registry+https://github.com/rust-lang/crates.io-index" +[[package]] +name = "askama_escape" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" + [[package]] name = "atom_syndication" version = "0.6.0" @@ -246,15 +246,6 @@ dependencies = [ "crunchy 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", ] -[[package]] -name = "block-buffer" -version = "0.3.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "arrayref 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)", - "byte-tools 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", -] - [[package]] name = "block-cipher-trait" version = "0.5.3" @@ -293,6 +284,16 @@ name = "byte-tools" version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" +[[package]] +name = "bytecount" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "byteorder" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" + [[package]] name = "byteorder" version = "1.2.6" @@ -404,8 +405,8 @@ dependencies = [ [[package]] name = "cookie" -version = "0.11.0-dev" -source = "git+https://github.com/alexcrichton/cookie-rs?rev=f191ca50#f191ca50cc91a4bf268b7eb254ebc78b73a94ffc" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "base64 0.9.3 (registry+https://github.com/rust-lang/crates.io-index)", "ring 0.13.2 (registry+https://github.com/rust-lang/crates.io-index)", @@ -597,39 +598,34 @@ dependencies = [ ] [[package]] -name = "derive_utils" +name = "devise" version = "0.1.0" -source = "git+https://github.com/SergioBenitez/derive-utils?rev=160da392#160da39233d19e6302272d409a0aea14932b25f2" +source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "derive_utils_codegen 0.1.0 (git+https://github.com/SergioBenitez/derive-utils?rev=160da392)", - "derive_utils_core 0.1.0 (git+https://github.com/SergioBenitez/derive-utils?rev=160da392)", + "devise_codegen 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", + "devise_core 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] -name = "derive_utils_codegen" +name = "devise_codegen" version = "0.1.0" -source = "git+https://github.com/SergioBenitez/derive-utils?rev=160da392#160da39233d19e6302272d409a0aea14932b25f2" +source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "derive_utils_core 0.1.0 (git+https://github.com/SergioBenitez/derive-utils?rev=160da392)", + "devise_core 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "quote 0.6.8 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] -name = "derive_utils_core" +name = "devise_core" version = "0.1.0" -source = "git+https://github.com/SergioBenitez/derive-utils?rev=160da392#160da39233d19e6302272d409a0aea14932b25f2" +source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "bitflags 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)", "proc-macro2 0.4.20 (registry+https://github.com/rust-lang/crates.io-index)", "quote 0.6.8 (registry+https://github.com/rust-lang/crates.io-index)", - "syn 0.14.9 (registry+https://github.com/rust-lang/crates.io-index)", + "syn 0.15.9 (registry+https://github.com/rust-lang/crates.io-index)", ] -[[package]] -name = "deunicode" -version = "0.4.3" -source = "registry+https://github.com/rust-lang/crates.io-index" - [[package]] name = "diesel" version = "1.3.3" @@ -663,14 +659,6 @@ dependencies = [ "migrations_macros 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)", ] -[[package]] -name = "digest" -version = "0.7.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "generic-array 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)", -] - [[package]] name = "dotenv" version = "0.13.0" @@ -701,6 +689,63 @@ name = "either" version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" +[[package]] +name = "encoding" +version = "0.2.33" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "encoding-index-japanese 1.20141219.5 (registry+https://github.com/rust-lang/crates.io-index)", + "encoding-index-korean 1.20141219.5 (registry+https://github.com/rust-lang/crates.io-index)", + "encoding-index-simpchinese 1.20141219.5 (registry+https://github.com/rust-lang/crates.io-index)", + "encoding-index-singlebyte 1.20141219.5 (registry+https://github.com/rust-lang/crates.io-index)", + "encoding-index-tradchinese 1.20141219.5 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "encoding-index-japanese" +version = "1.20141219.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "encoding_index_tests 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "encoding-index-korean" +version = "1.20141219.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "encoding_index_tests 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "encoding-index-simpchinese" +version = "1.20141219.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "encoding_index_tests 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "encoding-index-singlebyte" +version = "1.20141219.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "encoding_index_tests 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "encoding-index-tradchinese" +version = "1.20141219.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "encoding_index_tests 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "encoding_index_tests" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" + [[package]] name = "encoding_rs" version = "0.8.10" @@ -717,14 +762,6 @@ dependencies = [ "backtrace 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)", ] -[[package]] -name = "error-chain" -version = "0.12.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "backtrace 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)", -] - [[package]] name = "fail" version = "0.2.0" @@ -755,11 +792,6 @@ dependencies = [ "synstructure 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)", ] -[[package]] -name = "fake-simd" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" - [[package]] name = "filetime" version = "0.2.1" @@ -876,27 +908,14 @@ dependencies = [ ] [[package]] -name = "gettext-rs" -version = "0.4.1" +name = "gettext" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "gettext-sys 0.19.8 (registry+https://github.com/rust-lang/crates.io-index)", - "locale_config 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", + "byteorder 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", + "encoding 0.2.33 (registry+https://github.com/rust-lang/crates.io-index)", ] -[[package]] -name = "gettext-sys" -version = "0.19.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "cc 1.0.25 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "glob" -version = "0.2.11" -source = "registry+https://github.com/rust-lang/crates.io-index" - [[package]] name = "guid" version = "0.1.0" @@ -1008,11 +1027,6 @@ name = "httparse" version = "1.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" -[[package]] -name = "humansize" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" - [[package]] name = "hyper" version = "0.10.13" @@ -1238,17 +1252,6 @@ dependencies = [ "vcpkg 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)", ] -[[package]] -name = "locale_config" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", - "lazy_static 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)", - "regex 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)", - "winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", -] - [[package]] name = "lock_api" version = "0.1.4" @@ -1312,6 +1315,11 @@ name = "matches" version = "0.1.8" source = "registry+https://github.com/rust-lang/crates.io-index" +[[package]] +name = "md5" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" + [[package]] name = "memchr" version = "2.1.0" @@ -1510,6 +1518,14 @@ name = "nodrop" version = "0.1.12" source = "registry+https://github.com/rust-lang/crates.io-index" +[[package]] +name = "nom" +version = "4.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "memchr 2.1.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "notify" version = "4.0.6" @@ -1631,20 +1647,20 @@ dependencies = [ [[package]] name = "pear" -version = "0.1.0" -source = "git+http://github.com/SergioBenitez/Pear?rev=b475140#b4751403ed9a06bc813b662334f0a555eccae6a0" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "pear_codegen 0.1.0 (git+http://github.com/SergioBenitez/Pear?rev=b475140)", + "pear_codegen 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "pear_codegen" -version = "0.1.0" -source = "git+http://github.com/SergioBenitez/Pear?rev=b475140#b4751403ed9a06bc813b662334f0a555eccae6a0" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "proc-macro2 0.4.20 (registry+https://github.com/rust-lang/crates.io-index)", "quote 0.6.8 (registry+https://github.com/rust-lang/crates.io-index)", - "syn 0.14.9 (registry+https://github.com/rust-lang/crates.io-index)", + "syn 0.15.9 (registry+https://github.com/rust-lang/crates.io-index)", "version_check 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", "yansi 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -1654,45 +1670,6 @@ name = "percent-encoding" version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -[[package]] -name = "pest" -version = "2.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "ucd-trie 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "pest_derive" -version = "2.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "pest 2.0.1 (registry+https://github.com/rust-lang/crates.io-index)", - "pest_generator 2.0.0 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "pest_generator" -version = "2.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "pest 2.0.1 (registry+https://github.com/rust-lang/crates.io-index)", - "pest_meta 2.0.3 (registry+https://github.com/rust-lang/crates.io-index)", - "proc-macro2 0.4.20 (registry+https://github.com/rust-lang/crates.io-index)", - "quote 0.6.8 (registry+https://github.com/rust-lang/crates.io-index)", - "syn 0.14.9 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "pest_meta" -version = "2.0.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "maplit 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)", - "pest 2.0.1 (registry+https://github.com/rust-lang/crates.io-index)", - "sha-1 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", -] - [[package]] name = "phf" version = "0.7.23" @@ -1738,6 +1715,7 @@ name = "plume" version = "0.2.0" dependencies = [ "activitypub 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)", + "askama_escape 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "atom_syndication 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)", "canapi 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "chrono 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", @@ -1746,7 +1724,6 @@ dependencies = [ "diesel 1.3.3 (registry+https://github.com/rust-lang/crates.io-index)", "dotenv 0.13.0 (registry+https://github.com/rust-lang/crates.io-index)", "failure 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", - "gettext-rs 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)", "guid-create 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", "heck 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", "multipart 0.15.3 (registry+https://github.com/rust-lang/crates.io-index)", @@ -1754,19 +1731,18 @@ dependencies = [ "plume-api 0.1.0", "plume-common 0.2.0", "plume-models 0.2.0", - "rocket 0.4.0-dev (git+https://github.com/SergioBenitez/Rocket?rev=55459db7732b9a240826a5c120c650f87e3372ce)", - "rocket_codegen 0.4.0-dev (git+https://github.com/SergioBenitez/Rocket?rev=55459db7732b9a240826a5c120c650f87e3372ce)", - "rocket_contrib 0.4.0-dev (git+https://github.com/SergioBenitez/Rocket?rev=55459db7732b9a240826a5c120c650f87e3372ce)", - "rocket_csrf 0.1.0 (git+https://github.com/fdb-hiroshima/rocket_csrf?rev=0dfb822d5cbf65a5eee698099368b7c0f4c61fa4)", - "rocket_i18n 0.1.1 (git+https://github.com/BaptisteGelez/rocket_i18n?rev=75a3bfd7b847324c078a355a7f101f8241a9f59b)", + "rocket 0.4.0-rc.1 (registry+https://github.com/rust-lang/crates.io-index)", + "rocket_contrib 0.4.0-rc.1 (registry+https://github.com/rust-lang/crates.io-index)", + "rocket_csrf 0.1.0 (git+https://github.com/fdb-hiroshima/rocket_csrf?rev=717fad53cfd2ee5cbee5b4571f6190644f9dddd7)", + "rocket_i18n 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", "rpassword 2.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "ructe 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)", "scheduled-thread-pool 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", "serde 1.0.79 (registry+https://github.com/rust-lang/crates.io-index)", "serde_derive 1.0.79 (registry+https://github.com/rust-lang/crates.io-index)", "serde_json 1.0.32 (registry+https://github.com/rust-lang/crates.io-index)", "serde_qs 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)", - "tera 0.11.17 (registry+https://github.com/rust-lang/crates.io-index)", - "validator 0.7.1 (registry+https://github.com/rust-lang/crates.io-index)", + "validator 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)", "validator_derive 0.7.2 (registry+https://github.com/rust-lang/crates.io-index)", "webfinger 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -1803,14 +1779,13 @@ dependencies = [ "chrono 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", "failure 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", "failure_derive 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", - "gettext-rs 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)", "heck 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", "hex 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)", "hyper 0.11.27 (registry+https://github.com/rust-lang/crates.io-index)", "openssl 0.10.12 (registry+https://github.com/rust-lang/crates.io-index)", "pulldown-cmark 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", "reqwest 0.9.2 (registry+https://github.com/rust-lang/crates.io-index)", - "rocket 0.4.0-dev (git+https://github.com/SergioBenitez/Rocket?rev=55459db7732b9a240826a5c120c650f87e3372ce)", + "rocket 0.4.0-rc.1 (registry+https://github.com/rust-lang/crates.io-index)", "serde 1.0.79 (registry+https://github.com/rust-lang/crates.io-index)", "serde_derive 1.0.79 (registry+https://github.com/rust-lang/crates.io-index)", "serde_json 1.0.32 (registry+https://github.com/rust-lang/crates.io-index)", @@ -1822,6 +1797,7 @@ version = "0.2.0" dependencies = [ "activitypub 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)", "ammonia 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)", + "askama_escape 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "bcrypt 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", "canapi 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "chrono 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", @@ -1835,7 +1811,7 @@ dependencies = [ "plume-api 0.1.0", "plume-common 0.2.0", "reqwest 0.9.2 (registry+https://github.com/rust-lang/crates.io-index)", - "rocket 0.4.0-dev (git+https://github.com/SergioBenitez/Rocket?rev=55459db7732b9a240826a5c120c650f87e3372ce)", + "rocket 0.4.0-rc.1 (registry+https://github.com/rust-lang/crates.io-index)", "serde 1.0.79 (registry+https://github.com/rust-lang/crates.io-index)", "serde_derive 1.0.79 (registry+https://github.com/rust-lang/crates.io-index)", "serde_json 1.0.32 (registry+https://github.com/rust-lang/crates.io-index)", @@ -1990,6 +1966,33 @@ dependencies = [ "winapi 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "rand" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "cloudabi 0.0.3 (registry+https://github.com/rust-lang/crates.io-index)", + "fuchsia-zircon 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.43 (registry+https://github.com/rust-lang/crates.io-index)", + "rand_chacha 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", + "rand_core 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", + "rand_hc 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", + "rand_isaac 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", + "rand_pcg 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", + "rand_xorshift 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", + "rustc_version 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)", + "winapi 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "rand_chacha" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "rand_core 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", + "rustc_version 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "rand_core" version = "0.2.2" @@ -2003,6 +2006,39 @@ name = "rand_core" version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" +[[package]] +name = "rand_hc" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "rand_core 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "rand_isaac" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "rand_core 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "rand_pcg" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "rand_core 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", + "rustc_version 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "rand_xorshift" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "rand_core 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "redox_syscall" version = "0.1.40" @@ -2016,18 +2052,6 @@ dependencies = [ "redox_syscall 0.1.40 (registry+https://github.com/rust-lang/crates.io-index)", ] -[[package]] -name = "regex" -version = "0.2.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "aho-corasick 0.6.8 (registry+https://github.com/rust-lang/crates.io-index)", - "memchr 2.1.0 (registry+https://github.com/rust-lang/crates.io-index)", - "regex-syntax 0.5.6 (registry+https://github.com/rust-lang/crates.io-index)", - "thread_local 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)", - "utf8-ranges 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)", -] - [[package]] name = "regex" version = "1.0.5" @@ -2045,14 +2069,6 @@ name = "regex-syntax" version = "0.3.9" source = "registry+https://github.com/rust-lang/crates.io-index" -[[package]] -name = "regex-syntax" -version = "0.5.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "ucd-util 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", -] - [[package]] name = "regex-syntax" version = "0.6.2" @@ -2135,17 +2151,17 @@ dependencies = [ [[package]] name = "rocket" -version = "0.4.0-dev" -source = "git+https://github.com/SergioBenitez/Rocket?rev=55459db7732b9a240826a5c120c650f87e3372ce#55459db7732b9a240826a5c120c650f87e3372ce" +version = "0.4.0-rc.1" +source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "base64 0.9.3 (registry+https://github.com/rust-lang/crates.io-index)", "isatty 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)", "memchr 2.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "num_cpus 1.8.0 (registry+https://github.com/rust-lang/crates.io-index)", - "pear 0.1.0 (git+http://github.com/SergioBenitez/Pear?rev=b475140)", - "rocket_codegen_next 0.4.0-dev (git+https://github.com/SergioBenitez/Rocket?rev=55459db7732b9a240826a5c120c650f87e3372ce)", - "rocket_http 0.4.0-dev (git+https://github.com/SergioBenitez/Rocket?rev=55459db7732b9a240826a5c120c650f87e3372ce)", + "pear 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", + "rocket_codegen 0.4.0-rc.1 (registry+https://github.com/rust-lang/crates.io-index)", + "rocket_http 0.4.0-rc.1 (registry+https://github.com/rust-lang/crates.io-index)", "state 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)", "time 0.1.40 (registry+https://github.com/rust-lang/crates.io-index)", "toml 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", @@ -2155,77 +2171,65 @@ dependencies = [ [[package]] name = "rocket_codegen" -version = "0.4.0-dev" -source = "git+https://github.com/SergioBenitez/Rocket?rev=55459db7732b9a240826a5c120c650f87e3372ce#55459db7732b9a240826a5c120c650f87e3372ce" +version = "0.4.0-rc.1" +source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ + "devise 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "indexmap 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)", - "rocket_http 0.4.0-dev (git+https://github.com/SergioBenitez/Rocket?rev=55459db7732b9a240826a5c120c650f87e3372ce)", + "quote 0.6.8 (registry+https://github.com/rust-lang/crates.io-index)", + "rocket_http 0.4.0-rc.1 (registry+https://github.com/rust-lang/crates.io-index)", "version_check 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", "yansi 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", ] -[[package]] -name = "rocket_codegen_next" -version = "0.4.0-dev" -source = "git+https://github.com/SergioBenitez/Rocket?rev=55459db7732b9a240826a5c120c650f87e3372ce#55459db7732b9a240826a5c120c650f87e3372ce" -dependencies = [ - "derive_utils 0.1.0 (git+https://github.com/SergioBenitez/derive-utils?rev=160da392)", - "quote 0.6.8 (registry+https://github.com/rust-lang/crates.io-index)", - "rocket_http 0.4.0-dev (git+https://github.com/SergioBenitez/Rocket?rev=55459db7732b9a240826a5c120c650f87e3372ce)", -] - [[package]] name = "rocket_contrib" -version = "0.4.0-dev" -source = "git+https://github.com/SergioBenitez/Rocket?rev=55459db7732b9a240826a5c120c650f87e3372ce#55459db7732b9a240826a5c120c650f87e3372ce" +version = "0.4.0-rc.1" +source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "glob 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)", "notify 4.0.6 (registry+https://github.com/rust-lang/crates.io-index)", - "rocket 0.4.0-dev (git+https://github.com/SergioBenitez/Rocket?rev=55459db7732b9a240826a5c120c650f87e3372ce)", + "rocket 0.4.0-rc.1 (registry+https://github.com/rust-lang/crates.io-index)", "serde 1.0.79 (registry+https://github.com/rust-lang/crates.io-index)", "serde_json 1.0.32 (registry+https://github.com/rust-lang/crates.io-index)", - "tera 0.11.17 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "rocket_csrf" version = "0.1.0" -source = "git+https://github.com/fdb-hiroshima/rocket_csrf?rev=0dfb822d5cbf65a5eee698099368b7c0f4c61fa4#0dfb822d5cbf65a5eee698099368b7c0f4c61fa4" +source = "git+https://github.com/fdb-hiroshima/rocket_csrf?rev=717fad53cfd2ee5cbee5b4571f6190644f9dddd7#717fad53cfd2ee5cbee5b4571f6190644f9dddd7" dependencies = [ "csrf 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", "data-encoding 2.1.1 (registry+https://github.com/rust-lang/crates.io-index)", - "rand 0.5.5 (registry+https://github.com/rust-lang/crates.io-index)", - "rocket 0.4.0-dev (git+https://github.com/SergioBenitez/Rocket?rev=55459db7732b9a240826a5c120c650f87e3372ce)", - "rocket_codegen 0.4.0-dev (git+https://github.com/SergioBenitez/Rocket?rev=55459db7732b9a240826a5c120c650f87e3372ce)", + "rand 0.6.1 (registry+https://github.com/rust-lang/crates.io-index)", + "rocket 0.4.0-rc.1 (registry+https://github.com/rust-lang/crates.io-index)", "serde 1.0.79 (registry+https://github.com/rust-lang/crates.io-index)", "time 0.1.40 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "rocket_http" -version = "0.4.0-dev" -source = "git+https://github.com/SergioBenitez/Rocket?rev=55459db7732b9a240826a5c120c650f87e3372ce#55459db7732b9a240826a5c120c650f87e3372ce" +version = "0.4.0-rc.1" +source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "cookie 0.11.0-dev (git+https://github.com/alexcrichton/cookie-rs?rev=f191ca50)", + "cookie 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)", "hyper 0.10.13 (registry+https://github.com/rust-lang/crates.io-index)", "indexmap 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)", - "pear 0.1.0 (git+http://github.com/SergioBenitez/Pear?rev=b475140)", + "pear 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", "percent-encoding 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)", "smallvec 0.6.5 (registry+https://github.com/rust-lang/crates.io-index)", "state 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)", "time 0.1.40 (registry+https://github.com/rust-lang/crates.io-index)", + "unicode-xid 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "rocket_i18n" -version = "0.1.1" -source = "git+https://github.com/BaptisteGelez/rocket_i18n?rev=75a3bfd7b847324c078a355a7f101f8241a9f59b#75a3bfd7b847324c078a355a7f101f8241a9f59b" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "gettext-rs 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)", - "rocket 0.4.0-dev (git+https://github.com/SergioBenitez/Rocket?rev=55459db7732b9a240826a5c120c650f87e3372ce)", - "serde_json 1.0.32 (registry+https://github.com/rust-lang/crates.io-index)", - "tera 0.11.17 (registry+https://github.com/rust-lang/crates.io-index)", + "gettext 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", + "rocket 0.4.0-rc.1 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -2238,6 +2242,19 @@ dependencies = [ "winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "ructe" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "base64 0.10.0 (registry+https://github.com/rust-lang/crates.io-index)", + "bytecount 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", + "itertools 0.7.11 (registry+https://github.com/rust-lang/crates.io-index)", + "lazy_static 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)", + "md5 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)", + "nom 4.1.1 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "rust-crypto" version = "0.2.36" @@ -2411,17 +2428,6 @@ dependencies = [ "url 1.7.1 (registry+https://github.com/rust-lang/crates.io-index)", ] -[[package]] -name = "sha-1" -version = "0.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "block-buffer 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)", - "byte-tools 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", - "digest 0.7.6 (registry+https://github.com/rust-lang/crates.io-index)", - "fake-simd 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", -] - [[package]] name = "siphasher" version = "0.2.3" @@ -2447,14 +2453,6 @@ dependencies = [ "winapi 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)", ] -[[package]] -name = "slug" -version = "0.1.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "deunicode 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)", -] - [[package]] name = "smallvec" version = "0.2.1" @@ -2678,26 +2676,6 @@ dependencies = [ "utf-8 0.7.4 (registry+https://github.com/rust-lang/crates.io-index)", ] -[[package]] -name = "tera" -version = "0.11.17" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "chrono 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", - "error-chain 0.12.0 (registry+https://github.com/rust-lang/crates.io-index)", - "glob 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)", - "humansize 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)", - "lazy_static 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)", - "pest 2.0.1 (registry+https://github.com/rust-lang/crates.io-index)", - "pest_derive 2.0.1 (registry+https://github.com/rust-lang/crates.io-index)", - "regex 1.0.5 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.79 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_json 1.0.32 (registry+https://github.com/rust-lang/crates.io-index)", - "slug 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)", - "unic-segment 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", - "url 1.7.1 (registry+https://github.com/rust-lang/crates.io-index)", -] - [[package]] name = "termion" version = "1.5.1" @@ -2971,60 +2949,11 @@ name = "typenum" version = "1.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -[[package]] -name = "ucd-trie" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" - [[package]] name = "ucd-util" version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -[[package]] -name = "unic-char-property" -version = "0.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "unic-char-range 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "unic-char-range" -version = "0.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" - -[[package]] -name = "unic-common" -version = "0.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" - -[[package]] -name = "unic-segment" -version = "0.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "unic-ucd-segment 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "unic-ucd-segment" -version = "0.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "unic-char-property 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", - "unic-char-range 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", - "unic-ucd-version 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "unic-ucd-version" -version = "0.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "unic-common 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", -] - [[package]] name = "unicase" version = "1.4.2" @@ -3130,6 +3059,20 @@ dependencies = [ "url 1.7.1 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "validator" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "idna 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", + "lazy_static 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)", + "regex 1.0.5 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.79 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_derive 1.0.79 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_json 1.0.32 (registry+https://github.com/rust-lang/crates.io-index)", + "url 1.7.1 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "validator_derive" version = "0.7.2" @@ -3275,9 +3218,9 @@ source = "registry+https://github.com/rust-lang/crates.io-index" "checksum ansi_term 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ee49baf6cb617b853aa8d93bf420db2383fab46d314482ca2803b40d5fde979b" "checksum antidote 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "34fde25430d87a9388dadbe6e34d7f72a462c8b43ac8d309b42b0a8505d7e2a5" "checksum array_tool 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)" = "8f8cb5d814eb646a863c4f24978cff2880c4be96ad8cde2c0f0678732902e271" -"checksum arrayref 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)" = "0d382e583f07208808f6b1249e60848879ba3543f57c32277bf52d69c2f0f0ee" "checksum arrayvec 0.4.7 (registry+https://github.com/rust-lang/crates.io-index)" = "a1e964f9e24d588183fcb43503abda40d288c8657dfc27311516ce2f05675aef" "checksum ascii 0.9.1 (registry+https://github.com/rust-lang/crates.io-index)" = "a5fc969a8ce2c9c0c4b0429bb8431544f6658283c8326ba5ff8c762b75369335" +"checksum askama_escape 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "719b48039ffac1564f67d70162109ba9341125cee0096a540e478355b3c724a7" "checksum atom_syndication 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)" = "0a9a7ab83635ff7a3b04856f4ad95324dccc9b947ab1e790fc5c769ee6d6f60c" "checksum atomicwrites 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "a3420b33cdefd3feb223dddc23739fc05cc034eb0f2be792c763e3d89e1eb6e3" "checksum atty 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)" = "9a7d5b8723950951411ee34d271d99dddcc2035a16ab25310ea2c8cfd4369652" @@ -3294,12 +3237,13 @@ source = "registry+https://github.com/rust-lang/crates.io-index" "checksum bitflags 0.9.1 (registry+https://github.com/rust-lang/crates.io-index)" = "4efd02e230a02e18f92fc2735f44597385ed02ad8f831e7c1c1156ee5e1ab3a5" "checksum bitflags 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)" = "228047a76f468627ca71776ecdebd732a3423081fcf5125585bcd7c49886ce12" "checksum bitpacking 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)" = "75c04b83d2b444a22c6a30f4d068597efbe468fe56f068e042e627ded2fb21e7" -"checksum block-buffer 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)" = "a076c298b9ecdb530ed9d967e74a6027d6a7478924520acddcddc24c1c8ab3ab" "checksum block-cipher-trait 0.5.3 (registry+https://github.com/rust-lang/crates.io-index)" = "370424437b9459f3dfd68428ed9376ddfe03d8b70ede29cc533b3557df186ab4" "checksum blowfish 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "95ede07672d9f4144c578439aa352604ec5c67a80c940fe8d382ddbeeeb3c6d8" "checksum buf_redux 0.7.1 (registry+https://github.com/rust-lang/crates.io-index)" = "20c6687a26c9ce967594b78038c06139a0d3a5b3005d16572284d543924a01aa" "checksum build_const 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "39092a32794787acd8525ee150305ff051b0aa6cc2abaf193924f5ab05425f39" "checksum byte-tools 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "560c32574a12a89ecd91f5e742165893f86e3ab98d21f8ea548658eb9eef5f40" +"checksum bytecount 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "b92204551573580e078dc80017f36a213eb77a0450e4ddd8cfa0f3f2d1f0178f" +"checksum byteorder 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)" = "96c8b41881888cc08af32d47ac4edd52bc7fa27fef774be47a92443756451304" "checksum byteorder 1.2.6 (registry+https://github.com/rust-lang/crates.io-index)" = "90492c5858dd7d2e78691cfb89f90d273a2800fc11d98f60786e5d87e2f83781" "checksum bytes 0.4.10 (registry+https://github.com/rust-lang/crates.io-index)" = "0ce55bd354b095246fc34caf4e9e242f5297a7fd938b090cadfea6eee614aa62" "checksum canapi 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ff3e02a04f44b531d851d2db62f95aabf65d033a6724767a4bed9732563e9bc4" @@ -3313,7 +3257,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" "checksum colored 1.6.1 (registry+https://github.com/rust-lang/crates.io-index)" = "dc0a60679001b62fb628c4da80e574b9645ab4646056d7c9018885efffe45533" "checksum combine 3.6.3 (registry+https://github.com/rust-lang/crates.io-index)" = "db733c5d0f4f52e78d4417959cadf0eecc7476e7f9ece05677912571a4af34e2" "checksum conv 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)" = "78ff10625fd0ac447827aa30ea8b861fead473bb60aeb73af6c1c58caf0d1299" -"checksum cookie 0.11.0-dev (git+https://github.com/alexcrichton/cookie-rs?rev=f191ca50)" = "" +"checksum cookie 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)" = "1465f8134efa296b4c19db34d909637cb2bf0f7aaf21299e23e18fa29ac557cf" "checksum core-foundation 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)" = "286e0b41c3a20da26536c6000a280585d519fd07b3956b43aed8a79e9edce980" "checksum core-foundation-sys 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)" = "716c271e8613ace48344f723b60b900a93150271e5be206212d052bbc0883efa" "checksum crc 1.8.1 (registry+https://github.com/rust-lang/crates.io-index)" = "d663548de7f5cca343f1e0a48d14dcfb0e9eb4e079ec58883b7251539fa10aeb" @@ -3335,26 +3279,29 @@ source = "registry+https://github.com/rust-lang/crates.io-index" "checksum debugtrace 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "62e432bd83c5d70317f6ebd8a50ed4afb32907c64d6e2e1e65e339b06dc553f3" "checksum derive_builder 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)" = "8c998e6ab02a828dd9735c18f154e14100e674ed08cb4e1938f0e4177543f439" "checksum derive_builder_core 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "735e24ee9e5fa8e16b86da5007856e97d592e11867e45d76e0c0d0a164a0b757" -"checksum derive_utils 0.1.0 (git+https://github.com/SergioBenitez/derive-utils?rev=160da392)" = "" -"checksum derive_utils_codegen 0.1.0 (git+https://github.com/SergioBenitez/derive-utils?rev=160da392)" = "" -"checksum derive_utils_core 0.1.0 (git+https://github.com/SergioBenitez/derive-utils?rev=160da392)" = "" -"checksum deunicode 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)" = "850878694b7933ca4c9569d30a34b55031b9b139ee1fc7b94a527c4ef960d690" +"checksum devise 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "4f8e7e0601aeb557a7a8f6a4f87d29c8cc0feb2c41d15f5d65900723dabf083b" +"checksum devise_codegen 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "4c88254efd3c2dfbeaf598d0ea35a54ef457ca04e31d214420d086ac9236b436" +"checksum devise_core 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "e33669c00593713cedf755f69723aa0731de7bc1f552903d6df98d6c4f91bcca" "checksum diesel 1.3.3 (registry+https://github.com/rust-lang/crates.io-index)" = "164080ac16a4d1d80a50f0a623e4ddef41cb2779eee85bcc76907d340dfc98cc" "checksum diesel_derives 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "03bcaf77491f53e400d5ee3bdd57142ea4e1c47fe9217b3361ff9a76ca0e3d37" "checksum diesel_migrations 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "17b42c35d1ce9e8d57a3e7001b4127f2bc1b073a89708bb7019f5be27c991c28" -"checksum digest 0.7.6 (registry+https://github.com/rust-lang/crates.io-index)" = "03b072242a8cbaf9c145665af9d250c59af3b958f83ed6824e13533cf76d5b90" "checksum dotenv 0.13.0 (registry+https://github.com/rust-lang/crates.io-index)" = "c0d0a1279c96732bc6800ce6337b6a614697b0e74ae058dc03c62ebeb78b4d86" "checksum downcast 0.9.2 (registry+https://github.com/rust-lang/crates.io-index)" = "6c6fe31318b6ef21166c8e839e680238eb16f875849d597544eead7ec882eed3" "checksum dtoa 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)" = "6d301140eb411af13d3115f9a562c85cc6b541ade9dfa314132244aaee7489dd" "checksum either 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)" = "a39bffec1e2015c5d8a6773cb0cf48d0d758c842398f624c34969071f5499ea7" "checksum either 1.5.0 (registry+https://github.com/rust-lang/crates.io-index)" = "3be565ca5c557d7f59e7cfcf1844f9e3033650c929c6566f511e8005f205c1d0" +"checksum encoding 0.2.33 (registry+https://github.com/rust-lang/crates.io-index)" = "6b0d943856b990d12d3b55b359144ff341533e516d94098b1d3fc1ac666d36ec" +"checksum encoding-index-japanese 1.20141219.5 (registry+https://github.com/rust-lang/crates.io-index)" = "04e8b2ff42e9a05335dbf8b5c6f7567e5591d0d916ccef4e0b1710d32a0d0c91" +"checksum encoding-index-korean 1.20141219.5 (registry+https://github.com/rust-lang/crates.io-index)" = "4dc33fb8e6bcba213fe2f14275f0963fd16f0a02c878e3095ecfdf5bee529d81" +"checksum encoding-index-simpchinese 1.20141219.5 (registry+https://github.com/rust-lang/crates.io-index)" = "d87a7194909b9118fc707194baa434a4e3b0fb6a5a757c73c3adb07aa25031f7" +"checksum encoding-index-singlebyte 1.20141219.5 (registry+https://github.com/rust-lang/crates.io-index)" = "3351d5acffb224af9ca265f435b859c7c01537c0849754d3db3fdf2bfe2ae84a" +"checksum encoding-index-tradchinese 1.20141219.5 (registry+https://github.com/rust-lang/crates.io-index)" = "fd0e20d5688ce3cab59eb3ef3a2083a5c77bf496cb798dc6fcdb75f323890c18" +"checksum encoding_index_tests 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)" = "a246d82be1c9d791c5dfde9a2bd045fc3cbba3fa2b11ad558f27d01712f00569" "checksum encoding_rs 0.8.10 (registry+https://github.com/rust-lang/crates.io-index)" = "065f4d0c826fdaef059ac45487169d918558e3cf86c9d89f6e81cf52369126e5" "checksum error-chain 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ff511d5dc435d703f4971bc399647c9bc38e20cb41452e3b9feb4765419ed3f3" -"checksum error-chain 0.12.0 (registry+https://github.com/rust-lang/crates.io-index)" = "07e791d3be96241c77c43846b665ef1384606da2cd2a48730abe606a12906e02" "checksum fail 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "bd2e1a22c616c8c8c96b6e07c243014551f3ba77291d24c22e0bfea6830c0b4e" "checksum failure 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "7efb22686e4a466b1ec1a15c2898f91fa9cb340452496dca654032de20ff95b9" "checksum failure_derive 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "946d0e98a50d9831f5d589038d2ca7f8f455b1c21028c0db0e84116a12696426" -"checksum fake-simd 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "e88a8acf291dafb59c2d96e8f59828f3838bb1a70398823ade51a84de6a6deed" "checksum filetime 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "da4b9849e77b13195302c174324b5ba73eec9b236b24c221a61000daefb95c5f" "checksum fnv 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)" = "2fad85553e09a6f881f739c29f0b00b0f01357c743266d478b68951ce23285f3" "checksum foreign-types 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)" = "f6f339eb8adc052cd2ca78910fda869aefa38d22d5cb648e6485e4d3fc06f3b1" @@ -3370,9 +3317,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" "checksum futures-cpupool 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)" = "ab90cde24b3319636588d0c35fe03b1333857621051837ed769faefb4c2162e4" "checksum gcc 0.3.55 (registry+https://github.com/rust-lang/crates.io-index)" = "8f5f3913fa0bfe7ee1fd8248b6b9f42a5af4b9d65ec2dd2c3c26132b950ecfc2" "checksum generic-array 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ef25c5683767570c2bbd7deba372926a55eaae9982d7726ee2a1050239d45b9d" -"checksum gettext-rs 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)" = "b2502071e088651bd5fec87a896be2a5b908e817070d350a534a305abc9c6048" -"checksum gettext-sys 0.19.8 (registry+https://github.com/rust-lang/crates.io-index)" = "62c644c0b8b73706fb8c7420533fd30abf6f41c2703994bc6f0826fceb7fb3d6" -"checksum glob 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)" = "8be18de09a56b60ed0edf84bc9df007e30040691af7acd1c41874faac5895bfb" +"checksum gettext 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "4378b8e09fd51cfdb0d48f40929a5c358efeeb62feb458c7d6eab979fae231f4" "checksum guid 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "e691c64d9b226c7597e29aeb46be753beb8c9eeef96d8c78dfd4d306338a38da" "checksum guid-create 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "fcea207bf7a6092166ab590f98fe5dde5a7deed1f1920d98dcac31f80814c40d" "checksum guid-macro-impl 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "08d50f7c496073b5a5dec0f6f1c149113a50960ce25dd2a559987a5a71190816" @@ -3384,7 +3329,6 @@ source = "registry+https://github.com/rust-lang/crates.io-index" "checksum htmlescape 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "e9025058dae765dee5070ec375f591e2ba14638c63feff74f13805a72e523163" "checksum http 0.1.13 (registry+https://github.com/rust-lang/crates.io-index)" = "24f58e8c2d8e886055c3ead7b28793e1455270b5fb39650984c224bc538ba581" "checksum httparse 1.3.3 (registry+https://github.com/rust-lang/crates.io-index)" = "e8734b0cfd3bc3e101ec59100e101c2eecd19282202e87808b3037b442777a83" -"checksum humansize 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "b6cab2627acfc432780848602f3f558f7e9dd427352224b0d9324025796d2a5e" "checksum hyper 0.10.13 (registry+https://github.com/rust-lang/crates.io-index)" = "368cb56b2740ebf4230520e2b90ebb0461e69034d85d1945febd9b3971426db2" "checksum hyper 0.11.27 (registry+https://github.com/rust-lang/crates.io-index)" = "34a590ca09d341e94cddf8e5af0bbccde205d5fbc2fa3c09dd67c7f85cea59d7" "checksum hyper 0.12.11 (registry+https://github.com/rust-lang/crates.io-index)" = "78d50abbd1790e0f4c74cb1d4a2211b439bac661d54107ad5564c55e77906762" @@ -3408,7 +3352,6 @@ source = "registry+https://github.com/rust-lang/crates.io-index" "checksum libc 0.2.43 (registry+https://github.com/rust-lang/crates.io-index)" = "76e3a3ef172f1a0b9a9ff0dd1491ae5e6c948b94479a3021819ba7d860c8645d" "checksum libflate 0.1.18 (registry+https://github.com/rust-lang/crates.io-index)" = "21138fc6669f438ed7ae3559d5789a5f0ba32f28c1f0608d1e452b0bb06ee936" "checksum libsqlite3-sys 0.9.3 (registry+https://github.com/rust-lang/crates.io-index)" = "d3711dfd91a1081d2458ad2d06ea30a8755256e74038be2ad927d94e1c955ca8" -"checksum locale_config 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "14fbee0e39bc2dd6a2427c4fdea66e9826cc1fd09b0a0b7550359f5f6efe1dab" "checksum lock_api 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)" = "775751a3e69bde4df9b38dd00a1b5d6ac13791e4223d4a0506577f0dd27cfb7a" "checksum log 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)" = "e19e8d5c34a3e0e2223db8e060f9e8264aeeb5c5fc64a4ee9965c062211c024b" "checksum log 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)" = "d4fcce5fa49cc693c312001daf1d13411c4a5283796bac1084299ea3e567113f" @@ -3417,6 +3360,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" "checksum maplit 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)" = "08cbb6b4fef96b6d77bfc40ec491b1690c779e77b05cd9f07f787ed376fd4c43" "checksum markup5ever 0.7.2 (registry+https://github.com/rust-lang/crates.io-index)" = "bfedc97d5a503e96816d10fedcd5b42f760b2e525ce2f7ec71f6a41780548475" "checksum matches 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)" = "7ffc5c5338469d4d3ea17d269fa8ea3512ad247247c30bd2df69e68309ed0a08" +"checksum md5 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)" = "2cfd7095f695c117f89db0a838710180bc22f1867e2454a5c810a538baee55f9" "checksum memchr 2.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "4b3629fe9fdbff6daa6c33b90f7c08355c1aca05a3d01fa8063b822fcf185f3b" "checksum memmap 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)" = "e2ffa2c986de11a9df78620c01eeaaf27d94d3ff02bf81bfcca953102dd0c6ff" "checksum memoffset 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "0f9dc261e2b62d7a622bf416ea3c5245cdd5d9a7fcc428c0d06804dfce1775b3" @@ -3436,6 +3380,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" "checksum new_debug_unreachable 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)" = "0cdc457076c78ab54d5e0d6fa7c47981757f1e34dc39ff92787f217dede586c4" "checksum nix 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)" = "d37e713a259ff641624b6cb20e3b12b2952313ba36b6823c0f16e6cfd9e5de17" "checksum nodrop 0.1.12 (registry+https://github.com/rust-lang/crates.io-index)" = "9a2228dca57108069a5262f2ed8bd2e82496d2e074a06d1ccc7ce1687b6ae0a2" +"checksum nom 4.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "9c349f68f25f596b9f44cf0e7c69752a5c633b0550c3ff849518bfba0233774a" "checksum notify 4.0.6 (registry+https://github.com/rust-lang/crates.io-index)" = "873ecfd8c174964ae30f401329d140142312c8e5590719cf1199d5f1717d8078" "checksum num-integer 0.1.39 (registry+https://github.com/rust-lang/crates.io-index)" = "e83d528d2677f0518c570baf2b7abdcf0cd2d248860b68507bdcb3e91d4c0cea" "checksum num-traits 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)" = "0b3a5d7cc97d6d30d8b9bc8fa19bf45349ffe46241e8816f50f62f6d6aaabee1" @@ -3449,13 +3394,9 @@ source = "registry+https://github.com/rust-lang/crates.io-index" "checksum owning_ref 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "49a4b8ea2179e6a2e27411d3bca09ca6dd630821cf6894c6c7c8467a8ee7ef13" "checksum parking_lot 0.6.4 (registry+https://github.com/rust-lang/crates.io-index)" = "f0802bff09003b291ba756dc7e79313e51cc31667e94afbe847def490424cde5" "checksum parking_lot_core 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "ad7f7e6ebdc79edff6fdcb87a55b620174f7a989e3eb31b65231f4af57f00b8c" -"checksum pear 0.1.0 (git+http://github.com/SergioBenitez/Pear?rev=b475140)" = "" -"checksum pear_codegen 0.1.0 (git+http://github.com/SergioBenitez/Pear?rev=b475140)" = "" +"checksum pear 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "c26d2b92e47063ffce70d3e3b1bd097af121a9e0db07ca38a6cc1cf0cc85ff25" +"checksum pear_codegen 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "336db4a192cc7f54efeb0c4e11a9245394824cc3bcbd37ba3ff51240c35d7a6e" "checksum percent-encoding 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)" = "31010dd2e1ac33d5b46a5b413495239882813e0369f8ed8a5e266f173602f831" -"checksum pest 2.0.1 (registry+https://github.com/rust-lang/crates.io-index)" = "c3abb0d36ede865dcc689fd3bee2ff39094eff6e57a814f4a53c3c6108088353" -"checksum pest_derive 2.0.1 (registry+https://github.com/rust-lang/crates.io-index)" = "b76f477146419bc539a63f4ef40e902166cb43b3e51cecc71d9136fd12c567e7" -"checksum pest_generator 2.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "3ebee4e9680be4fd162e6f3394ae4192a6b60b1e4d17d845e631f0c68d1a3386" -"checksum pest_meta 2.0.3 (registry+https://github.com/rust-lang/crates.io-index)" = "1f6d5f6f0e6082578c86af197d780dc38328e3f768cec06aac9bc46d714e8221" "checksum phf 0.7.23 (registry+https://github.com/rust-lang/crates.io-index)" = "cec29da322b242f4c3098852c77a0ca261c9c01b806cae85a5572a1eb94db9a6" "checksum phf_codegen 0.7.23 (registry+https://github.com/rust-lang/crates.io-index)" = "7d187f00cd98d5afbcd8898f6cf181743a449162aeb329dcd2f3849009e605ad" "checksum phf_generator 0.7.23 (registry+https://github.com/rust-lang/crates.io-index)" = "03dc191feb9b08b0dc1330d6549b795b9d81aec19efe6b4a45aec8d4caee0c4b" @@ -3479,14 +3420,18 @@ source = "registry+https://github.com/rust-lang/crates.io-index" "checksum rand 0.3.22 (registry+https://github.com/rust-lang/crates.io-index)" = "15a732abf9d20f0ad8eeb6f909bf6868722d9a06e1e50802b6a70351f40b4eb1" "checksum rand 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)" = "8356f47b32624fef5b3301c1be97e5944ecdd595409cc5da11d05f211db6cfbd" "checksum rand 0.5.5 (registry+https://github.com/rust-lang/crates.io-index)" = "e464cd887e869cddcae8792a4ee31d23c7edd516700695608f5b98c67ee0131c" +"checksum rand 0.6.1 (registry+https://github.com/rust-lang/crates.io-index)" = "ae9d223d52ae411a33cf7e54ec6034ec165df296ccd23533d671a28252b6f66a" +"checksum rand_chacha 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "771b009e3a508cb67e8823dda454aaa5368c7bc1c16829fb77d3e980440dd34a" "checksum rand_core 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "1961a422c4d189dfb50ffa9320bf1f2a9bd54ecb92792fb9477f99a1045f3372" "checksum rand_core 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "0905b6b7079ec73b314d4c748701f6931eb79fd97c668caa3f1899b22b32c6db" +"checksum rand_hc 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "7b40677c7be09ae76218dc623efbf7b18e34bced3f38883af07bb75630a21bc4" +"checksum rand_isaac 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "ded997c9d5f13925be2a6fd7e66bf1872597f759fd9dd93513dd7e92e5a5ee08" +"checksum rand_pcg 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "086bd09a33c7044e56bb44d5bdde5a60e7f119a9e95b0775f545de759a32fe05" +"checksum rand_xorshift 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "effa3fcaa47e18db002bdde6060944b6d2f9cfd8db471c30e873448ad9187be3" "checksum redox_syscall 0.1.40 (registry+https://github.com/rust-lang/crates.io-index)" = "c214e91d3ecf43e9a4e41e578973adeb14b474f2bee858742d127af75a0112b1" "checksum redox_termios 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "7e891cfe48e9100a70a3b6eb652fef28920c117d366339687bd5576160db0f76" -"checksum regex 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)" = "9329abc99e39129fcceabd24cf5d85b4671ef7c29c50e972bc5afe32438ec384" "checksum regex 1.0.5 (registry+https://github.com/rust-lang/crates.io-index)" = "2069749032ea3ec200ca51e4a31df41759190a88edca0d2d86ee8bedf7073341" "checksum regex-syntax 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)" = "f9ec002c35e86791825ed294b50008eea9ddfc8def4420124fbc6b08db834957" -"checksum regex-syntax 0.5.6 (registry+https://github.com/rust-lang/crates.io-index)" = "7d707a4fa2637f2dca2ef9fd02225ec7661fe01a53623c1e6515b6916511f7a7" "checksum regex-syntax 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)" = "747ba3b235651f6e2f67dfa8bcdcd073ddb7c243cb21c442fc12395dfcac212d" "checksum relay 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "1576e382688d7e9deecea24417e350d3062d97e32e45d70b1cde65994ff1489a" "checksum remove_dir_all 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)" = "3488ba1b9a2084d38645c4c08276a1752dcbf2c7130d74f1569681ad5d2799c5" @@ -3494,14 +3439,14 @@ source = "registry+https://github.com/rust-lang/crates.io-index" "checksum rental-impl 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)" = "a269533a9b93bbaa4848260e51b64564cc445d46185979f31974ec703374803a" "checksum reqwest 0.9.2 (registry+https://github.com/rust-lang/crates.io-index)" = "1d68c7bf0b1dc3860b80c6d31d05808bf54cdc1bfc70a4680893791becd083ae" "checksum ring 0.13.2 (registry+https://github.com/rust-lang/crates.io-index)" = "dbe642b9dd1ba0038d78c4a3999d1ee56178b4d415c1e1fbaba83b06dce012f0" -"checksum rocket 0.4.0-dev (git+https://github.com/SergioBenitez/Rocket?rev=55459db7732b9a240826a5c120c650f87e3372ce)" = "" -"checksum rocket_codegen 0.4.0-dev (git+https://github.com/SergioBenitez/Rocket?rev=55459db7732b9a240826a5c120c650f87e3372ce)" = "" -"checksum rocket_codegen_next 0.4.0-dev (git+https://github.com/SergioBenitez/Rocket?rev=55459db7732b9a240826a5c120c650f87e3372ce)" = "" -"checksum rocket_contrib 0.4.0-dev (git+https://github.com/SergioBenitez/Rocket?rev=55459db7732b9a240826a5c120c650f87e3372ce)" = "" -"checksum rocket_csrf 0.1.0 (git+https://github.com/fdb-hiroshima/rocket_csrf?rev=0dfb822d5cbf65a5eee698099368b7c0f4c61fa4)" = "" -"checksum rocket_http 0.4.0-dev (git+https://github.com/SergioBenitez/Rocket?rev=55459db7732b9a240826a5c120c650f87e3372ce)" = "" -"checksum rocket_i18n 0.1.1 (git+https://github.com/BaptisteGelez/rocket_i18n?rev=75a3bfd7b847324c078a355a7f101f8241a9f59b)" = "" +"checksum rocket 0.4.0-rc.1 (registry+https://github.com/rust-lang/crates.io-index)" = "71f9970125ea965ae6e468a5bb878f47762aff210596e4cfc2d4ee9af2365b0f" +"checksum rocket_codegen 0.4.0-rc.1 (registry+https://github.com/rust-lang/crates.io-index)" = "9a9adbb359e17dabd05d97aa05a328817a20db5ba6b694cd51bba2900b262691" +"checksum rocket_contrib 0.4.0-rc.1 (registry+https://github.com/rust-lang/crates.io-index)" = "38cce3e4f0de0b950604c2a5cda4b3d74a7f17c62937cee54f4996b36c2d31a5" +"checksum rocket_csrf 0.1.0 (git+https://github.com/fdb-hiroshima/rocket_csrf?rev=717fad53cfd2ee5cbee5b4571f6190644f9dddd7)" = "" +"checksum rocket_http 0.4.0-rc.1 (registry+https://github.com/rust-lang/crates.io-index)" = "2201c854709fd6f8cc7dca9bd7ebbddb10f27e1cdda191f932546c3dcd98d4a6" +"checksum rocket_i18n 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "f10dc7394c8c400d20a86d25b8d6f6f8066cadd5e849ceed611bc6c28e1aaac5" "checksum rpassword 2.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "d127299b02abda51634f14025aec43ae87a7aa7a95202b6a868ec852607d1451" +"checksum ructe 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)" = "58506bf5e543a65bc9e336ff8b5a48ed73c47d966c838550bb9a0058fb5710bd" "checksum rust-crypto 0.2.36 (registry+https://github.com/rust-lang/crates.io-index)" = "f76d05d3993fd5f4af9434e8e436db163a12a9d40e1a58a726f27a01dfd12a2a" "checksum rust-stemmers 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)" = "fbf06149ec391025664a5634200ced1afb489f0f3f8a140d515ebc0eb04b4bc0" "checksum rustc-demangle 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)" = "bcfe5b13211b4d78e5c2cadfebd7769197d95c639c35a50057eb4c05de811395" @@ -3524,12 +3469,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" "checksum serde_json 1.0.32 (registry+https://github.com/rust-lang/crates.io-index)" = "43344e7ce05d0d8280c5940cabb4964bea626aa58b1ec0e8c73fa2a8512a38ce" "checksum serde_qs 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)" = "e5873a8c1e2dc41f1d9305b7510f70768376dc974f81c0b9ce6b4d5b48be0203" "checksum serde_urlencoded 0.5.3 (registry+https://github.com/rust-lang/crates.io-index)" = "aaed41d9fb1e2f587201b863356590c90c1157495d811430a0c0325fe8169650" -"checksum sha-1 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "51b9d1f3b5de8a167ab06834a7c883bd197f2191e1dda1a22d9ccfeedbf9aded" "checksum siphasher 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)" = "0b8de496cf83d4ed58b6be86c3a275b8602f6ffe98d3024a869e124147a9a3ac" "checksum slab 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "17b4fcaed89ab08ef143da37bc52adbcc04d4a69014f4c1208d6b51f0c47bc23" "checksum slab 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)" = "5f9776d6b986f77b35c6cf846c11ad986ff128fe0b2b63a3628e3755e8d3102d" "checksum slice-deque 0.1.13 (registry+https://github.com/rust-lang/crates.io-index)" = "79e5bb98247a0eb0cfdedb7e792962ec71ac1003033f70558bd9961f8912e487" -"checksum slug 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)" = "b3bc762e6a4b6c6fcaade73e77f9ebc6991b676f88bb2358bddb56560f073373" "checksum smallvec 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "4c8cbcd6df1e117c2210e13ab5109635ad68a929fcbb8964dc965b76cb5ee013" "checksum smallvec 0.6.5 (registry+https://github.com/rust-lang/crates.io-index)" = "153ffa32fd170e9944f7e0838edf824a754ec4c1fc64746fcc9fe1f8fa602e5d" "checksum snap 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)" = "95d697d63d44ad8b78b8d235bf85b34022a78af292c8918527c5f0cffdde7f43" @@ -3552,7 +3495,6 @@ source = "registry+https://github.com/rust-lang/crates.io-index" "checksum tempdir 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)" = "15f2b5fb00ccdf689e0149d1b1b3c03fead81c2b37735d812fa8bddbbf41b6d8" "checksum tempfile 3.0.4 (registry+https://github.com/rust-lang/crates.io-index)" = "55c1195ef8513f3273d55ff59fe5da6940287a0d7a98331254397f464833675b" "checksum tendril 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "9de21546595a0873061940d994bbbc5c35f024ae4fd61ec5c5b159115684f508" -"checksum tera 0.11.17 (registry+https://github.com/rust-lang/crates.io-index)" = "2829d259c4699fbbe8acb353d231e6da31ff4301c52244413ed29ff6093da412" "checksum termion 1.5.1 (registry+https://github.com/rust-lang/crates.io-index)" = "689a3bdfaab439fd92bc87df5c4c78417d3cbe537487274e9b0b2dce76e92096" "checksum textwrap 0.10.0 (registry+https://github.com/rust-lang/crates.io-index)" = "307686869c93e71f94da64286f9a9524c0f308a9e1c87a583de8e9c9039ad3f6" "checksum thread_local 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)" = "c6b53e329000edc2b34dbe8545fd20e55a333362d0a321909685a19bd28c3f1b" @@ -3579,14 +3521,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" "checksum twoway 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)" = "59b11b2b5241ba34be09c3cc85a36e56e48f9888862e19cedf23336d35316ed1" "checksum typeable 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "1410f6f91f21d1612654e7cc69193b0334f909dcf2c790c4826254fbb86f8887" "checksum typenum 1.10.0 (registry+https://github.com/rust-lang/crates.io-index)" = "612d636f949607bdf9b123b4a6f6d966dedf3ff669f7f045890d3a4a73948169" -"checksum ucd-trie 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "71a9c5b1fe77426cf144cc30e49e955270f5086e31a6441dfa8b32efc09b9d77" "checksum ucd-util 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "fd2be2d6639d0f8fe6cdda291ad456e23629558d466e2789d2c3e9892bda285d" -"checksum unic-char-property 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ce36d3f7ce754afdbccccf8ff0dd0134e50fb44aaae579f96218856e9e5dbd1e" -"checksum unic-char-range 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "d9ab85fab42ad1b26cafc03bf891f69cb4d6e15f491030e89a0122197baa8ae8" -"checksum unic-common 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ff8d4a7ade929ef7d971e16ced21a8cd56a63869aa6032dfb8cb083cf7d077bf" -"checksum unic-segment 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "c9ca47cbb09fb5fcd066b5867d11dc528302fa465277882797d6a836e1ee6f9e" -"checksum unic-ucd-segment 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "48f1a08ce0409a9e391b88d1930118eec48af12742fc538bcec55f775865776e" -"checksum unic-ucd-version 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "cf1f5e6c6c53c2d0ece4a5964bc55fcff8602153063cb4fab20958ff32998ff6" "checksum unicase 1.4.2 (registry+https://github.com/rust-lang/crates.io-index)" = "7f4765f83163b74f957c797ad9253caf97f103fb064d3999aea9568d09fc8a33" "checksum unicase 2.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "9d3218ea14b4edcaccfa0df0a64a3792a2c32cc706f1b336e48867f9d3147f90" "checksum unicode-bidi 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)" = "49f2bd0c6468a8230e1db229cff8029217cf623c767ea5d60bfbd42729ea54d5" @@ -3602,6 +3537,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" "checksum utf8-ranges 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)" = "fd70f467df6810094968e2fce0ee1bd0e87157aceb026a8c083bcf5e25b9efe4" "checksum uuid 0.7.1 (registry+https://github.com/rust-lang/crates.io-index)" = "dab5c5526c5caa3d106653401a267fed923e7046f35895ffcb5ca42db64942e6" "checksum validator 0.7.1 (registry+https://github.com/rust-lang/crates.io-index)" = "a3f0d7368156daa506d6e42bd110857ee42d320dd1edd8e77f81b44fb00bb844" +"checksum validator 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)" = "236a5eda3df2c877872e98dbc55d497d943792e6405d8fc65bd4f8a5e3b53c99" "checksum validator_derive 0.7.2 (registry+https://github.com/rust-lang/crates.io-index)" = "2b50b766d1588742f67db0d5df7d5394473234fbc60a382da81bd666a99db41e" "checksum vcpkg 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)" = "def296d3eb3b12371b2c7d0e83bfe1403e4db2d7a0bba324a12b21c4ee13143d" "checksum vec_map 0.8.1 (registry+https://github.com/rust-lang/crates.io-index)" = "05c78687fb1a80548ae3250346c3db86a80a7cdd77bda190189f2d0a0987c81a" diff --git a/Cargo.toml b/Cargo.toml index 4ba4d209..ab3cc9cc 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -2,25 +2,28 @@ authors = ["Bat' "] name = "plume" version = "0.2.0" + [dependencies] activitypub = "0.1.3" +askama_escape = "0.1" atom_syndication = "0.6" canapi = "0.1" colored = "1.6" dotenv = "0.13" failure = "0.1" -gettext-rs = "0.4" guid-create = "0.1" heck = "0.3.0" num_cpus = "1.0" +rocket = "0.4.0-rc.1" +rocket_contrib = { version = "0.4.0-rc.1", features = ["json"] } +rocket_i18n = "0.3.1" rpassword = "2.0" scheduled-thread-pool = "0.2.0" serde = "1.0" serde_derive = "1.0" serde_json = "1.0" serde_qs = "0.4" -tera = "0.11" -validator = "0.7" +validator = "0.8" validator_derive = "0.7" webfinger = "0.3.1" @@ -54,26 +57,13 @@ path = "plume-common" [dependencies.plume-models] path = "plume-models" -[dependencies.rocket] -git = "https://github.com/SergioBenitez/Rocket" -rev = "55459db7732b9a240826a5c120c650f87e3372ce" - -[dependencies.rocket_codegen] -git = "https://github.com/SergioBenitez/Rocket" -rev = "55459db7732b9a240826a5c120c650f87e3372ce" - -[dependencies.rocket_contrib] -features = ["tera_templates", "json"] -git = "https://github.com/SergioBenitez/Rocket" -rev = "55459db7732b9a240826a5c120c650f87e3372ce" - [dependencies.rocket_csrf] git = "https://github.com/fdb-hiroshima/rocket_csrf" -rev = "0dfb822d5cbf65a5eee698099368b7c0f4c61fa4" +rev = "717fad53cfd2ee5cbee5b4571f6190644f9dddd7" -[dependencies.rocket_i18n] -git = "https://github.com/BaptisteGelez/rocket_i18n" -rev = "75a3bfd7b847324c078a355a7f101f8241a9f59b" +[build-dependencies] +ructe = "0.5.2" +rocket_i18n = { version = "0.3.1", features = ["build"] } [features] default = ["postgres"] diff --git a/build.rs b/build.rs new file mode 100644 index 00000000..8b2dd6f2 --- /dev/null +++ b/build.rs @@ -0,0 +1,15 @@ +extern crate ructe; +extern crate rocket_i18n; +use ructe::*; +use std::{env, path::PathBuf}; + +fn main() { + let out_dir = PathBuf::from(env::var("OUT_DIR").unwrap()); + let in_dir = PathBuf::from(env::var("CARGO_MANIFEST_DIR").unwrap()) + .join("templates"); + compile_templates(&in_dir, &out_dir).expect("compile templates"); + + println!("cargo:rerun-if-changed=po"); + rocket_i18n::update_po("plume", &["de", "en", "fr", "gl", "it", "ja", "nb", "pl", "ru"]); + rocket_i18n::compile_po("plume", &["de", "en", "fr", "gl", "it", "ja", "nb", "pl", "ru"]); +} diff --git a/docs/DEVELOPMENT.md b/docs/DEVELOPMENT.md index 449f7ff5..963394de 100644 --- a/docs/DEVELOPMENT.md +++ b/docs/DEVELOPMENT.md @@ -41,23 +41,26 @@ Now, make any changes to the code you want. After committing your changes, push The project maintainers may suggest further changes to improve the pull request even more. After implementing this locally, you can push to your upstream fork again and the changes will immediately show up in the pull request after pushing. Once all the suggested changes are made, the pull request may be accepted. Thanks for contributing. -## When working with Tera templates +## When working with Ructe templates -When working with the interface, or any message that will be displayed to the final user, keep in mind that Plume is an internationalized software. To make sure that the parts of the interface you are changing are translatable, you should: +When working with the interface, or any message that will be displayed to the final user, +keep in mind that Plume is an internationalized software. +To make sure that the parts of the interface you are changing are translatable, you should: -- Use the `_` and `_n` filters instead of directly writing strings in your HTML markup +- Wrap strings to translate in the `i18n!` macro (see [rocket_i18n docs](https://docs.rs/rocket_i18n/) +for more details about its arguments).The `Catalog` argument is usually `ctx.1`. - Add the strings to translate to the `po/plume.pot` file -Here is an example: let's say we want to add two strings, a simple one and one that may deal with plurals. The first step is to add them to whatever template we want to display them in: +Here is an example: let's say we want to add two strings, a simple one and one +that may deal with plurals. The first step is to add them to whatever +template we want to display them in: -```jinja -

{{ "Hello, world!" | _ }}

+```html +

@i18n!(ctx.1, "Hello, world!")

-

{{ "You have {{ count }} new notifications" | _n(singular="You have one new notification", count=n_notifications) }}

+

@i18n!(ctx.1, "You have one new notification", "You have {0} new notifications", n_notifications)

``` -As you can see, the `_` doesn't need any special argument to work, but `_n` requires `singular` (the singular form, in English) and `count` (the number of items, to determine which form to use) to be present. Note that any parameters given to these filters can be used as regular Tera variables inside of the translated strings, like we are doing with the `count` variable in the second string above. - The second step is to add them to POT file. To add a simple message, just do: ```po @@ -69,7 +72,7 @@ For plural forms, the syntax is a bit different: ```po msgid "You have one new notification" # The singular form -msgid_plural "You have {{ count }} new notifications" # The plural one +msgid_plural "You have {0} new notifications" # The plural one msgstr[0] "" msgstr[1] "" ``` @@ -84,4 +87,4 @@ For CSS, the only rule is to use One True Brace Style. For JavaScript, we use [the JavaScript Standard Style](https://standardjs.com/). -For HTML/Tera templates, we use HTML5 syntax. +For HTML/Ructe templates, we use HTML5 syntax. diff --git a/docs/INTERNATIONALIZATION.md b/docs/INTERNATIONALIZATION.md index 7b26e836..7402f9c6 100644 --- a/docs/INTERNATIONALIZATION.md +++ b/docs/INTERNATIONALIZATION.md @@ -23,16 +23,21 @@ Sometimes, strings may change depending on a number (for instance, a post counte ``` msgid "One post" -msgid_plural "{{ count }} posts" +msgid_plural "{0} posts" msgstr[0] "" msgstr[1] "" ``` -Then you should fill the two `msgstr` field, one with the singular form, the second with the plural one. If your language as more than two forms, you can add another one by following the same pattern (`msgstr[n] ""`). +Then you should fill the two `msgstr` field, one with the singular form, +the second with the plural one. If your language as more than two forms, +you can add another one by following the same pattern (`msgstr[n] ""`). ## Interpolation -Strings you translate may contain data from Plume (a username for instance). To tell Plume where to put these data, surround their identifier by `{{` and `}}`. The identifier is also present in this form in the English string to translate (this what you can see above, with the `{{ count }} posts` message). +Strings you translate may contain data from Plume (a username for instance). +To tell Plume where to put these data, surround the number that identifies +them by `{` and `}`. The identifier is also present in this form in the English +string to translate (this what you can see above, with the `{0} posts` message). ## Note diff --git a/plume-common/Cargo.toml b/plume-common/Cargo.toml index eaa319d5..64539509 100644 --- a/plume-common/Cargo.toml +++ b/plume-common/Cargo.toml @@ -11,11 +11,11 @@ array_tool = "1.0" base64 = "0.9" failure = "0.1" failure_derive = "0.1" -gettext-rs = "0.4" heck = "0.3.0" hex = "0.3" hyper = "0.11.27" openssl = "0.10.11" +rocket = "0.4.0-rc.1" reqwest = "0.9" serde = "1.0" serde_derive = "1.0" @@ -28,7 +28,3 @@ version = "0.4" [dependencies.pulldown-cmark] default-features = false version = "0.1.2" - -[dependencies.rocket] -git = "https://github.com/SergioBenitez/Rocket" -rev = "55459db7732b9a240826a5c120c650f87e3372ce" diff --git a/plume-common/src/lib.rs b/plume-common/src/lib.rs index 070ab28d..1149a234 100644 --- a/plume-common/src/lib.rs +++ b/plume-common/src/lib.rs @@ -1,4 +1,4 @@ -#![feature(custom_attribute, iterator_flatten)] +#![feature(custom_attribute)] extern crate activitypub; #[macro_use] @@ -10,7 +10,6 @@ extern crate chrono; extern crate failure; #[macro_use] extern crate failure_derive; -extern crate gettextrs; extern crate hex; extern crate heck; extern crate hyper; diff --git a/plume-common/src/utils.rs b/plume-common/src/utils.rs index 7ca49234..482c4087 100644 --- a/plume-common/src/utils.rs +++ b/plume-common/src/utils.rs @@ -1,4 +1,3 @@ -use gettextrs::gettext; use heck::CamelCase; use openssl::rand::rand_bytes; use pulldown_cmark::{Event, Parser, Options, Tag, html}; @@ -23,8 +22,13 @@ pub fn make_actor_id(name: &str) -> String { .collect() } +/** +* Redirects to the login page with a given message. +* +* Note that the message should be translated before passed to this function. +*/ pub fn requires_login>>(message: &str, url: T) -> Flash { - Flash::new(Redirect::to(format!("/login?m={}", gettext(message.to_string()))), "callback", url.into().to_string()) + Flash::new(Redirect::to(format!("/login?m={}", message)), "callback", url.into().to_string()) } #[derive(Debug)] diff --git a/plume-models/Cargo.toml b/plume-models/Cargo.toml index dab240b6..82f900b0 100644 --- a/plume-models/Cargo.toml +++ b/plume-models/Cargo.toml @@ -6,6 +6,7 @@ authors = ["Baptiste Gelez "] [dependencies] activitypub = "0.1.1" ammonia = "1.2.0" +askama_escape = "0.1" bcrypt = "0.2" canapi = "0.1" guid-create = "0.1" @@ -13,6 +14,7 @@ heck = "0.3.0" itertools = "0.7.8" lazy_static = "*" openssl = "0.10.11" +rocket = "0.4.0-rc.1" reqwest = "0.9" serde = "1.0" serde_derive = "1.0" @@ -36,10 +38,6 @@ path = "../plume-api" [dependencies.plume-common] path = "../plume-common" -[dependencies.rocket] -git = "https://github.com/SergioBenitez/Rocket" -rev = "55459db7732b9a240826a5c120c650f87e3372ce" - [dev-dependencies] diesel_migrations = "1.3.0" diff --git a/plume-models/src/comments.rs b/plume-models/src/comments.rs index 4a1fdcdd..2a9cbf61 100644 --- a/plume-models/src/comments.rs +++ b/plume-models/src/comments.rs @@ -68,26 +68,10 @@ impl Comment { .len() // TODO count in database? } - pub fn to_json(&self, conn: &Connection, others: &[Comment]) -> serde_json::Value { - let mut json = serde_json::to_value(self).expect("Comment::to_json: serialization error"); - json["author"] = self.get_author(conn).to_json(conn); - let mentions = Mention::list_for_comment(conn, self.id) - .into_iter() - .map(|m| { - m.get_mentioned(conn) - .map(|u| u.get_fqn(conn)) - .unwrap_or_default() - }) - .collect::>(); - json["mentions"] = serde_json::to_value(mentions).expect("Comment::to_json: mention error"); - json["responses"] = json!( - others - .into_iter() - .filter(|c| c.in_response_to_id.map(|id| id == self.id).unwrap_or(false)) - .map(|c| c.to_json(conn, others)) - .collect::>() - ); - json + pub fn get_responses(&self, conn: &Connection) -> Vec { + comments::table.filter(comments::in_response_to_id.eq(self.id)) + .load::(conn) + .expect("Comment::get_responses: loading error") } pub fn update_ap_url(&self, conn: &Connection) -> Comment { diff --git a/plume-models/src/instance.rs b/plume-models/src/instance.rs index 71f29528..86d01817 100644 --- a/plume-models/src/instance.rs +++ b/plume-models/src/instance.rs @@ -20,9 +20,9 @@ pub struct Instance { pub open_registrations: bool, pub short_description: SafeString, pub long_description: SafeString, - pub default_license: String, - pub long_description_html: String, - pub short_description_html: String, + pub default_license : String, + pub long_description_html: SafeString, + pub short_description_html: SafeString, } #[derive(Clone, Insertable)] @@ -244,14 +244,15 @@ pub(crate) mod tests { default_license, local, long_description, - long_description_html, short_description, - short_description_html, name, open_registrations, public_domain ] ); + assert_eq!(res.long_description_html.get(), &inserted.long_description_html); + assert_eq!(res.short_description_html.get(), &inserted.short_description_html); + assert_eq!(Instance::local_id(conn), res.id); Ok(()) }); @@ -282,14 +283,14 @@ pub(crate) mod tests { default_license, local, long_description, - long_description_html, short_description, - short_description_html, name, open_registrations, public_domain ] - ) + ); + assert_eq!(&newinst.long_description_html, inst.long_description_html.get()); + assert_eq!(&newinst.short_description_html, inst.short_description_html.get()); }); let page = Instance::page(conn, (0, 2)); @@ -391,12 +392,12 @@ pub(crate) mod tests { ); assert_eq!( inst.long_description_html, - "

long_description

\n" + SafeString::new("

long_description

\n") ); assert_eq!(inst.short_description.get(), "[short](#link)"); assert_eq!( inst.short_description_html, - "

short

\n" + SafeString::new("

short

\n") ); Ok(()) diff --git a/plume-models/src/lib.rs b/plume-models/src/lib.rs index fc5f71a1..aa6a1d3e 100644 --- a/plume-models/src/lib.rs +++ b/plume-models/src/lib.rs @@ -1,8 +1,8 @@ #![allow(proc_macro_derive_resolution_fallback)] // This can be removed after diesel-1.4 -#![feature(crate_in_paths)] extern crate activitypub; extern crate ammonia; +extern crate askama_escape; extern crate bcrypt; extern crate canapi; extern crate chrono; diff --git a/plume-models/src/medias.rs b/plume-models/src/medias.rs index 2c906f7d..bb3c4e81 100644 --- a/plume-models/src/medias.rs +++ b/plume-models/src/medias.rs @@ -1,13 +1,14 @@ use activitypub::object::Image; +use askama_escape::escape; use diesel::{self, ExpressionMethods, QueryDsl, RunQueryDsl}; use guid_create::GUID; use reqwest; -use serde_json; use std::{fs, path::Path}; use plume_common::activity_pub::Id; use instance::Instance; +use safe_string::SafeString; use schema::medias; use users::User; use {ap_url, Connection}; @@ -36,6 +37,14 @@ pub struct NewMedia { pub owner_id: i32, } +#[derive(PartialEq)] +pub enum MediaCategory { + Image, + Audio, + Video, + Unknown, +} + impl Media { insert!(medias, NewMedia); get!(medias); @@ -47,65 +56,65 @@ impl Media { .expect("Media::list_all_medias: loading error") } - pub fn to_json(&self, conn: &Connection) -> serde_json::Value { - let mut json = serde_json::to_value(self).expect("Media::to_json: serialization error"); - let url = self.url(conn); - let (cat, preview, html, md) = match self + pub fn category(&self) -> MediaCategory { + match self .file_path .rsplitn(2, '.') .next() - .expect("Media::to_json: extension error") + .expect("Media::category: extension error") { - "png" | "jpg" | "jpeg" | "gif" | "svg" => ( - "image", - format!( - "\"{}\"", - url, self.alt_text, self.alt_text - ), - format!( - "\"{}\"", - url, self.alt_text, self.alt_text - ), - format!("![{}]({})", self.alt_text, url), - ), - "mp3" | "wav" | "flac" => ( - "audio", - format!( - "", - url, self.alt_text - ), - format!( - "", - url, self.alt_text - ), - format!( - "", - url, self.alt_text - ), - ), - "mp4" | "avi" | "webm" | "mov" => ( - "video", - format!( - "", - url, self.alt_text - ), - format!( - "", - url, self.alt_text - ), - format!( - "", - url, self.alt_text - ), - ), - _ => ("unknown", String::new(), String::new(), String::new()), - }; - json["html_preview"] = json!(preview); - json["html"] = json!(html); - json["url"] = json!(url); - json["md"] = json!(md); - json["category"] = json!(cat); - json + "png" | "jpg" | "jpeg" | "gif" | "svg" => MediaCategory::Image, + "mp3" | "wav" | "flac" => MediaCategory::Audio, + "mp4" | "avi" | "webm" | "mov" => MediaCategory::Video, + _ => MediaCategory::Unknown, + } + } + + pub fn preview_html(&self, conn: &Connection) -> SafeString { + let url = self.url(conn); + match self.category() { + MediaCategory::Image => SafeString::new(&format!( + r#"{}"#, + url, escape(&self.alt_text), escape(&self.alt_text) + )), + MediaCategory::Audio => SafeString::new(&format!( + r#""#, + url, escape(&self.alt_text) + )), + MediaCategory::Video => SafeString::new(&format!( + r#""#, + url, escape(&self.alt_text) + )), + MediaCategory::Unknown => SafeString::new(""), + } + } + + pub fn html(&self, conn: &Connection) -> SafeString { + let url = self.url(conn); + match self.category() { + MediaCategory::Image => SafeString::new(&format!( + r#"{}"#, + url, escape(&self.alt_text), escape(&self.alt_text) + )), + MediaCategory::Audio => SafeString::new(&format!( + r#""#, + url, escape(&self.alt_text) + )), + MediaCategory::Video => SafeString::new(&format!( + r#""#, + url, escape(&self.alt_text) + )), + MediaCategory::Unknown => SafeString::new(""), + } + } + + pub fn markdown(&self, conn: &Connection) -> SafeString { + let url = self.url(conn); + match self.category() { + MediaCategory::Image => SafeString::new(&format!("![{}]({})", escape(&self.alt_text), url)), + MediaCategory::Audio | MediaCategory::Video => self.html(conn), + MediaCategory::Unknown => SafeString::new(""), + } } pub fn url(&self, conn: &Connection) -> String { diff --git a/plume-models/src/notifications.rs b/plume-models/src/notifications.rs index fe7a00f7..1fd3fcb9 100644 --- a/plume-models/src/notifications.rs +++ b/plume-models/src/notifications.rs @@ -1,6 +1,5 @@ use chrono::NaiveDateTime; use diesel::{self, ExpressionMethods, QueryDsl, RunQueryDsl}; -use serde_json; use comments::Comment; use follows::Follow; @@ -71,45 +70,65 @@ impl Notification { .ok() } - pub fn to_json(&self, conn: &Connection) -> serde_json::Value { - let mut json = json!(self); - json["object"] = json!(match self.kind.as_ref() { - notification_kind::COMMENT => Comment::get(conn, self.object_id).map(|comment| json!({ - "post": comment.get_post(conn).to_json(conn), - "user": comment.get_author(conn).to_json(conn), - "id": comment.id - })), - notification_kind::FOLLOW => Follow::get(conn, self.object_id).map(|follow| { - json!({ - "follower": User::get(conn, follow.follower_id).map(|u| u.to_json(conn)) - }) - }), - notification_kind::LIKE => Like::get(conn, self.object_id).map(|like| { - json!({ - "post": Post::get(conn, like.post_id).map(|p| p.to_json(conn)), - "user": User::get(conn, like.user_id).map(|u| u.to_json(conn)) - }) - }), - notification_kind::MENTION => Mention::get(conn, self.object_id).map(|mention| { - json!({ - "user": mention.get_user(conn).map(|u| u.to_json(conn)), - "url": mention.get_post(conn).map(|p| p.to_json(conn)["url"].clone()) - .unwrap_or_else(|| { - let comment = mention.get_comment(conn).expect("Notification::to_json: comment not found error"); - let post = comment.get_post(conn).to_json(conn); - json!(format!("{}#comment-{}", post["url"].as_str().expect("Notification::to_json: post url error"), comment.id)) - }) - }) - }), - notification_kind::RESHARE => Reshare::get(conn, self.object_id).map(|reshare| { - json!({ - "post": reshare.get_post(conn).map(|p| p.to_json(conn)), - "user": reshare.get_user(conn).map(|u| u.to_json(conn)) - }) - }), - _ => Some(json!({})), - }); - json + pub fn get_message(&self) -> &'static str { + match self.kind.as_ref() { + notification_kind::COMMENT => "{0} commented your article.", + notification_kind::FOLLOW => "{0} is now following you.", + notification_kind::LIKE => "{0} liked your article.", + notification_kind::MENTION => "{0} mentioned you.", + notification_kind::RESHARE => "{0} boosted your article.", + _ => unreachable!("Notification::get_message: Unknow type"), + } + } + + pub fn get_url(&self, conn: &Connection) -> Option { + match self.kind.as_ref() { + notification_kind::COMMENT => self.get_post(conn).map(|p| format!("{}#comment-{}", p.url(conn), self.object_id)), + notification_kind::FOLLOW => Some(format!("/@/{}/", self.get_actor(conn).get_fqn(conn))), + notification_kind::MENTION => Mention::get(conn, self.object_id).map(|mention| + mention.get_post(conn).map(|p| p.url(conn)) + .unwrap_or_else(|| { + let comment = mention.get_comment(conn).expect("Notification::get_url: comment not found error"); + format!("{}#comment-{}", comment.get_post(conn).url(conn), comment.id) + }) + ), + _ => None, + } + } + + pub fn get_post(&self, conn: &Connection) -> Option { + match self.kind.as_ref() { + notification_kind::COMMENT => Comment::get(conn, self.object_id).map(|comment| comment.get_post(conn)), + notification_kind::LIKE => Like::get(conn, self.object_id).and_then(|like| Post::get(conn, like.post_id)), + notification_kind::RESHARE => Reshare::get(conn, self.object_id).and_then(|reshare| reshare.get_post(conn)), + _ => None, + } + } + + pub fn get_actor(&self, conn: &Connection) -> User { + match self.kind.as_ref() { + notification_kind::COMMENT => Comment::get(conn, self.object_id).expect("Notification::get_actor: comment error").get_author(conn), + notification_kind::FOLLOW => User::get(conn, Follow::get(conn, self.object_id).expect("Notification::get_actor: follow error").follower_id) + .expect("Notification::get_actor: follower error"), + notification_kind::LIKE => User::get(conn, Like::get(conn, self.object_id).expect("Notification::get_actor: like error").user_id) + .expect("Notification::get_actor: liker error"), + notification_kind::MENTION => Mention::get(conn, self.object_id).expect("Notification::get_actor: mention error").get_user(conn) + .expect("Notification::get_actor: mentioner error"), + notification_kind::RESHARE => Reshare::get(conn, self.object_id).expect("Notification::get_actor: reshare error").get_user(conn) + .expect("Notification::get_actor: resharer error"), + _ => unreachable!("Notification::get_actor: Unknow type"), + } + } + + pub fn icon_class(&self) -> &'static str { + match self.kind.as_ref() { + notification_kind::COMMENT => "icon-message-circle", + notification_kind::FOLLOW => "icon-user-plus", + notification_kind::LIKE => "icon-heart", + notification_kind::MENTION => "icon-at-sign", + notification_kind::RESHARE => "icon-repeat", + _ => unreachable!("Notification::get_actor: Unknow type"), + } } pub fn delete(&self, conn: &Connection) { diff --git a/plume-models/src/posts.rs b/plume-models/src/posts.rs index 068a06eb..a661f405 100644 --- a/plume-models/src/posts.rs +++ b/plume-models/src/posts.rs @@ -763,17 +763,9 @@ impl Post { } } - pub fn to_json(&self, conn: &Connection) -> serde_json::Value { + pub fn url(&self, conn: &Connection) -> String { let blog = self.get_blog(conn); - json!({ - "post": self, - "author": self.get_authors(conn)[0].to_json(conn), - "url": format!("/~/{}/{}/", blog.get_fqn(conn), self.slug), - "date": self.creation_date.timestamp(), - "blog": blog.to_json(conn), - "tags": Tag::for_post(&*conn, self.id), - "cover": self.cover_id.and_then(|i| Media::get(conn, i).map(|m| m.to_json(conn))), - }) + format!("/~/{}/{}", blog.get_fqn(conn), self.slug) } pub fn compute_id(&self, conn: &Connection) -> String { @@ -784,6 +776,10 @@ impl Post { self.slug )) } + + pub fn cover_url(&self, conn: &Connection) -> Option { + self.cover_id.and_then(|i| Media::get(conn, i)).map(|c| c.url(conn)) + } } impl<'a> FromActivity for Post { diff --git a/plume-models/src/users.rs b/plume-models/src/users.rs index 0b9ddf73..92b279bf 100644 --- a/plume-models/src/users.rs +++ b/plume-models/src/users.rs @@ -26,6 +26,7 @@ use rocket::{ request::{self, FromRequest, Request}, }; use serde_json; +use std::cmp::PartialEq; use url::Url; use webfinger::*; @@ -797,20 +798,8 @@ impl User { CustomPerson::new(actor, ap_signature) } - pub fn to_json(&self, conn: &Connection) -> serde_json::Value { - let mut json = serde_json::to_value(self).expect("User::to_json: serializing error"); - json["fqn"] = serde_json::Value::String(self.get_fqn(conn)); - json["name"] = if !self.display_name.is_empty() { - json!(self.display_name) - } else { - json!(self.get_fqn(conn)) - }; - json["avatar"] = json!( - self.avatar_id - .and_then(|id| Media::get(conn, id).map(|m| m.url(conn))) - .unwrap_or_else(|| String::from("/static/default-avatar.png")) - ); - json + pub fn avatar_url(&self, conn: &Connection) -> String { + self.avatar_id.and_then(|id| Media::get(conn, id).map(|m| m.url(conn))).unwrap_or("/static/default-avatar.png".to_string()) } pub fn webfinger(&self, conn: &Connection) -> Webfinger { @@ -874,6 +863,14 @@ impl User { pub fn needs_update(&self) -> bool { (Utc::now().naive_utc() - self.last_fetched_date).num_days() > 1 } + + pub fn name(&self, conn: &Connection) -> String { + if !self.display_name.is_empty() { + self.display_name.clone() + } else { + self.get_fqn(conn) + } + } } impl<'a, 'r> FromRequest<'a, 'r> for User { @@ -946,6 +943,12 @@ impl Signer for User { } } +impl PartialEq for User { + fn eq(&self, other: &Self) -> bool { + self.id == other.id + } +} + impl NewUser { /// Creates a new local user pub fn new_local( diff --git a/po/LINGUAS b/po/LINGUAS deleted file mode 100644 index 37359c52..00000000 --- a/po/LINGUAS +++ /dev/null @@ -1,9 +0,0 @@ -en -fr -pl -de -nb -gl -it -ru -ja diff --git a/po/de.po b/po/de.po index cddf96cf..c08f1616 100644 --- a/po/de.po +++ b/po/de.po @@ -34,8 +34,8 @@ msgstr "Titel" msgid "Create blog" msgstr "Blog erstellen" -msgid "Comment \"{{ post }}\"" -msgstr "Kommentar \"{{ post }}\"" +msgid "Comment \"{0}\"" +msgstr "Kommentar \"{0}\"" msgid "Content" msgstr "Inhalt" @@ -63,25 +63,22 @@ msgstr "Name" msgid "Let's go!" msgstr "Los geht's!" -msgid "Welcome to {{ instance_name | escape }}" -msgstr "Willkommen auf {{ instance_name | escape }}" +msgid "Welcome to {0}" +msgstr "" msgid "Notifications" msgstr "Benachrichtigungen" -msgid "" -"Written by {{ link_1 }}{{ url }}{{ link_2 }}{{ name | escape }}{{ link_3 }}" +msgid "Written by {0}" msgstr "" -"Geschrieben von {{ link_1 }}{{ url }}{{ link_2 }}{{ name | escape }}" -"{{ link_3 }}" -msgid "This article is under the {{ license }} license." -msgstr "Dieser Artikel steht unter der {{ license }} Lizenz." +msgid "This article is under the {0} license." +msgstr "Dieser Artikel steht unter der {0} Lizenz." msgid "One like" -msgid_plural "{{ count }} likes" +msgid_plural "{0} likes" msgstr[0] "Ein Like" -msgstr[1] "{{ count }} Likes" +msgstr[1] "{0} Likes" msgid "I don't like this anymore" msgstr "Nicht mehr Liken" @@ -90,9 +87,9 @@ msgid "Add yours" msgstr "Like" msgid "One Boost" -msgid_plural "{{ count }} Boosts" +msgid_plural "{0} Boosts" msgstr[0] "Ein Boost" -msgstr[1] "{{ count }} Boosts" +msgstr[1] "{0} Boosts" msgid "I don't want to boost this anymore" msgstr "Nicht mehr boosten" @@ -153,8 +150,8 @@ msgstr "Das bist du" msgid "Edit your profile" msgstr "Ändere dein Profil" -msgid "Open on {{ instance_url }}" -msgstr "Öffnen auf {{ instance_url }}" +msgid "Open on {0}" +msgstr "" msgid "Follow" msgstr "Folgen" @@ -166,9 +163,9 @@ msgid "Recently boosted" msgstr "Kürzlich geboostet" msgid "One follower" -msgid_plural "{{ count }} followers" +msgid_plural "{0} followers" msgstr[0] "Ein Follower" -msgstr[1] "{{ count }} Followers" +msgstr[1] "{0} Followers" msgid "Edit your account" msgstr "Ändere deinen Account" @@ -188,8 +185,8 @@ msgstr "Zusammenfassung" msgid "Update account" msgstr "Account aktualisieren" -msgid "{{ name | escape }}'s followers" -msgstr "{{ name | escape }}s Follower" +msgid "{0}'s followers" +msgstr "{0}s Follower" msgid "Followers" msgstr "Follower" @@ -257,21 +254,20 @@ msgstr "Du musst eingeloggt sein, um jemandem zu folgen" msgid "You need to be logged in order to edit your profile" msgstr "Du musst eingeloggt sein, um dein Profil zu editieren" -msgid "By {{ link_1 }}{{ link_2 }}{{ link_3 }}{{ name | escape }}{{ link_4 }}" +msgid "By {0}" msgstr "" -"Von {{ link_1 }}{{ link_2 }}{{ link_3 }}{{ name | escape }}{{ link_4 }}" -msgid "{{ data }} boosted your article" -msgstr "{{ data }} hat deinen Artikel geboostet" +msgid "{0} boosted your article" +msgstr "{0} hat deinen Artikel geboostet" -msgid "{{ data }} started following you" -msgstr "{{ data }} folgt dir nun" +msgid "{0} started following you" +msgstr "{0} folgt dir nun" -msgid "{{ data }} liked your article" -msgstr "{{ data }} hat deinen Artikel geliked" +msgid "{0} liked your article" +msgstr "{0} hat deinen Artikel geliked" -msgid "{{ data }} commented your article" -msgstr "{{ data }} hat deinen Artikel kommentiert" +msgid "{0} commented your article" +msgstr "{0} hat deinen Artikel kommentiert" msgid "We couldn't find this page." msgstr "Wir konnten diese Seite nicht finden." @@ -285,8 +281,8 @@ msgstr "Nicht berechtigt." msgid "You are not author in this blog." msgstr "Du bist kein Autor in diesem Blog." -msgid "{{ data }} mentioned you." -msgstr "{{ data }} hat dich erwähnt." +msgid "{0} mentioned you." +msgstr "{0} hat dich erwähnt." msgid "Your comment" msgstr "Dein Kommentar" @@ -326,9 +322,9 @@ msgid "Password should be at least 8 characters long" msgstr "Passwort sollte mindestens 8 Zeichen lang sein" msgid "One author in this blog: " -msgid_plural "{{ count }} authors in this blog: " +msgid_plural "{0} authors in this blog: " msgstr[0] "Ein Autor in diesem Blog: " -msgstr[1] "{{ count }} Autoren in diesem Blog: " +msgstr[1] "{0} Autoren in diesem Blog: " msgid "Login or use your Fediverse account to interact with this article" msgstr "" @@ -339,9 +335,9 @@ msgid "Optional" msgstr "Optional" msgid "One article in this blog" -msgid_plural "{{ count }} articles in this blog" +msgid_plural "{0} articles in this blog" msgstr[0] "Ein Artikel in diesem Blog" -msgstr[1] "{{ count }} Artikel in diesem Blog" +msgstr[1] "{0} Artikel in diesem Blog" msgid "Previous page" msgstr "Vorherige Seite" @@ -349,21 +345,6 @@ msgstr "Vorherige Seite" msgid "Next page" msgstr "Nächste Seite" -msgid "{{ user }} mentioned you." -msgstr "{{ user }} hat dich erwähnt." - -msgid "{{ user }} commented your article." -msgstr "{{ user }} hat deinen Artikel kommentiert." - -msgid "{{ user }} is now following you." -msgstr "{{ user }} folgt dir nun." - -msgid "{{ user }} liked your article." -msgstr "{{ user }} hat deinen Artikel geliked." - -msgid "{{ user }} boosted your article." -msgstr "{{ user }} hat deinen Artikel geboostet." - msgid "Source code" msgstr "Quellcode" @@ -419,20 +400,17 @@ msgstr "" msgid "Create your account" msgstr "Eigenen Account erstellen" -msgid "About {{ instance_name }}" -msgstr "Über {{ instance_name }}" +msgid "About {0}" +msgstr "" -msgid "Home to" -msgstr "Heimat von" +msgid "Home to {0} users" +msgstr "" -msgid "people" -msgstr "Menschen" +msgid "Who wrote {0} articles" +msgstr "" -msgid "Who wrote" -msgstr "Wer schrieb" - -msgid "articles" -msgstr "Artikel" +msgid "And connected to {0} other instances" +msgstr "" msgid "Read the detailed rules" msgstr "Lies die detailierten Regeln" @@ -444,17 +422,11 @@ msgstr "Artikel löschen" msgid "Delete this blog" msgstr "Artikel löschen" -msgid "And connected to" -msgstr "Und verbunden mit" - -msgid "other instances" -msgstr "anderen Instanzen" - msgid "Administred by" msgstr "Administriert von" -msgid "Runs Plume {{ version }}" -msgstr "Verwendet Plume {{ version }}" +msgid "Runs Plume {0}" +msgstr "Verwendet Plume {0}" #, fuzzy msgid "Your media" @@ -463,8 +435,8 @@ msgstr "Deine Mediendateien" msgid "Go to your gallery" msgstr "Zu deiner Gallerie" -msgid "{{ name}}'s avatar'" -msgstr "{{ name}}'s Avatar'" +msgid "{0}'s avatar'" +msgstr "{0}'s Avatar'" msgid "Media details" msgstr "Mediendetails" @@ -472,7 +444,6 @@ msgstr "Mediendetails" msgid "Go back to the gallery" msgstr "Zurück zur Gallerie" -#, fuzzy msgid "Markdown code" msgstr "Markdown Code" @@ -497,7 +468,6 @@ msgstr "Hochladen von Mediendateien" msgid "Description" msgstr "Beschreibung" -#, fuzzy msgid "Content warning" msgstr "Warnhinweis zum Inhalt" @@ -522,7 +492,6 @@ msgstr "Um zu liken, musst du eingeloggt sein" msgid "Login to boost" msgstr "Um zu boosten, musst du eingeloggt sein" -#, fuzzy msgid "Your feed" msgstr "Dein Feed" @@ -541,20 +510,21 @@ msgstr "Artikel" msgid "All the articles of the Fediverse" msgstr "Alle Artikel des Fediverse" -msgid "Articles from {{ instance.name }}" -msgstr "Artikel von {{ instance.name }}" +msgid "Articles from {0}" +msgstr "Artikel von {0}" msgid "View all" msgstr "Alles anzeigen" -msgid "Articles tagged \"{{ tag }}\"" -msgstr "Mit \"{{ tag }}\" markierte Artikel" +msgid "Articles tagged \"{0}\"" +msgstr "Mit \"{0}\" markierte Artikel" msgid "Edit" msgstr "Bearbeiten" -msgid "Edit {{ post }}" -msgstr "{{ post }} bearbeiten" +#, fuzzy +msgid "Edit {0}" +msgstr "Bearbeiten" msgid "Update" msgstr "Aktualisieren" @@ -574,8 +544,9 @@ msgstr "" "Cookies in deinem Browser aktiviert sind und versuche diese Seite neu zu " "laden. Bitte melde diesen Fehler, falls er erneut auftritt." -msgid "Administration of {{ instance.name }}" -msgstr "Administration von {{ instance.name }}" +#, fuzzy +msgid "Administration of {0}" +msgstr "Administration" msgid "Instances" msgstr "Instanzen" @@ -638,5 +609,20 @@ msgstr "Administration" msgid "None" msgstr "" -#~ msgid "Your password should be at least 8 characters long" -#~ msgstr "Das Passwort sollte mindestens 8 Zeichen lang sein" +#~ msgid "Home to" +#~ msgstr "Heimat von" + +#~ msgid "people" +#~ msgstr "Menschen" + +#~ msgid "Who wrote" +#~ msgstr "Wer schrieb" + +#~ msgid "articles" +#~ msgstr "Artikel" + +#~ msgid "And connected to" +#~ msgstr "Und verbunden mit" + +#~ msgid "other instances" +#~ msgstr "anderen Instanzen" diff --git a/po/en.po b/po/en.po index 646e956b..d861db64 100644 --- a/po/en.po +++ b/po/en.po @@ -33,7 +33,7 @@ msgstr "" msgid "Create blog" msgstr "" -msgid "Comment \"{{ post }}\"" +msgid "Comment \"{0}\"" msgstr "" msgid "Content" @@ -60,23 +60,21 @@ msgstr "" msgid "Let's go!" msgstr "" -#, fuzzy -msgid "Welcome to {{ instance_name | escape }}" -msgstr "Welcome to {{ instance_name }}" +msgid "Welcome to {0}" +msgstr "" msgid "Notifications" msgstr "" -msgid "" -"Written by {{ link_1 }}{{ url }}{{ link_2 }}{{ name | escape }}{{ link_3 }}" +msgid "Written by {0}" msgstr "" -msgid "This article is under the {{ license }} license." +msgid "This article is under the {0} license." msgstr "" #, fuzzy msgid "One like" -msgid_plural "{{ count }} likes" +msgid_plural "{0} likes" msgstr[0] "One follower" msgstr[1] "{{ count }} followers" @@ -87,7 +85,7 @@ msgid "Add yours" msgstr "" msgid "One Boost" -msgid_plural "{{ count }} Boosts" +msgid_plural "{0} Boosts" msgstr[0] "" msgstr[1] "" @@ -148,9 +146,8 @@ msgstr "" msgid "Edit your profile" msgstr "" -#, fuzzy -msgid "Open on {{ instance_url }}" -msgstr "Welcome to {{ instance_name }}" +msgid "Open on {0}" +msgstr "" msgid "Follow" msgstr "" @@ -162,8 +159,9 @@ msgstr "One follower" msgid "Recently boosted" msgstr "" +#, fuzzy msgid "One follower" -msgid_plural "{{ count }} followers" +msgid_plural "{0} followers" msgstr[0] "One follower" msgstr[1] "{{ count }} followers" @@ -186,7 +184,7 @@ msgid "Update account" msgstr "" #, fuzzy -msgid "{{ name | escape }}'s followers" +msgid "{0}'s followers" msgstr "One follower" #, fuzzy @@ -256,19 +254,19 @@ msgstr "" msgid "You need to be logged in order to edit your profile" msgstr "" -msgid "By {{ link_1 }}{{ link_2 }}{{ link_3 }}{{ name | escape }}{{ link_4 }}" +msgid "By {0}" msgstr "" -msgid "{{ data }} boosted your article" +msgid "{0} boosted your article" msgstr "" -msgid "{{ data }} started following you" +msgid "{0} started following you" msgstr "" -msgid "{{ data }} liked your article" +msgid "{0} liked your article" msgstr "" -msgid "{{ data }} commented your article" +msgid "{0} commented your article" msgstr "" msgid "We couldn't find this page." @@ -283,7 +281,7 @@ msgstr "" msgid "You are not author in this blog." msgstr "" -msgid "{{ data }} mentioned you." +msgid "{0} mentioned you." msgstr "" msgid "Your comment" @@ -323,7 +321,7 @@ msgid "Password should be at least 8 characters long" msgstr "" msgid "One author in this blog: " -msgid_plural "{{ count }} authors in this blog: " +msgid_plural "{0} authors in this blog: " msgstr[0] "" msgstr[1] "" @@ -334,7 +332,7 @@ msgid "Optional" msgstr "" msgid "One article in this blog" -msgid_plural "{{ count }} articles in this blog" +msgid_plural "{0} articles in this blog" msgstr[0] "" msgstr[1] "" @@ -344,21 +342,6 @@ msgstr "" msgid "Next page" msgstr "" -msgid "{{ user }} mentioned you." -msgstr "" - -msgid "{{ user }} commented your article." -msgstr "" - -msgid "{{ user }} is now following you." -msgstr "" - -msgid "{{ user }} liked your article." -msgstr "" - -msgid "{{ user }} boosted your article." -msgstr "" - msgid "Source code" msgstr "" @@ -412,20 +395,16 @@ msgstr "" msgid "Create your account" msgstr "" -#, fuzzy -msgid "About {{ instance_name }}" -msgstr "Welcome to {{ instance_name }}" - -msgid "Home to" +msgid "About {0}" msgstr "" -msgid "people" +msgid "Home to {0} users" msgstr "" -msgid "Who wrote" +msgid "Who wrote {0} articles" msgstr "" -msgid "articles" +msgid "And connected to {0} other instances" msgstr "" msgid "Read the detailed rules" @@ -437,16 +416,10 @@ msgstr "" msgid "Delete this blog" msgstr "" -msgid "And connected to" -msgstr "" - -msgid "other instances" -msgstr "" - msgid "Administred by" msgstr "" -msgid "Runs Plume {{ version }}" +msgid "Runs Plume {0}" msgstr "" msgid "Your media" @@ -455,7 +428,7 @@ msgstr "" msgid "Go to your gallery" msgstr "" -msgid "{{ name}}'s avatar'" +msgid "{0}'s avatar'" msgstr "" msgid "Media details" @@ -529,20 +502,20 @@ msgid "All the articles of the Fediverse" msgstr "" #, fuzzy -msgid "Articles from {{ instance.name }}" +msgid "Articles from {0}" msgstr "Welcome to {{ instance_name }}" msgid "View all" msgstr "" #, fuzzy -msgid "Articles tagged \"{{ tag }}\"" +msgid "Articles tagged \"{0}\"" msgstr "Welcome to {{ instance_name }}" msgid "Edit" msgstr "" -msgid "Edit {{ post }}" +msgid "Edit {0}" msgstr "" msgid "Update" @@ -561,7 +534,7 @@ msgid "" msgstr "" #, fuzzy -msgid "Administration of {{ instance.name }}" +msgid "Administration of {0}" msgstr "Welcome to {{ instance_name }}" msgid "Instances" diff --git a/po/fr.po b/po/fr.po index a11ea0cd..80ab0d9c 100644 --- a/po/fr.po +++ b/po/fr.po @@ -13,7 +13,7 @@ msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Plural-Forms: nplurals=2; plural=(n != 1);\n" +"Plural-Forms: nplurals=2; plural=n > 1;\n" "X-Generator: Gtranslator 2.91.7\n" msgid "Latest articles" @@ -37,8 +37,8 @@ msgstr "Titre" msgid "Create blog" msgstr "Créer le blog" -msgid "Comment \"{{ post }}\"" -msgstr "Commenter « {{ post }} »" +msgid "Comment \"{0}\"" +msgstr "Commenter « {0} »" msgid "Content" msgstr "Contenu" @@ -66,24 +66,22 @@ msgstr "Nom" msgid "Let's go!" msgstr "C’est parti !" -msgid "Welcome to {{ instance_name | escape }}" -msgstr "Bienvenue sur {{ instance_name | escape }}" +msgid "Welcome to {0}" +msgstr "" msgid "Notifications" msgstr "Notifications" -msgid "" -"Written by {{ link_1 }}{{ url }}{{ link_2 }}{{ name | escape }}{{ link_3 }}" -msgstr "" -"Écrit par {{ link_1 }}{{ url }}{{ link_2 }}{{ name | escape }}{{ link_3 }}" +msgid "Written by {0}" +msgstr "Écrit par {0}" -msgid "This article is under the {{ license }} license." -msgstr "Cet article est placé sous la licence {{ license }}" +msgid "This article is under the {0} license." +msgstr "Cet article est placé sous la licence {0}" msgid "One like" -msgid_plural "{{ count }} likes" -msgstr[0] "{{ count }} personne aime cet article" -msgstr[1] "{{ count }} personnes aiment cet article" +msgid_plural "{0} likes" +msgstr[0] "{0} personne aime cet article" +msgstr[1] "{0} personnes aiment cet article" msgid "I don't like this anymore" msgstr "Je n’aime plus" @@ -92,9 +90,9 @@ msgid "Add yours" msgstr "J’aime" msgid "One Boost" -msgid_plural "{{ count }} Boosts" -msgstr[0] "{{ count }} partage" -msgstr[1] "{{ count }} partages" +msgid_plural "{0} Boosts" +msgstr[0] "{0} partage" +msgstr[1] "{0} partages" msgid "I don't want to boost this anymore" msgstr "Je ne veux plus repartager ceci" @@ -155,8 +153,8 @@ msgstr "C’est vous" msgid "Edit your profile" msgstr "Modifier votre profil" -msgid "Open on {{ instance_url }}" -msgstr "Ouvrir sur {{ instance_url }}" +msgid "Open on {0}" +msgstr "Ouvrir sur {0}" msgid "Follow" msgstr "S’abonner" @@ -168,9 +166,9 @@ msgid "Recently boosted" msgstr "Récemment partagé" msgid "One follower" -msgid_plural "{{ count }} followers" -msgstr[0] "{{ count }} abonné⋅e" -msgstr[1] "{{ count }} abonné⋅e⋅s" +msgid_plural "{0} followers" +msgstr[0] "{0} abonné⋅e" +msgstr[1] "{0} abonné⋅e⋅s" msgid "Edit your account" msgstr "Modifier votre compte" @@ -190,8 +188,8 @@ msgstr "Description" msgid "Update account" msgstr "Mettre à jour mes informations" -msgid "{{ name | escape }}'s followers" -msgstr "Les abonné⋅e⋅s de {{ name | escape }}" +msgid "{0}'s followers" +msgstr "Abonné⋅e⋅s de {0}" msgid "Followers" msgstr "Abonné⋅e⋅s" @@ -259,21 +257,20 @@ msgstr "Vous devez vous connecter pour suivre quelqu’un" msgid "You need to be logged in order to edit your profile" msgstr "Vous devez vous connecter pour modifier votre profil" -msgid "By {{ link_1 }}{{ link_2 }}{{ link_3 }}{{ name | escape }}{{ link_4 }}" -msgstr "" -"Par {{ link_1 }}{{ link_2 }}{{ link_3 }}{{ name | escape }}{{ link_4 }}" +msgid "By {0}" +msgstr "Par {0}" -msgid "{{ data }} boosted your article" -msgstr "{{ data }} a partagé votre article" +msgid "{0} boosted your article" +msgstr "{0} a partagé votre article" -msgid "{{ data }} started following you" -msgstr "{{ data }} vous suit" +msgid "{0} started following you" +msgstr "{0} vous suit" -msgid "{{ data }} liked your article" -msgstr "{{ data }} a aimé votre article" +msgid "{0} liked your article" +msgstr "{0} a aimé votre article" -msgid "{{ data }} commented your article" -msgstr "{{ data }} a commenté votre article" +msgid "{0} commented your article" +msgstr "{0} a commenté votre article" msgid "We couldn't find this page." msgstr "Page introuvable." @@ -287,8 +284,8 @@ msgstr "Vous n’avez pas les droits." msgid "You are not author in this blog." msgstr "Vous n’êtes pas auteur⋅ice dans ce blog." -msgid "{{ data }} mentioned you." -msgstr "{{ data }} vous a mentionné." +msgid "{0} mentioned you." +msgstr "{0} vous a mentionné." msgid "Your comment" msgstr "Votre commentaire" @@ -329,9 +326,9 @@ msgid "Password should be at least 8 characters long" msgstr "Le mot de passe doit faire au moins 8 caractères." msgid "One author in this blog: " -msgid_plural "{{ count }} authors in this blog: " -msgstr[0] "{{ count }} auteur⋅ice dans ce blog : " -msgstr[1] "{{ count }} auteur⋅ice⋅s dans ce blog : " +msgid_plural "{0} authors in this blog: " +msgstr[0] "{0} auteur⋅ice dans ce blog : " +msgstr[1] "{0} auteur⋅ice⋅s dans ce blog : " msgid "Login or use your Fediverse account to interact with this article" msgstr "" @@ -342,9 +339,9 @@ msgid "Optional" msgstr "Optionnel" msgid "One article in this blog" -msgid_plural "{{ count }} articles in this blog" -msgstr[0] "{{ count }} article dans ce blog" -msgstr[1] "{{ count }} articles dans ce blog" +msgid_plural "{0} articles in this blog" +msgstr[0] "{0} article dans ce blog" +msgstr[1] "{0} articles dans ce blog" msgid "Previous page" msgstr "Page précédente" @@ -352,21 +349,6 @@ msgstr "Page précédente" msgid "Next page" msgstr "Page suivante" -msgid "{{ user }} mentioned you." -msgstr "{{ user }} vous a mentionné." - -msgid "{{ user }} commented your article." -msgstr "{{ user }} a commenté votre article." - -msgid "{{ user }} is now following you." -msgstr "{{ user }} vous suit." - -msgid "{{ user }} liked your article." -msgstr "{{ user }} a aimé votre article." - -msgid "{{ user }} boosted your article." -msgstr "{{ user }} a partagé votre article." - msgid "Source code" msgstr "Code source" @@ -424,20 +406,17 @@ msgstr "" msgid "Create your account" msgstr "Créer votre compte" -msgid "About {{ instance_name }}" -msgstr "À propos de {{ instance_name }}" +msgid "About {0}" +msgstr "À propos de {0}" -msgid "Home to" -msgstr "Accueille" +msgid "Home to {0} users" +msgstr "Accueille {0} personnes" -msgid "people" -msgstr "personnes" +msgid "Who wrote {0} articles" +msgstr "Qui ont écrit {0} articles" -msgid "Who wrote" -msgstr "Ayant écrit" - -msgid "articles" -msgstr "articles" +msgid "And connected to {0} other instances" +msgstr "Et connecté à {0} autres instances" msgid "Read the detailed rules" msgstr "Lire les règles détaillées" @@ -448,17 +427,11 @@ msgstr "Supprimer cet article" msgid "Delete this blog" msgstr "Supprimer ce blog" -msgid "And connected to" -msgstr "Et connectée à" - -msgid "other instances" -msgstr "autres instances" - msgid "Administred by" msgstr "Administré par" -msgid "Runs Plume {{ version }}" -msgstr "Propulsé par Plume {{ version }}" +msgid "Runs Plume {0}" +msgstr "Propulsé par Plume {0}" msgid "Your media" msgstr "Vos médias" @@ -466,8 +439,8 @@ msgstr "Vos médias" msgid "Go to your gallery" msgstr "Aller à votre galerie" -msgid "{{ name}}'s avatar'" -msgstr "Avatar de {{ name }}" +msgid "{0}'s avatar'" +msgstr "Avatar de {0}" msgid "Media details" msgstr "Détails du média" @@ -541,20 +514,20 @@ msgstr "Articles" msgid "All the articles of the Fediverse" msgstr "Tous les articles de la Fédiverse" -msgid "Articles from {{ instance.name }}" -msgstr "Articles de {{ instance.name }}" +msgid "Articles from {0}" +msgstr "Articles de {0}" msgid "View all" msgstr "Tout afficher" -msgid "Articles tagged \"{{ tag }}\"" -msgstr "Articles taggués « {{ instance.name }} »" +msgid "Articles tagged \"{0}\"" +msgstr "Articles taggués « {0} »" msgid "Edit" msgstr "Modifier" -msgid "Edit {{ post }}" -msgstr "Modifier « {{ post }} »" +msgid "Edit {0}" +msgstr "Modifier {0}" msgid "Update" msgstr "Mettre à jour" @@ -574,8 +547,8 @@ msgstr "" "sont activés dans votre navigateur, et essayez de recharger cette page. Si " "vous continuez à voir cette erreur, merci de la signaler." -msgid "Administration of {{ instance.name }}" -msgstr "Administration de {{ instance.name }}" +msgid "Administration of {0}" +msgstr "Administration de {0}" msgid "Instances" msgstr "Instances" @@ -631,9 +604,8 @@ msgstr "Cet article n’est pas encore publié." msgid "There is currently no article with that tag" msgstr "Il n'y a pas encore d'article avec ce tag" -#, fuzzy msgid "Illustration" -msgstr "Administration" +msgstr "Illustration" msgid "None" -msgstr "" +msgstr "Aucun" diff --git a/po/gl.po b/po/gl.po index 7c3c0042..915acc12 100644 --- a/po/gl.po +++ b/po/gl.po @@ -10,7 +10,7 @@ msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Plural-Forms: nplurals=INTEGER; plural=EXPRESSION;\n" +"Plural-Forms: nplurals=1; plural=n > 1;\n" msgid "Latest articles" msgstr "Últimos artigos" @@ -33,8 +33,8 @@ msgstr "Título" msgid "Create blog" msgstr "Crear blog" -msgid "Comment \"{{ post }}\"" -msgstr "Comentar \"{{ post }}\"" +msgid "Comment \"{0}\"" +msgstr "Comentar \"{0}\"" msgid "Content" msgstr "Contido" @@ -60,24 +60,22 @@ msgstr "Nome" msgid "Let's go!" msgstr "Imos!" -msgid "Welcome to {{ instance_name | escape }}" -msgstr "Ben vida a {{ instance_name | escape }}" +msgid "Welcome to {0}" +msgstr "" msgid "Notifications" msgstr "Notificacións" -msgid "" -"Written by {{ link_1 }}{{ url }}{{ link_2 }}{{ name | escape }}{{ link_3 }}" +msgid "Written by {0}" msgstr "" -"Escrito por {{ link_1 }}{{ url }}{{ link_2 }}{{ name | escape }}{{ link_3 }}" -msgid "This article is under the {{ license }} license." -msgstr "Este artigo ten licenza {{ license }}" +msgid "This article is under the {0} license." +msgstr "Este artigo ten licenza {0}" msgid "One like" -msgid_plural "{{ count }} likes" +msgid_plural "{0} likes" msgstr[0] "Un gústame" -msgstr[1] "{{ count }} gústame" +msgstr[1] "{0} gústame" msgid "I don't like this anymore" msgstr "Xa non me gusta" @@ -86,9 +84,9 @@ msgid "Add yours" msgstr "Engada os seus" msgid "One Boost" -msgid_plural "{{ count }} Boosts" +msgid_plural "{0} Boosts" msgstr[0] "Unha promoción" -msgstr[1] "{{ count }} promocións" +msgstr[1] "{0} promocións" msgid "I don't want to boost this anymore" msgstr "Quero retirar a pomoción realizada" @@ -147,8 +145,8 @@ msgstr "É vostede" msgid "Edit your profile" msgstr "Edite o seu perfil" -msgid "Open on {{ instance_url }}" -msgstr "Abrir en {{ instance_url }}" +msgid "Open on {0}" +msgstr "" msgid "Follow" msgstr "Seguir" @@ -160,9 +158,9 @@ msgid "Recently boosted" msgstr "Promocionada recentemente" msgid "One follower" -msgid_plural "{{ count }} followers" +msgid_plural "{0} followers" msgstr[0] "Unha seguidora" -msgstr[1] "{{ count }} seguidoras" +msgstr[1] "{0} seguidoras" msgid "Edit your account" msgstr "Edite a súa conta" @@ -182,8 +180,9 @@ msgstr "Resumen" msgid "Update account" msgstr "Actualizar conta" -msgid "{{ name | escape }}'s followers" -msgstr "Seguidoras de {{ name | escape }}" +#, fuzzy +msgid "{0}'s followers" +msgstr "Unha seguidora" msgid "Followers" msgstr "Seguidoras" @@ -251,21 +250,20 @@ msgstr "Debe estar conectada para seguir a alguén" msgid "You need to be logged in order to edit your profile" msgstr "Debe estar conectada para editar o seu perfil" -msgid "By {{ link_1 }}{{ link_2 }}{{ link_3 }}{{ name | escape }}{{ link_4 }}" +msgid "By {0}" msgstr "" -"Por {{ link_1 }}{{ link_2 }}{{ link_3 }}{{ name | escape }}{{ link_4 }}" -msgid "{{ data }} boosted your article" -msgstr "{{ data }} promoveron o seu artigo" +msgid "{0} boosted your article" +msgstr "{0} promoveron o seu artigo" -msgid "{{ data }} started following you" -msgstr "{{ data }} comezou a seguila" +msgid "{0} started following you" +msgstr "{0} comezou a seguila" -msgid "{{ data }} liked your article" -msgstr "{{ data }} gustou do seu artigo" +msgid "{0} liked your article" +msgstr "{0} gustou do seu artigo" -msgid "{{ data }} commented your article" -msgstr "{{ data }} comentou o seu artigo" +msgid "{0} commented your article" +msgstr "{0} comentou o seu artigo" msgid "We couldn't find this page." msgstr "Non atopamos esta páxina" @@ -279,8 +277,8 @@ msgstr "Non ten permiso." msgid "You are not author in this blog." msgstr "Vostede non é autora en este blog." -msgid "{{ data }} mentioned you." -msgstr "{{ data }} mencionouna." +msgid "{0} mentioned you." +msgstr "{0} mencionouna." msgid "Your comment" msgstr "O seu comentario" @@ -319,9 +317,9 @@ msgid "Password should be at least 8 characters long" msgstr "O contrasinal debe ter ao menos 8 caracteres" msgid "One author in this blog: " -msgid_plural "{{ count }} authors in this blog: " +msgid_plural "{0} authors in this blog: " msgstr[0] "Unha autora en este blog: " -msgstr[1] "{{ count }} autoras en este blog: " +msgstr[1] "{0} autoras en este blog: " msgid "Login or use your Fediverse account to interact with this article" msgstr "" @@ -332,9 +330,9 @@ msgid "Optional" msgstr "Opcional" msgid "One article in this blog" -msgid_plural "{{ count }} articles in this blog" +msgid_plural "{0} articles in this blog" msgstr[0] "Un artigo en este blog" -msgstr[1] "{{ count }} artigos en este blog" +msgstr[1] "{0} artigos en este blog" msgid "Previous page" msgstr "Páxina anterior" @@ -342,21 +340,6 @@ msgstr "Páxina anterior" msgid "Next page" msgstr "Páxina seguinte" -msgid "{{ user }} mentioned you." -msgstr "{{ user }} mencionouna." - -msgid "{{ user }} commented your article." -msgstr "{{ user }} comentou o artigo." - -msgid "{{ user }} is now following you." -msgstr "{{ user }} está a seguila." - -msgid "{{ user }} liked your article." -msgstr "{{ user }} gustou do seu artigo." - -msgid "{{ user }} boosted your article." -msgstr "{{ user }} promoveu o seu artigo." - msgid "Source code" msgstr "Código fonte" @@ -412,20 +395,17 @@ msgstr "" msgid "Create your account" msgstr "Cree a súa conta" -msgid "About {{ instance_name }}" -msgstr "Acerca de {{ instance_name }}" +msgid "About {0}" +msgstr "" -msgid "Home to" -msgstr "Fogar de" +msgid "Home to {0} users" +msgstr "" -msgid "people" -msgstr "persoas" +msgid "Who wrote {0} articles" +msgstr "" -msgid "Who wrote" -msgstr "Que escribiron" - -msgid "articles" -msgstr "artigos" +msgid "And connected to {0} other instances" +msgstr "" msgid "Read the detailed rules" msgstr "Lea o detalle das normas" @@ -436,17 +416,11 @@ msgstr "Borrar este artigo" msgid "Delete this blog" msgstr "Borrar este blog" -msgid "And connected to" -msgstr "E conectada a" - -msgid "other instances" -msgstr "outras instancias" - msgid "Administred by" msgstr "Administrada por" -msgid "Runs Plume {{ version }}" -msgstr "Versión Plume {{ version }}" +msgid "Runs Plume {0}" +msgstr "Versión Plume {0}" msgid "Your media" msgstr "Os seus medios" @@ -454,7 +428,7 @@ msgstr "Os seus medios" msgid "Go to your gallery" msgstr "Ir a súa galería" -msgid "{{ name}}'s avatar'" +msgid "{0}'s avatar'" msgstr "Avatar de {{ name}}" msgid "Media details" @@ -529,20 +503,21 @@ msgstr "Artigos" msgid "All the articles of the Fediverse" msgstr "Todos os artigos do Fediverso" -msgid "Articles from {{ instance.name }}" -msgstr "Artigos desde {{ instance_name }}" +msgid "Articles from {0}" +msgstr "Artigos desde {0}" msgid "View all" msgstr "Ver todos" -msgid "Articles tagged \"{{ tag }}\"" -msgstr "Artigos etiquetados con {{ instance_name }}" +msgid "Articles tagged \"{0}\"" +msgstr "Artigos etiquetados con {0}" msgid "Edit" msgstr "Editar" -msgid "Edit {{ post }}" -msgstr "Editar \"{{ post }}\"" +#, fuzzy +msgid "Edit {0}" +msgstr "Editar" msgid "Update" msgstr "Actualizar" @@ -562,8 +537,9 @@ msgstr "" "no navegador, e recargue a páxina. Si persiste o aviso de este fallo, " "informe por favor." -msgid "Administration of {{ instance.name }}" -msgstr "Administración de {{ instance_name }}" +#, fuzzy +msgid "Administration of {0}" +msgstr "Administración" msgid "Instances" msgstr "Instancias" @@ -611,7 +587,6 @@ msgstr "" msgid "Users" msgstr "Usuarias" -#, fuzzy msgid "This post isn't published yet." msgstr "Esto é un borrador, non publicar por agora." @@ -624,3 +599,21 @@ msgstr "Administración" msgid "None" msgstr "" + +#~ msgid "Home to" +#~ msgstr "Fogar de" + +#~ msgid "people" +#~ msgstr "persoas" + +#~ msgid "Who wrote" +#~ msgstr "Que escribiron" + +#~ msgid "articles" +#~ msgstr "artigos" + +#~ msgid "And connected to" +#~ msgstr "E conectada a" + +#~ msgid "other instances" +#~ msgstr "outras instancias" diff --git a/po/it.po b/po/it.po index 6f31e568..51fc63eb 100644 --- a/po/it.po +++ b/po/it.po @@ -33,8 +33,8 @@ msgstr "Titolo" msgid "Create blog" msgstr "Crea blog" -msgid "Comment \"{{ post }}\"" -msgstr "Commenta \"{{ post }}\"" +msgid "Comment \"{0}\"" +msgstr "Commenta \"{0}\"" msgid "Content" msgstr "Contenuto" @@ -60,24 +60,22 @@ msgstr "Nome" msgid "Let's go!" msgstr "Andiamo!" -msgid "Welcome to {{ instance_name | escape }}" -msgstr "Benvenuto su {{ instance_name | escape }}" +msgid "Welcome to {0}" +msgstr "" msgid "Notifications" msgstr "Notifiche" -msgid "" -"Written by {{ link_1 }}{{ url }}{{ link_2 }}{{ name | escape }}{{ link_3 }}" +msgid "Written by {0}" msgstr "" -"Scritto da {{ link_1 }}{{ url }}{{ link_2 }}{{ name | escape }}{{ link_3 }}" -msgid "This article is under the {{ license }} license." -msgstr "Questo articolo è rilasciato con licenza {{ license }} ." +msgid "This article is under the {0} license." +msgstr "Questo articolo è rilasciato con licenza {0} ." msgid "One like" -msgid_plural "{{ count }} likes" +msgid_plural "{0} likes" msgstr[0] "Un mi piace" -msgstr[1] "{{ count }} mi piace" +msgstr[1] "{0} mi piace" msgid "I don't like this anymore" msgstr "Non mi piace più" @@ -86,9 +84,9 @@ msgid "Add yours" msgstr "Metti mi piace" msgid "One Boost" -msgid_plural "{{ count }} Boosts" +msgid_plural "{0} Boosts" msgstr[0] "Un Boost" -msgstr[1] "{{ count }} Boost" +msgstr[1] "{0} Boost" msgid "I don't want to boost this anymore" msgstr "Annulla boost" @@ -149,8 +147,8 @@ msgstr "Sei tu" msgid "Edit your profile" msgstr "Modifica il tuo profilo" -msgid "Open on {{ instance_url }}" -msgstr "Apri su {{ instance_url }}" +msgid "Open on {0}" +msgstr "" msgid "Follow" msgstr "Segui" @@ -162,9 +160,9 @@ msgid "Recently boosted" msgstr "Boostato recentemente" msgid "One follower" -msgid_plural "{{ count }} followers" +msgid_plural "{0} followers" msgstr[0] "Uno ti segue" -msgstr[1] "{{ count }} ti seguono" +msgstr[1] "{0} ti seguono" msgid "Edit your account" msgstr "Modifica il tuo account" @@ -184,8 +182,9 @@ msgstr "Riepilogo" msgid "Update account" msgstr "Aggiorna account" -msgid "{{ name | escape }}'s followers" -msgstr "Persone che seguono {{ name | escape }}" +#, fuzzy +msgid "{0}'s followers" +msgstr "Uno ti segue" msgid "Followers" msgstr "Seguaci" @@ -253,21 +252,20 @@ msgstr "Devi effettuare l'accesso per seguire qualcuno" msgid "You need to be logged in order to edit your profile" msgstr "Devi effettuare l'accesso per modificare il tuo profilo" -msgid "By {{ link_1 }}{{ link_2 }}{{ link_3 }}{{ name | escape }}{{ link_4 }}" +msgid "By {0}" msgstr "" -"Per {{ link_1 }}{{ link_2 }}{{ link_3 }}{{ name | escape }}{{ link_4 }}" -msgid "{{ data }} boosted your article" -msgstr "{{ data }} ha boostato il tuo articolo" +msgid "{0} boosted your article" +msgstr "{0} ha boostato il tuo articolo" -msgid "{{ data }} started following you" -msgstr "{{ data }} ha iniziato a seguirti" +msgid "{0} started following you" +msgstr "{0} ha iniziato a seguirti" -msgid "{{ data }} liked your article" -msgstr "{{ data }} ha messo mi piace al tuo articolo" +msgid "{0} liked your article" +msgstr "{0} ha messo mi piace al tuo articolo" -msgid "{{ data }} commented your article" -msgstr "{{ data }} ha commentato il tuo articolo" +msgid "{0} commented your article" +msgstr "{0} ha commentato il tuo articolo" msgid "We couldn't find this page." msgstr "Non riusciamo a trovare questa pagina." @@ -281,8 +279,8 @@ msgstr "Non sei autorizzato." msgid "You are not author in this blog." msgstr "Non sei l'autore di questo blog." -msgid "{{ data }} mentioned you." -msgstr "{{ data }} ti ha menzionato." +msgid "{0} mentioned you." +msgstr "{0} ti ha menzionato." msgid "Your comment" msgstr "Il tuo commento" @@ -321,9 +319,9 @@ msgid "Password should be at least 8 characters long" msgstr "Le password devono essere lunghe almeno 8 caratteri" msgid "One author in this blog: " -msgid_plural "{{ count }} authors in this blog: " +msgid_plural "{0} authors in this blog: " msgstr[0] "Un autore in questo blog: " -msgstr[1] "{{ count }} autori in questo blog: " +msgstr[1] "{0} autori in questo blog: " msgid "Login or use your Fediverse account to interact with this article" msgstr "" @@ -334,9 +332,9 @@ msgid "Optional" msgstr "Opzionale" msgid "One article in this blog" -msgid_plural "{{ count }} articles in this blog" +msgid_plural "{0} articles in this blog" msgstr[0] "Un articolo in questo blog" -msgstr[1] "{{ count }} articoli in questo blog" +msgstr[1] "{0} articoli in questo blog" msgid "Previous page" msgstr "Pagina precedente" @@ -344,21 +342,6 @@ msgstr "Pagina precedente" msgid "Next page" msgstr "Prossima pagina" -msgid "{{ user }} mentioned you." -msgstr "{{ user }} ti ha menzionato." - -msgid "{{ user }} commented your article." -msgstr "{{ user }} ha commentato il tuo articolo." - -msgid "{{ user }} is now following you." -msgstr "{{ user }} ora ti segue." - -msgid "{{ user }} liked your article." -msgstr "{{ user }} ha messo mi piace al tuo articolo." - -msgid "{{ user }} boosted your article." -msgstr "{{ user }} ha boostato il tuo articolo." - msgid "Source code" msgstr "Codice sorgente" @@ -414,20 +397,17 @@ msgstr "" msgid "Create your account" msgstr "Crea il tuo account" -msgid "About {{ instance_name }}" -msgstr "A proposito di {{ instance_name }}" +msgid "About {0}" +msgstr "" -msgid "Home to" -msgstr "Casa di" +msgid "Home to {0} users" +msgstr "" -msgid "people" -msgstr "persone" +msgid "Who wrote {0} articles" +msgstr "" -msgid "Who wrote" -msgstr "Che hanno scritto" - -msgid "articles" -msgstr "articoli" +msgid "And connected to {0} other instances" +msgstr "" msgid "Read the detailed rules" msgstr "Leggi le regole dettagliate" @@ -438,17 +418,11 @@ msgstr "Elimina questo articolo" msgid "Delete this blog" msgstr "Elimina questo blog" -msgid "And connected to" -msgstr "E connesso a" - -msgid "other instances" -msgstr "altre istanze" - msgid "Administred by" msgstr "Amministrata da" -msgid "Runs Plume {{ version }}" -msgstr "Utilizza Plume {{ version }}" +msgid "Runs Plume {0}" +msgstr "Utilizza Plume {0}" msgid "Your media" msgstr "I tuoi media" @@ -456,8 +430,8 @@ msgstr "I tuoi media" msgid "Go to your gallery" msgstr "Vai alla tua galleria" -msgid "{{ name}}'s avatar'" -msgstr "Avatar di {{ name}}" +msgid "{0}'s avatar'" +msgstr "Avatar di {0}" msgid "Media details" msgstr "Dettagli del media" @@ -531,20 +505,21 @@ msgstr "Articoli" msgid "All the articles of the Fediverse" msgstr "Tutti gli articoli del Fediverso" -msgid "Articles from {{ instance.name }}" -msgstr "Articoli da {{ instance.name }}" +msgid "Articles from {0}" +msgstr "Articoli da {0}}" msgid "View all" msgstr "Vedi tutto" -msgid "Articles tagged \"{{ tag }}\"" -msgstr "Articoli etichettati \"{{ tag }}\"" +msgid "Articles tagged \"{0}\"" +msgstr "Articoli etichettati \"{0}\"" msgid "Edit" msgstr "Modifica" -msgid "Edit {{ post }}" -msgstr "Modifica {{ post }}" +#, fuzzy +msgid "Edit {0}" +msgstr "Modifica" msgid "Update" msgstr "Aggiorna" @@ -564,8 +539,9 @@ msgstr "" "i cookies nel tuo browser, e prova a ricaricare questa pagina. Se l'errore " "si dovesse ripresentare, per favore segnalacelo." -msgid "Administration of {{ instance.name }}" -msgstr "Amministrazione di {{ instance.name }}" +#, fuzzy +msgid "Administration of {0}" +msgstr "Amministrazione" msgid "Instances" msgstr "Istanze" @@ -626,3 +602,21 @@ msgstr "Amministrazione" msgid "None" msgstr "" + +#~ msgid "Home to" +#~ msgstr "Casa di" + +#~ msgid "people" +#~ msgstr "persone" + +#~ msgid "Who wrote" +#~ msgstr "Che hanno scritto" + +#~ msgid "articles" +#~ msgstr "articoli" + +#~ msgid "And connected to" +#~ msgstr "E connesso a" + +#~ msgid "other instances" +#~ msgstr "altre istanze" diff --git a/po/ja.po b/po/ja.po index e384e78a..2cef2b3b 100644 --- a/po/ja.po +++ b/po/ja.po @@ -4,13 +4,13 @@ msgstr "" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2018-06-15 16:33-0700\n" "PO-Revision-Date: 2018-12-03 21:52+0900\n" +"Last-Translator: Ryo Nakano \n" +"Language-Team: \n" "Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=1; plural=0;\n" -"Last-Translator: Ryo Nakano \n" -"Language-Team: \n" "X-Generator: Poedit 2.2\n" msgid "Latest articles" @@ -34,7 +34,8 @@ msgstr "タイトル" msgid "Create blog" msgstr "ブログを作成" -msgid "Comment \"{{ post }}\"" +#, fuzzy +msgid "Comment \"{0}\"" msgstr "\"{{ post }}\" にコメント" msgid "Content" @@ -47,7 +48,8 @@ msgid "Something broke on our side." msgstr "サーバー側で何らかの問題が発生しました。" msgid "Sorry about that. If you think this is a bug, please report it." -msgstr "申し訳ありません。これがバグだと思われる場合は、問題を報告してください。" +msgstr "" +"申し訳ありません。これがバグだと思われる場合は、問題を報告してください。" msgid "Configuration" msgstr "設定" @@ -61,20 +63,22 @@ msgstr "名前" msgid "Let's go!" msgstr "開始しましょう!" -msgid "Welcome to {{ instance_name | escape }}" -msgstr "{{ instance_name | escape }} へようこそ" +msgid "Welcome to {0}" +msgstr "" msgid "Notifications" msgstr "通知" -msgid "Written by {{ link_1 }}{{ url }}{{ link_2 }}{{ name | escape }}{{ link_3 }}" -msgstr "{{ link_1 }}{{ url }}{{ link_2 }}{{ name | escape }}{{ link_3 }} さんが投稿" +msgid "Written by {0}" +msgstr "" -msgid "This article is under the {{ license }} license." +#, fuzzy +msgid "This article is under the {0} license." msgstr "この記事は {{ license }} ライセンスの元で公開されています。" +#, fuzzy msgid "One like" -msgid_plural "{{ count }} likes" +msgid_plural "{0} likes" msgstr[0] "{{ count }} いいね" msgid "I don't like this anymore" @@ -83,8 +87,9 @@ msgstr "もうこれにいいねしません" msgid "Add yours" msgstr "いいねする" +#, fuzzy msgid "One Boost" -msgid_plural "{{ count }} Boosts" +msgid_plural "{0} Boosts" msgstr[0] "{{ count }} ブースト" msgid "I don't want to boost this anymore" @@ -130,7 +135,9 @@ msgid "Your Blogs" msgstr "自分のブログ" msgid "You don't have any blog yet. Create your own, or ask to join one." -msgstr "まだブログを開設していません。ご自身のブログを開設するか、他のブログに参加するようにお願いしてください。" +msgstr "" +"まだブログを開設していません。ご自身のブログを開設するか、他のブログに参加す" +"るようにお願いしてください。" msgid "Start a new blog" msgstr "新しいブログを開始" @@ -144,8 +151,8 @@ msgstr "自分" msgid "Edit your profile" msgstr "自分のプロフィールを編集" -msgid "Open on {{ instance_url }}" -msgstr "{{ instance_url }} で開く" +msgid "Open on {0}" +msgstr "" msgid "Follow" msgstr "フォロー" @@ -156,8 +163,9 @@ msgstr "フォロー解除" msgid "Recently boosted" msgstr "最近ブーストしたもの" +#, fuzzy msgid "One follower" -msgid_plural "{{ count }} followers" +msgid_plural "{0} followers" msgstr[0] "{{ count }} フォロワー" msgid "Edit your account" @@ -178,8 +186,9 @@ msgstr "要約" msgid "Update account" msgstr "アカウントをアップデート" -msgid "{{ name | escape }}'s followers" -msgstr "{{ name | escape }} のフォロワー" +#, fuzzy +msgid "{0}'s followers" +msgstr "{{ count }} フォロワー" msgid "Followers" msgstr "フォロワー" @@ -247,19 +256,23 @@ msgstr "他の人をフォローするにはログインする必要がありま msgid "You need to be logged in order to edit your profile" msgstr "自分のプロフィールを編集するにはログインする必要があります" -msgid "By {{ link_1 }}{{ link_2 }}{{ link_3 }}{{ name | escape }}{{ link_4 }}" -msgstr "{{ link_1 }}{{ link_2 }}{{ link_3 }}{{ name | escape }}{{ link_4 }} が投稿" +msgid "By {0}" +msgstr "" -msgid "{{ data }} boosted your article" +#, fuzzy +msgid "{0} boosted your article" msgstr "{{ data }} があなたの記事をブーストしました" -msgid "{{ data }} started following you" +#, fuzzy +msgid "{0} started following you" msgstr "{{ data }} があなたのフォローを開始しました" -msgid "{{ data }} liked your article" +#, fuzzy +msgid "{0} liked your article" msgstr "{{ data }} があなたの記事をいいねしました" -msgid "{{ data }} commented your article" +#, fuzzy +msgid "{0} commented your article" msgstr "{{ data }} があなたの記事にコメントしました" msgid "We couldn't find this page." @@ -274,7 +287,8 @@ msgstr "認証されていません。" msgid "You are not author in this blog." msgstr "あなたはこのブログの作者ではありません。" -msgid "{{ data }} mentioned you." +#, fuzzy +msgid "{0} mentioned you." msgstr "{{ data }} があなたをメンションしました。" msgid "Your comment" @@ -313,18 +327,21 @@ msgstr "無効なメールアドレス" msgid "Password should be at least 8 characters long" msgstr "パスワードは最低 8 文字にするべきです" +#, fuzzy msgid "One author in this blog: " -msgid_plural "{{ count }} authors in this blog: " +msgid_plural "{0} authors in this blog: " msgstr[0] "ブログに {{ count }} 人の作成者がいます: " msgid "Login or use your Fediverse account to interact with this article" -msgstr "この記事と関わるにはログインするか Fediverse アカウントを使用してください" +msgstr "" +"この記事と関わるにはログインするか Fediverse アカウントを使用してください" msgid "Optional" msgstr "省略可" +#, fuzzy msgid "One article in this blog" -msgid_plural "{{ count }} articles in this blog" +msgid_plural "{0} articles in this blog" msgstr[0] "ブログ内に {{ count }} 件の記事" msgid "Previous page" @@ -333,21 +350,6 @@ msgstr "前のページ" msgid "Next page" msgstr "次のページ" -msgid "{{ user }} mentioned you." -msgstr "{{ user }} があなたをメンションしました。" - -msgid "{{ user }} commented your article." -msgstr "{{ user }} があなたの記事にコメントしました。" - -msgid "{{ user }} is now following you." -msgstr "{{ user }} はあなたをフォローしています。" - -msgid "{{ user }} liked your article." -msgstr "{{ user }} があなたの記事にいいねしました。" - -msgid "{{ user }} boosted your article." -msgstr "{{ user }} があなたの記事をブーストしました。" - msgid "Source code" msgstr "ソースコード" @@ -393,26 +395,27 @@ msgstr "Plume は分散型ブログエンジンです。" msgid "Authors can manage various blogs from an unique website." msgstr "作成者は、ある固有の Web サイトから、さまざまなブログを管理できます。" -msgid "Articles are also visible on other Plume websites, and you can interact with them directly from other platforms like Mastodon." -msgstr "記事は他の Plume Web サイトからも閲覧可能であり、Mastdon のように他のプラットフォームから直接記事と関わることができます。" +msgid "" +"Articles are also visible on other Plume websites, and you can interact with " +"them directly from other platforms like Mastodon." +msgstr "" +"記事は他の Plume Web サイトからも閲覧可能であり、Mastdon のように他のプラット" +"フォームから直接記事と関わることができます。" msgid "Create your account" msgstr "アカウントを作成" -msgid "About {{ instance_name }}" -msgstr "{{ instance_name }} について" +msgid "About {0}" +msgstr "" -msgid "Home to" -msgstr "登録者数" +msgid "Home to {0} users" +msgstr "" -msgid "people" -msgstr "人" +msgid "Who wrote {0} articles" +msgstr "" -msgid "Who wrote" -msgstr "投稿記事数" - -msgid "articles" -msgstr "件" +msgid "And connected to {0} other instances" +msgstr "" msgid "Read the detailed rules" msgstr "詳細な規則を読む" @@ -423,16 +426,11 @@ msgstr "この記事を削除" msgid "Delete this blog" msgstr "このブログを削除" -msgid "And connected to" -msgstr "他のインスタンスからの接続数" - -msgid "other instances" -msgstr "件" - msgid "Administred by" msgstr "管理者" -msgid "Runs Plume {{ version }}" +#, fuzzy +msgid "Runs Plume {0}" msgstr "Plume {{ version }} を実行中" msgid "Your media" @@ -441,7 +439,8 @@ msgstr "メディア" msgid "Go to your gallery" msgstr "ギャラリーを参照" -msgid "{{ name}}'s avatar'" +#, fuzzy +msgid "{0}'s avatar'" msgstr "{{ name}} のアバター" msgid "Media details" @@ -483,8 +482,11 @@ msgstr "ファイル" msgid "Send" msgstr "送信" -msgid "Sorry, but registrations are closed on this instance. Try to find another one" -msgstr "申し訳ありませんが、このインスタンスでは登録者は限定されています。別のインスタンスをお探しください" +msgid "" +"Sorry, but registrations are closed on this instance. Try to find another one" +msgstr "" +"申し訳ありませんが、このインスタンスでは登録者は限定されています。別のインス" +"タンスをお探しください" msgid "Subtitle" msgstr "サブタイトル" @@ -505,7 +507,9 @@ msgid "Local feed" msgstr "このインスタンスのフィード" msgid "Nothing to see here yet. Try to follow more people." -msgstr "ここにはまだ表示できるものがありません。他の人をもっとフォローしてみてください。" +msgstr "" +"ここにはまだ表示できるものがありません。他の人をもっとフォローしてみてくださ" +"い。" msgid "Articles" msgstr "記事" @@ -513,20 +517,23 @@ msgstr "記事" msgid "All the articles of the Fediverse" msgstr "Fediverse のすべての記事" -msgid "Articles from {{ instance.name }}" +#, fuzzy +msgid "Articles from {0}" msgstr "{{ instance.name }} の記事" msgid "View all" msgstr "すべて表示" -msgid "Articles tagged \"{{ tag }}\"" +#, fuzzy +msgid "Articles tagged \"{0}\"" msgstr "\"{{ tag }}\" タグの記事" msgid "Edit" msgstr "編集" -msgid "Edit {{ post }}" -msgstr "{{ post }} を編集" +#, fuzzy +msgid "Edit {0}" +msgstr "編集" msgid "Update" msgstr "アップデート" @@ -537,11 +544,18 @@ msgstr "このページは見つかりませんでした。" msgid "Invalid CSRF token." msgstr "無効な CSRF トークンです。" -msgid "Something is wrong with your CSRF token. Make sure cookies are enabled in you browser, and try reloading this page. If you continue to see this error message, please report it." -msgstr "ご自身の CSRF トークンにおいて問題が発生しました。お使いのブラウザーで Cookie が有効になっていることを確認して、このページを再読み込みしてみてください。このエラーメッセージが表示され続けた場合、問題を報告してください。" +msgid "" +"Something is wrong with your CSRF token. Make sure cookies are enabled in " +"you browser, and try reloading this page. If you continue to see this error " +"message, please report it." +msgstr "" +"ご自身の CSRF トークンにおいて問題が発生しました。お使いのブラウザーで " +"Cookie が有効になっていることを確認して、このページを再読み込みしてみてくだ" +"さい。このエラーメッセージが表示され続けた場合、問題を報告してください。" -msgid "Administration of {{ instance.name }}" -msgstr "{{ instance.name }} の管理" +#, fuzzy +msgid "Administration of {0}" +msgstr "管理" msgid "Instances" msgstr "インスタンス" @@ -599,3 +613,66 @@ msgstr "図" msgid "None" msgstr "なし" + +#~ msgid "Welcome to {{ instance_name | escape }}" +#~ msgstr "{{ instance_name | escape }} へようこそ" + +#~ msgid "" +#~ "Written by {{ link_1 }}{{ url }}{{ link_2 }}{{ name | escape }}" +#~ "{{ link_3 }}" +#~ msgstr "" +#~ "{{ link_1 }}{{ url }}{{ link_2 }}{{ name | escape }}{{ link_3 }} さんが投" +#~ "稿" + +#~ msgid "Open on {{ instance_url }}" +#~ msgstr "{{ instance_url }} で開く" + +#~ msgid "{{ name | escape }}'s followers" +#~ msgstr "{{ name | escape }} のフォロワー" + +#~ msgid "" +#~ "By {{ link_1 }}{{ link_2 }}{{ link_3 }}{{ name | escape }}{{ link_4 }}" +#~ msgstr "" +#~ "{{ link_1 }}{{ link_2 }}{{ link_3 }}{{ name | escape }}{{ link_4 }} が投稿" + +#~ msgid "{{ user }} mentioned you." +#~ msgstr "{{ user }} があなたをメンションしました。" + +#~ msgid "{{ user }} commented your article." +#~ msgstr "{{ user }} があなたの記事にコメントしました。" + +#~ msgid "{{ user }} is now following you." +#~ msgstr "{{ user }} はあなたをフォローしています。" + +#~ msgid "{{ user }} liked your article." +#~ msgstr "{{ user }} があなたの記事にいいねしました。" + +#~ msgid "{{ user }} boosted your article." +#~ msgstr "{{ user }} があなたの記事をブーストしました。" + +#~ msgid "About {{ instance_name }}" +#~ msgstr "{{ instance_name }} について" + +#~ msgid "Home to" +#~ msgstr "登録者数" + +#~ msgid "people" +#~ msgstr "人" + +#~ msgid "Who wrote" +#~ msgstr "投稿記事数" + +#~ msgid "articles" +#~ msgstr "件" + +#~ msgid "And connected to" +#~ msgstr "他のインスタンスからの接続数" + +#~ msgid "other instances" +#~ msgstr "件" + +#~ msgid "Edit {{ post }}" +#~ msgstr "{{ post }} を編集" + +#~ msgid "Administration of {{ instance.name }}" +#~ msgstr "{{ instance.name }} の管理" diff --git a/po/nb.po b/po/nb.po index 921070a6..b3f822eb 100644 --- a/po/nb.po +++ b/po/nb.po @@ -33,8 +33,8 @@ msgstr "Tittel" msgid "Create blog" msgstr "Opprett blogg" -msgid "Comment \"{{ post }}\"" -msgstr "Kommentér \"{{ post }}\"" +msgid "Comment \"{0}\"" +msgstr "Kommentér \"{0}\"" msgid "Content" msgstr "Innhold" @@ -62,24 +62,22 @@ msgstr "Navn" msgid "Let's go!" msgstr "Kjør på!" -msgid "Welcome to {{ instance_name | escape }}" -msgstr "Velkommen til {{ instance_name | escape }}" +msgid "Welcome to {0}" +msgstr "" msgid "Notifications" msgstr "Meldinger" -msgid "" -"Written by {{ link_1 }}{{ url }}{{ link_2 }}{{ name | escape }}{{ link_3 }}" +msgid "Written by {0}" msgstr "" -"Skrevet av {{ link_1 }}{{ url }}{{ link_2 }}{{ name | escape}}{{ link_3 }}" -msgid "This article is under the {{ license }} license." -msgstr "Denne artikkelen er publisert med lisensen {{ license }}" +msgid "This article is under the {0} license." +msgstr "Denne artikkelen er publisert med lisensen {0}" msgid "One like" -msgid_plural "{{ count }} likes" +msgid_plural "{0} likes" msgstr[0] "Ett hjerte" -msgstr[1] "{{ count }} hjerter" +msgstr[1] "{0} hjerter" msgid "I don't like this anymore" msgstr "Jeg liker ikke dette lengre" @@ -88,11 +86,10 @@ msgid "Add yours" msgstr "Legg til din" msgid "One Boost" -msgid_plural "{{ count }} Boosts" +msgid_plural "{0} Boosts" msgstr[0] "" msgstr[1] "" -#, fuzzy msgid "I don't want to boost this anymore" msgstr "Jeg ønsker ikke å dele dette lengre" @@ -152,8 +149,8 @@ msgstr "Dette er deg" msgid "Edit your profile" msgstr "Rediger profilen din" -msgid "Open on {{ instance_url }}" -msgstr "Åpne hos {{ instance_url }}" +msgid "Open on {0}" +msgstr "" msgid "Follow" msgstr "Følg" @@ -161,14 +158,13 @@ msgstr "Følg" msgid "Unfollow" msgstr "Slutt å følge" -#, fuzzy msgid "Recently boosted" msgstr "Nylig delt" msgid "One follower" -msgid_plural "{{ count }} followers" +msgid_plural "{0} followers" msgstr[0] "Én følger" -msgstr[1] "{{ count }} følgere" +msgstr[1] "{0} følgere" msgid "Edit your account" msgstr "Rediger kontoen din" @@ -188,8 +184,9 @@ msgstr "Sammendrag" msgid "Update account" msgstr "Oppdater konto" -msgid "{{ name | escape }}'s followers" -msgstr "{{ name | escape}} sine følgere" +#, fuzzy +msgid "{0}'s followers" +msgstr "Én følger" msgid "Followers" msgstr "Følgere" @@ -258,21 +255,20 @@ msgstr "Du må være logget inn for å følge noen" msgid "You need to be logged in order to edit your profile" msgstr "Du må være logget inn for å redigere profilen din" -msgid "By {{ link_1 }}{{ link_2 }}{{ link_3 }}{{ name | escape }}{{ link_4 }}" -msgstr "Av {{ link_1 }}{{ link_2 }}{{ link_3 }}{{ name | escape }}{{ link_4 }}" +msgid "By {0}" +msgstr "" -#, fuzzy -msgid "{{ data }} boosted your article" -msgstr "{{ data }} la inn en kommentar til artikkelen din" +msgid "{0} boosted your article" +msgstr "{0} la inn en kommentar til artikkelen din" -msgid "{{ data }} started following you" -msgstr "{{ data }} har begynt å følge deg" +msgid "{0} started following you" +msgstr "{0} har begynt å følge deg" -msgid "{{ data }} liked your article" -msgstr "{{ data }} likte artikkelen din" +msgid "{0} liked your article" +msgstr "{0} likte artikkelen din" -msgid "{{ data }} commented your article" -msgstr "{{ data }} la inn en kommentar til artikkelen din" +msgid "{0} commented your article" +msgstr "{0} la inn en kommentar til artikkelen din" msgid "We couldn't find this page." msgstr "Den siden fant vi ikke." @@ -286,8 +282,8 @@ msgstr "Det har du har ikke tilgang til." msgid "You are not author in this blog." msgstr "Du er ikke denne bloggens forfatter." -msgid "{{ data }} mentioned you." -msgstr "{{ data }} nevnte deg." +msgid "{0} mentioned you." +msgstr "{0} nevnte deg." msgid "Your comment" msgstr "Din kommentar" @@ -310,7 +306,6 @@ msgstr "Et innlegg med samme navn finnes allerede." msgid "We need an email or a username to identify you" msgstr "Vi trenger en epost eller et brukernavn for å identifisere deg" -#, fuzzy msgid "Your password can't be empty" msgstr "Kommentaren din kan ikke være tom" @@ -327,9 +322,9 @@ msgid "Password should be at least 8 characters long" msgstr "Passord må bestå av minst åtte tegn" msgid "One author in this blog: " -msgid_plural "{{ count }} authors in this blog: " +msgid_plural "{0} authors in this blog: " msgstr[0] "Én forfatter av denne bloggen: " -msgstr[1] "{{ count }} forfattere av denne bloggen: " +msgstr[1] "{0} forfattere av denne bloggen: " msgid "Login or use your Fediverse account to interact with this article" msgstr "" @@ -339,9 +334,9 @@ msgid "Optional" msgstr "Valgfritt" msgid "One article in this blog" -msgid_plural "{{ count }} articles in this blog" +msgid_plural "{0} articles in this blog" msgstr[0] "Én artikkel i denne bloggen" -msgstr[1] "{{ count }} artikler i denne bloggen" +msgstr[1] "{0} artikler i denne bloggen" msgid "Previous page" msgstr "Forrige side" @@ -349,22 +344,6 @@ msgstr "Forrige side" msgid "Next page" msgstr "Neste side" -msgid "{{ user }} mentioned you." -msgstr "{{ user }} nevnte deg." - -msgid "{{ user }} commented your article." -msgstr "{{ user }} la igjen en kommentar til artikkelen din." - -msgid "{{ user }} is now following you." -msgstr "{{ user }} har nå begynt å følge deg." - -msgid "{{ user }} liked your article." -msgstr "{{ user }} likte artikkelen din." - -#, fuzzy -msgid "{{ user }} boosted your article." -msgstr "{{ user }} la igjen en kommentar til artikkelen din." - msgid "Source code" msgstr "Kildekode" @@ -420,20 +399,17 @@ msgstr "" msgid "Create your account" msgstr "Opprett din konto" -msgid "About {{ instance_name }}" -msgstr "Om {{ instance_name }}" +msgid "About {0}" +msgstr "" -msgid "Home to" -msgstr "Hjem for" +msgid "Home to {0} users" +msgstr "" -msgid "people" -msgstr "personer" +msgid "Who wrote {0} articles" +msgstr "" -msgid "Who wrote" -msgstr "Som har skrevet" - -msgid "articles" -msgstr "artikler" +msgid "And connected to {0} other instances" +msgstr "" msgid "Read the detailed rules" msgstr "Les reglene" @@ -445,18 +421,11 @@ msgstr "Siste artikler" msgid "Delete this blog" msgstr "" -msgid "And connected to" -msgstr "" - -#, fuzzy -msgid "other instances" -msgstr "Om denne instansen" - #, fuzzy msgid "Administred by" msgstr "Administrasjon" -msgid "Runs Plume {{ version }}" +msgid "Runs Plume {0}" msgstr "" #, fuzzy @@ -466,7 +435,7 @@ msgstr "Din kommentar" msgid "Go to your gallery" msgstr "" -msgid "{{ name}}'s avatar'" +msgid "{0}'s avatar'" msgstr "" msgid "Media details" @@ -546,22 +515,22 @@ msgid "All the articles of the Fediverse" msgstr "" #, fuzzy -msgid "Articles from {{ instance.name }}" -msgstr "Om {{ instance_name }}" +msgid "Articles from {0}" +msgstr "Om {0}" msgid "View all" msgstr "" #, fuzzy -msgid "Articles tagged \"{{ tag }}\"" -msgstr "Om {{ instance_name }}" +msgid "Articles tagged \"{0}\"" +msgstr "Om {0}" msgid "Edit" msgstr "" #, fuzzy -msgid "Edit {{ post }}" -msgstr "Kommentér \"{{ post }}\"" +msgid "Edit {0}" +msgstr "Kommentér \"{0}\"" #, fuzzy msgid "Update" @@ -581,8 +550,8 @@ msgid "" msgstr "" #, fuzzy -msgid "Administration of {{ instance.name }}" -msgstr "Om {{ instance_name }}" +msgid "Administration of {0}" +msgstr "Administrasjon" #, fuzzy msgid "Instances" @@ -646,22 +615,18 @@ msgstr "Administrasjon" msgid "None" msgstr "" -#~ msgid "One reshare" -#~ msgid_plural "{{ count }} reshares" -#~ msgstr[0] "Én deling" -#~ msgstr[1] "{{ count }} delinger" +#~ msgid "Home to" +#~ msgstr "Hjem for" -#~ msgid "Reshare" -#~ msgstr "Del" +#~ msgid "people" +#~ msgstr "personer" -#~ msgid "You need to be logged in order to reshare a post" -#~ msgstr "Du må være logget inn for å dele et innlegg" +#~ msgid "Who wrote" +#~ msgstr "Som har skrevet" -#~ msgid "{{ data }} reshared your article" -#~ msgstr "{{ data }} delte din artikkel" +#~ msgid "articles" +#~ msgstr "artikler" -#~ msgid "{{ user }} reshared your article." -#~ msgstr "{{ user }} delte artikkelen din med sine følgere." - -#~ msgid "Your password should be at least 8 characters long" -#~ msgstr "Passordet ditt må bestå av minst åtte tegn" +#, fuzzy +#~ msgid "other instances" +#~ msgstr "Om denne instansen" diff --git a/po/pl.po b/po/pl.po index c10bad40..f968fa68 100644 --- a/po/pl.po +++ b/po/pl.po @@ -35,8 +35,8 @@ msgstr "Tytuł" msgid "Create blog" msgstr "Utwórz blog" -msgid "Comment \"{{ post }}\"" -msgstr "Komentarz „{{ post }}”" +msgid "Comment \"{0}\"" +msgstr "Komentarz „{0}”" msgid "Content" msgstr "Zawartość" @@ -63,26 +63,23 @@ msgstr "Nazwa" msgid "Let's go!" msgstr "Przejdźmy dalej!" -msgid "Welcome to {{ instance_name | escape }}" -msgstr "Witamy na {{ instance_name | escape }}" +msgid "Welcome to {0}" +msgstr "" msgid "Notifications" msgstr "Powiadomienia" -msgid "" -"Written by {{ link_1 }}{{ url }}{{ link_2 }}{{ name | escape }}{{ link_3 }}" +msgid "Written by {0}" msgstr "" -"Napisano przez {{ link_1 }}{{ url }}{{ link_2 }}{{ name | escape }}" -"{{ link_3 }}" -msgid "This article is under the {{ license }} license." -msgstr "Ten artykuł został opublikowany na licencji {{ license }}." +msgid "This article is under the {0} license." +msgstr "Ten artykuł został opublikowany na licencji {0}." msgid "One like" -msgid_plural "{{ count }} likes" +msgid_plural "{0} likes" msgstr[0] "Jedno polubienie" -msgstr[1] "{{ count }} polubienia" -msgstr[2] "{{ count }} polubień" +msgstr[1] "{0} polubienia" +msgstr[2] "{0} polubień" msgid "I don't like this anymore" msgstr "Już tego nie lubię" @@ -91,10 +88,10 @@ msgid "Add yours" msgstr "Dodaj swoje" msgid "One Boost" -msgid_plural "{{ count }} Boosts" +msgid_plural "{0} Boosts" msgstr[0] "Jedno podbicie" -msgstr[1] "{{ count }} podbicia" -msgstr[2] "{{ count }} podbić" +msgstr[1] "{0} podbicia" +msgstr[2] "{0} podbić" msgid "I don't want to boost this anymore" msgstr "Cofnij podbicie" @@ -155,8 +152,8 @@ msgstr "To Ty" msgid "Edit your profile" msgstr "Edytuj swój profil" -msgid "Open on {{ instance_url }}" -msgstr "Otwórz na {{ instance_url }}" +msgid "Open on {0}" +msgstr "" msgid "Follow" msgstr "Obserwuj" @@ -168,10 +165,10 @@ msgid "Recently boosted" msgstr "Ostatnio podbite" msgid "One follower" -msgid_plural "{{ count }} followers" +msgid_plural "{0} followers" msgstr[0] "Jeden obserwujący" -msgstr[1] "{{ count }} obserwujących" -msgstr[2] "{{ count }} obserwujących" +msgstr[1] "{0} obserwujących" +msgstr[2] "{0} obserwujących" msgid "Edit your account" msgstr "Edytuj swoje konto" @@ -191,8 +188,9 @@ msgstr "Opis" msgid "Update account" msgstr "Aktualizuj konto" -msgid "{{ name | escape }}'s followers" -msgstr "Osoby śledzące {{ name | escape }}" +#, fuzzy +msgid "{0}'s followers" +msgstr "Jeden obserwujący" msgid "Followers" msgstr "Śledzący" @@ -260,22 +258,20 @@ msgstr "Musisz się zalogować, aby zacząć obserwować innych" msgid "You need to be logged in order to edit your profile" msgstr "Musisz się zalogować , aby móc edytować swój profil" -msgid "By {{ link_1 }}{{ link_2 }}{{ link_3 }}{{ name | escape }}{{ link_4 }}" +msgid "By {0}" msgstr "" -"Napisano przez {{ link_1 }}{{ url }}{{ link_2 }}{{ name | escape }}" -"{{ link_3 }}" -msgid "{{ data }} boosted your article" -msgstr "{{ data }} podbił(a) Twój artykuł" +msgid "{0} boosted your article" +msgstr "{0} podbił(a) Twój artykuł" -msgid "{{ data }} started following you" -msgstr "{{ data }} zaczął(-ęła) Cię obserwować" +msgid "{0} started following you" +msgstr "{0} zaczął(-ęła) Cię obserwować" -msgid "{{ data }} liked your article" -msgstr "{{ data }} polubił(a) Twój artykuł" +msgid "{0} liked your article" +msgstr "{0} polubił(a) Twój artykuł" -msgid "{{ data }} commented your article" -msgstr "{{ data }} skomentował(a) Twój artykuł" +msgid "{0} commented your article" +msgstr "{0} skomentował(a) Twój artykuł" msgid "We couldn't find this page." msgstr "Nie udało się odnaleźć tej strony." @@ -289,8 +285,8 @@ msgstr "Nie jesteś zalogowany." msgid "You are not author in this blog." msgstr "Nie jesteś autorem tego bloga." -msgid "{{ data }} mentioned you." -msgstr "{{ data }} wspomniał(a) o Tobie." +msgid "{0} mentioned you." +msgstr "{0} wspomniał(a) o Tobie." msgid "Your comment" msgstr "Twój komentarz" @@ -330,10 +326,10 @@ msgid "Password should be at least 8 characters long" msgstr "Hasło musi składać się z przynajmniej 8 znaków" msgid "One author in this blog: " -msgid_plural "{{ count }} authors in this blog: " +msgid_plural "{0} authors in this blog: " msgstr[0] "Ten blog ma jednego autora: " -msgstr[1] "Ten blog ma {{ count }} autorów: " -msgstr[2] "Ten blog ma {{ count }} autorów: " +msgstr[1] "Ten blog ma {0} autorów: " +msgstr[2] "Ten blog ma {0} autorów: " msgid "Login or use your Fediverse account to interact with this article" msgstr "" @@ -344,10 +340,10 @@ msgid "Optional" msgstr "Nieobowiązkowe" msgid "One article in this blog" -msgid_plural "{{ count }} articles in this blog" +msgid_plural "{0} articles in this blog" msgstr[0] "Jeden artykuł na tym blogu" -msgstr[1] "{{ count }} artykuły na tym blogu" -msgstr[2] "{{ count }} artykułów na tym blogu" +msgstr[1] "{0} artykuły na tym blogu" +msgstr[2] "{0} artykułów na tym blogu" msgid "Previous page" msgstr "Poprzednia strona" @@ -355,21 +351,6 @@ msgstr "Poprzednia strona" msgid "Next page" msgstr "Następna strona" -msgid "{{ user }} mentioned you." -msgstr "{{ user }} wspomniał(a) o Tobie." - -msgid "{{ user }} commented your article." -msgstr "{{ user }} skomentował(a) Twój artykuł." - -msgid "{{ user }} is now following you." -msgstr "{{ user }} zaczął(-ęła) Cię obserwować." - -msgid "{{ user }} liked your article." -msgstr "{{ user }} polubił(a) Twój artykuł." - -msgid "{{ user }} boosted your article." -msgstr "{{ user }} podbił(a) Twój artykuł." - msgid "Source code" msgstr "Kod źródłowy" @@ -425,20 +406,17 @@ msgstr "" msgid "Create your account" msgstr "Utwórz konto" -msgid "About {{ instance_name }}" -msgstr "O {{ instance_name }}" +msgid "About {0}" +msgstr "" -msgid "Home to" -msgstr "Dom dla" +msgid "Home to {0} users" +msgstr "" -msgid "people" -msgstr "osób" +msgid "Who wrote {0} articles" +msgstr "" -msgid "Who wrote" -msgstr "Które napisały" - -msgid "articles" -msgstr "artykuły" +msgid "And connected to {0} other instances" +msgstr "" msgid "Read the detailed rules" msgstr "Przeczytaj szczegółowe zasady" @@ -449,17 +427,11 @@ msgstr "Usuń ten artykuł" msgid "Delete this blog" msgstr "Usuń ten blog" -msgid "And connected to" -msgstr "Połączony z" - -msgid "other instances" -msgstr "innych instancji" - msgid "Administred by" msgstr "Administrowany przez" -msgid "Runs Plume {{ version }}" -msgstr "Działa na Plume {{ version }}" +msgid "Runs Plume {0}" +msgstr "Działa na Plume {0}" msgid "Your media" msgstr "Twoja zawartość multimedialna" @@ -467,8 +439,8 @@ msgstr "Twoja zawartość multimedialna" msgid "Go to your gallery" msgstr "Przejdź do swojej galerii" -msgid "{{ name}}'s avatar'" -msgstr "Awatar {{name}}" +msgid "{0}'s avatar'" +msgstr "Awatar {0}" msgid "Media details" msgstr "Szczegóły zawartości multimedialnej" @@ -542,20 +514,21 @@ msgstr "Artykuły" msgid "All the articles of the Fediverse" msgstr "Wszystkie artykuły w Fediwersum" -msgid "Articles from {{ instance.name }}" -msgstr "Artykuły z {{ instance.name }}" +msgid "Articles from {0}" +msgstr "Artykuły z {0}" msgid "View all" msgstr "Zobacz wszystko" -msgid "Articles tagged \"{{ tag }}\"" -msgstr "Artykuły oznaczone „{{ tag }}”" +msgid "Articles tagged \"{0}\"" +msgstr "Artykuły oznaczone „{0}”" msgid "Edit" msgstr "Edytuj" -msgid "Edit {{ post }}" -msgstr "Edytuj {{ post }}" +#, fuzzy +msgid "Edit {0}" +msgstr "Edytuj" msgid "Update" msgstr "Aktualizuj" @@ -575,8 +548,9 @@ msgstr "" "włączone pliki cookies i spróbuj odświeżyć stronę. Jeżeli wciąż widzisz tę " "wiadomość, zgłoś to." -msgid "Administration of {{ instance.name }}" -msgstr "Administracja {{ instance.name }}" +#, fuzzy +msgid "Administration of {0}" +msgstr "Administracja" msgid "Instances" msgstr "Instancje" @@ -635,26 +609,20 @@ msgstr "Ilustracja" msgid "None" msgstr "Brak" -#~ msgid "One reshare" -#~ msgid_plural "{{ count }} reshares" -#~ msgstr[0] "Jedno udostępnienie" -#~ msgstr[1] "{{ count }} udostępnienia" -#~ msgstr[2] "{{ count }} udostępnień" +#~ msgid "Home to" +#~ msgstr "Dom dla" -#~ msgid "Reshare" -#~ msgstr "Udostępnij" +#~ msgid "people" +#~ msgstr "osób" -#~ msgid "You need to be logged in order to reshare a post" -#~ msgstr "Musisz się zalogować, aby udostępnić wpis" +#~ msgid "Who wrote" +#~ msgstr "Które napisały" -#~ msgid "{{ data }} reshared your article" -#~ msgstr "{{ data }} udostępnił Twój artykuł" +#~ msgid "articles" +#~ msgstr "artykuły" -#~ msgid "{{ user }} reshared your article." -#~ msgstr "{{ user }} udostępnił Twój artykuł." +#~ msgid "And connected to" +#~ msgstr "Połączony z" -#~ msgid "Your password should be at least 8 characters long" -#~ msgstr "Twoje hasło musi składać się przynajmniej z 8 znaków" - -#~ msgid "Logowanie" -#~ msgstr "Zaloguj się" +#~ msgid "other instances" +#~ msgstr "innych instancji" diff --git a/po/plume.pot b/po/plume.pot index be7561b4..28962af0 100644 --- a/po/plume.pot +++ b/po/plume.pot @@ -33,7 +33,7 @@ msgstr "" msgid "Create blog" msgstr "" -msgid "Comment \"{{ post }}\"" +msgid "Comment \"{0}\"" msgstr "" msgid "Content" @@ -60,20 +60,20 @@ msgstr "" msgid "Let's go!" msgstr "" -msgid "Welcome to {{ instance_name | escape }}" +msgid "Welcome to {0}" msgstr "" msgid "Notifications" msgstr "" -msgid "Written by {{ link_1 }}{{ url }}{{ link_2 }}{{ name | escape }}{{ link_3 }}" +msgid "Written by {0}" msgstr "" -msgid "This article is under the {{ license }} license." +msgid "This article is under the {0} license." msgstr "" msgid "One like" -msgid_plural "{{ count }} likes" +msgid_plural "{0} likes" msgstr[0] "" msgstr[1] "" @@ -84,7 +84,7 @@ msgid "Add yours" msgstr "" msgid "One Boost" -msgid_plural "{{ count }} Boosts" +msgid_plural "{0} Boosts" msgstr[0] "" msgstr[1] "" @@ -145,7 +145,7 @@ msgstr "" msgid "Edit your profile" msgstr "" -msgid "Open on {{ instance_url }}" +msgid "Open on {0}" msgstr "" msgid "Follow" @@ -158,7 +158,7 @@ msgid "Recently boosted" msgstr "" msgid "One follower" -msgid_plural "{{ count }} followers" +msgid_plural "{0} followers" msgstr[0] "" msgstr[1] "" @@ -180,7 +180,7 @@ msgstr "" msgid "Update account" msgstr "" -msgid "{{ name | escape }}'s followers" +msgid "{0}'s followers" msgstr "" msgid "Followers" @@ -249,19 +249,19 @@ msgstr "" msgid "You need to be logged in order to edit your profile" msgstr "" -msgid "By {{ link_1 }}{{ link_2 }}{{ link_3 }}{{ name | escape }}{{ link_4 }}" +msgid "By {0}" msgstr "" -msgid "{{ data }} boosted your article" +msgid "{0} boosted your article" msgstr "" -msgid "{{ data }} started following you" +msgid "{0} started following you" msgstr "" -msgid "{{ data }} liked your article" +msgid "{0} liked your article" msgstr "" -msgid "{{ data }} commented your article" +msgid "{0} commented your article" msgstr "" msgid "We couldn't find this page." @@ -276,7 +276,7 @@ msgstr "" msgid "You are not author in this blog." msgstr "" -msgid "{{ data }} mentioned you." +msgid "{0} mentioned you." msgstr "" msgid "Your comment" @@ -316,7 +316,7 @@ msgid "Password should be at least 8 characters long" msgstr "" msgid "One author in this blog: " -msgid_plural "{{ count }} authors in this blog: " +msgid_plural "{0} authors in this blog: " msgstr[0] "" msgstr[1] "" @@ -327,7 +327,7 @@ msgid "Optional" msgstr "" msgid "One article in this blog" -msgid_plural "{{ count }} articles in this blog" +msgid_plural "{0} articles in this blog" msgstr[0] "" msgstr[1] "" @@ -337,21 +337,6 @@ msgstr "" msgid "Next page" msgstr "" -msgid "{{ user }} mentioned you." -msgstr "" - -msgid "{{ user }} commented your article." -msgstr "" - -msgid "{{ user }} is now following you." -msgstr "" - -msgid "{{ user }} liked your article." -msgstr "" - -msgid "{{ user }} boosted your article." -msgstr "" - msgid "Source code" msgstr "" @@ -403,19 +388,16 @@ msgstr "" msgid "Create your account" msgstr "" -msgid "About {{ instance_name }}" +msgid "About {0}" msgstr "" -msgid "Home to" +msgid "Home to {0} users" msgstr "" -msgid "people" +msgid "Who wrote {0} articles" msgstr "" -msgid "Who wrote" -msgstr "" - -msgid "articles" +msgid "And connected to {0} other instances" msgstr "" msgid "Read the detailed rules" @@ -427,16 +409,10 @@ msgstr "" msgid "Delete this blog" msgstr "" -msgid "And connected to" -msgstr "" - -msgid "other instances" -msgstr "" - msgid "Administred by" msgstr "" -msgid "Runs Plume {{ version }}" +msgid "Runs Plume {0}" msgstr "" msgid "Your media" @@ -445,7 +421,7 @@ msgstr "" msgid "Go to your gallery" msgstr "" -msgid "{{ name}}'s avatar'" +msgid "{0}'s avatar'" msgstr "" msgid "Media details" @@ -517,19 +493,19 @@ msgstr "" msgid "All the articles of the Fediverse" msgstr "" -msgid "Articles from {{ instance.name }}" +msgid "Articles from {0}" msgstr "" msgid "View all" msgstr "" -msgid "Articles tagged \"{{ tag }}\"" +msgid "Articles tagged \"{0}\"" msgstr "" msgid "Edit" msgstr "" -msgid "Edit {{ post }}" +msgid "Edit {0}" msgstr "" msgid "Update" @@ -544,7 +520,7 @@ msgstr "" msgid "Something is wrong with your CSRF token. Make sure cookies are enabled in you browser, and try reloading this page. If you continue to see this error message, please report it." msgstr "" -msgid "Administration of {{ instance.name }}" +msgid "Administration of {0}" msgstr "" msgid "Instances" diff --git a/po/ru.po b/po/ru.po index 3c517fb9..3930be5c 100644 --- a/po/ru.po +++ b/po/ru.po @@ -35,8 +35,8 @@ msgstr "Заголовок" msgid "Create blog" msgstr "Создать блог" -msgid "Comment \"{{ post }}\"" -msgstr "Комментарий \"{{ post }}\"" +msgid "Comment \"{0}\"" +msgstr "Комментарий \"{0}\"" msgid "Content" msgstr "Содержимое" @@ -64,26 +64,23 @@ msgstr "Имя" msgid "Let's go!" msgstr "Поехали!" -msgid "Welcome to {{ instance_name | escape }}" -msgstr "Добро пожаловать на {{ instance_name | escape }}" +msgid "Welcome to {0}" +msgstr "" msgid "Notifications" msgstr "Уведомления" -msgid "" -"Written by {{ link_1 }}{{ url }}{{ link_2 }}{{ name | escape }}{{ link_3 }}" +msgid "Written by {0}" msgstr "" -"Написано {{ link_1 }}{{ url }}{{ link_2 }}{{ name | escape }}{{ link_3 }}" -#, fuzzy -msgid "This article is under the {{ license }} license." -msgstr "Эта статья распространяется под лицензией {{ license }}" +msgid "This article is under the {0} license." +msgstr "Эта статья распространяется под лицензией {0}" msgid "One like" -msgid_plural "{{ count }} likes" +msgid_plural "{0} likes" msgstr[0] "Один лайк" -msgstr[1] "{{count}} лайка" -msgstr[2] "{{ count }} лайков" +msgstr[1] "{0} лайка" +msgstr[2] "{0} лайков" msgid "I don't like this anymore" msgstr "Мне больше не нравится это" @@ -92,10 +89,10 @@ msgid "Add yours" msgstr "Добавить свой" msgid "One Boost" -msgid_plural "{{ count }} Boosts" +msgid_plural "{0} Boosts" msgstr[0] "Одно продвижение" -msgstr[1] "{{ count }} продвижения" -msgstr[2] "{{ count }} продвижений" +msgstr[1] "{0} продвижения" +msgstr[2] "{0} продвижений" msgid "I don't want to boost this anymore" msgstr "Я не хочу больше продвигать это" @@ -157,8 +154,8 @@ msgstr "Это вы" msgid "Edit your profile" msgstr "Редактировать ваш профиль" -msgid "Open on {{ instance_url }}" -msgstr "Открыть на {{ instance_url }}" +msgid "Open on {0}" +msgstr "" msgid "Follow" msgstr "Подписаться" @@ -170,10 +167,10 @@ msgid "Recently boosted" msgstr "Недавно продвинутые" msgid "One follower" -msgid_plural "{{ count }} followers" +msgid_plural "{0} followers" msgstr[0] "Один подписчик" -msgstr[1] "{{ count }} подписчика" -msgstr[2] "{{ count }} подписчиков" +msgstr[1] "{0} подписчика" +msgstr[2] "{0} подписчиков" msgid "Edit your account" msgstr "Редактировать ваш аккаунт" @@ -194,8 +191,9 @@ msgstr "Резюме" msgid "Update account" msgstr "Обновить аккаунт" -msgid "{{ name | escape }}'s followers" -msgstr "Подписчики {{ name | escape }}" +#, fuzzy +msgid "{0}'s followers" +msgstr "Один подписчик" msgid "Followers" msgstr "Подписчики" @@ -263,20 +261,20 @@ msgstr "Вы должны войти чтобы подписаться на ко msgid "You need to be logged in order to edit your profile" msgstr "Вы должны войти чтобы редактировать ваш профиль" -msgid "By {{ link_1 }}{{ link_2 }}{{ link_3 }}{{ name | escape }}{{ link_4 }}" -msgstr "От {{ link_1 }}{{ link_2 }}{{ link_3 }}{{ name | escape }}{{ link_4 }}" +msgid "By {0}" +msgstr "" -msgid "{{ data }} boosted your article" -msgstr "{{ data }} продвинул(а) вашу статью" +msgid "{0} boosted your article" +msgstr "{0} продвинул(а) вашу статью" -msgid "{{ data }} started following you" -msgstr "{{ data }} подписался на вас" +msgid "{0} started following you" +msgstr "{0} подписался на вас" -msgid "{{ data }} liked your article" -msgstr "{{ data }} понравилась ваша статья" +msgid "{0} liked your article" +msgstr "{0} понравилась ваша статья" -msgid "{{ data }} commented your article" -msgstr "{{ data }} прокомментировал(а) вашу статью" +msgid "{0} commented your article" +msgstr "{0} прокомментировал(а) вашу статью" msgid "We couldn't find this page." msgstr "Мы не можем найти эту страницу." @@ -291,8 +289,8 @@ msgstr "Вы не авторизованы." msgid "You are not author in this blog." msgstr "Вы не автор этого блога." -msgid "{{ data }} mentioned you." -msgstr "{{ data }} упомянул(а) вас." +msgid "{0} mentioned you." +msgstr "{0} упомянул(а) вас." msgid "Your comment" msgstr "Ваш комментарий" @@ -333,10 +331,10 @@ msgid "Password should be at least 8 characters long" msgstr "Пароль должен быть не короче 8 символов" msgid "One author in this blog: " -msgid_plural "{{ count }} authors in this blog: " +msgid_plural "{0} authors in this blog: " msgstr[0] "Один автор в этом блоге: " -msgstr[1] "{{ count }} автора в этом блоге: " -msgstr[2] "{{ count }} авторов в этом блоге: " +msgstr[1] "{0} автора в этом блоге: " +msgstr[2] "{0} авторов в этом блоге: " msgid "Login or use your Fediverse account to interact with this article" msgstr "" @@ -347,10 +345,10 @@ msgid "Optional" msgstr "Не обязательно" msgid "One article in this blog" -msgid_plural "{{ count }} articles in this blog" +msgid_plural "{0} articles in this blog" msgstr[0] "Один пост в этом блоге" -msgstr[1] "{{count}} поста в этом блоге" -msgstr[2] "{{ count }} постов в этом блоге" +msgstr[1] "{0} поста в этом блоге" +msgstr[2] "{0} постов в этом блоге" msgid "Previous page" msgstr "Предыдущая страница" @@ -358,21 +356,6 @@ msgstr "Предыдущая страница" msgid "Next page" msgstr "Следующая страница" -msgid "{{ user }} mentioned you." -msgstr "{{ user }} упомянул вас." - -msgid "{{ user }} commented your article." -msgstr "{{ user }} прокомментировал вашу статью." - -msgid "{{ user }} is now following you." -msgstr "{{ user }} не подписан на вас." - -msgid "{{ user }} liked your article." -msgstr "{{ user }} понравилась ваша статья." - -msgid "{{ user }} boosted your article." -msgstr "{{ user }} продвинул(а) вашу статью." - msgid "Source code" msgstr "Исходный код" @@ -428,20 +411,17 @@ msgstr "" msgid "Create your account" msgstr "Создать аккаунт" -msgid "About {{ instance_name }}" -msgstr "О {{ instance_name }}" +msgid "About {0}" +msgstr "" -msgid "Home to" -msgstr "Дом для" +msgid "Home to {0} users" +msgstr "" -msgid "people" -msgstr "человек" +msgid "Who wrote {0} articles" +msgstr "" -msgid "Who wrote" -msgstr "Которые написали" - -msgid "articles" -msgstr "статей" +msgid "And connected to {0} other instances" +msgstr "" msgid "Read the detailed rules" msgstr "Прочитать подробные правила" @@ -452,17 +432,11 @@ msgstr "Удалить эту статью" msgid "Delete this blog" msgstr "Удалить этот блог" -msgid "And connected to" -msgstr "И подключен к" - -msgid "other instances" -msgstr "другим узлам" - msgid "Administred by" msgstr "Администрируется" -msgid "Runs Plume {{ version }}" -msgstr "Работает на Plume {{ version }}" +msgid "Runs Plume {0}" +msgstr "Работает на Plume {0}" msgid "Your media" msgstr "Ваши медиафайлы" @@ -470,8 +444,8 @@ msgstr "Ваши медиафайлы" msgid "Go to your gallery" msgstr "Перейти в вашу галерею" -msgid "{{ name}}'s avatar'" -msgstr "Аватар {{ name }}" +msgid "{0}'s avatar'" +msgstr "Аватар {0}" msgid "Media details" msgstr "Детали медиафайла" @@ -548,20 +522,21 @@ msgstr "Статьи" msgid "All the articles of the Fediverse" msgstr "Все статьи из Fediverse" -msgid "Articles from {{ instance.name }}" -msgstr "Статьи с {{ instance.name }}" +msgid "Articles from {0}" +msgstr "Статьи с {0}" msgid "View all" msgstr "Показать все" -msgid "Articles tagged \"{{ tag }}\"" -msgstr "Статьи, отмеченные тегом «{{ tag }}»" +msgid "Articles tagged \"{0}\"" +msgstr "Статьи, отмеченные тегом «{0}»" msgid "Edit" msgstr "Редактировать" -msgid "Edit {{ post }}" -msgstr "Редактрировать {{ post }}" +#, fuzzy +msgid "Edit {0}" +msgstr "Редактировать" msgid "Update" msgstr "Обновить" @@ -581,8 +556,9 @@ msgstr "" "cookies и попробуйте перезагрузить страницу. Если вы продолжите видеть это " "сообщение об ошибке, сообщите об этом." -msgid "Administration of {{ instance.name }}" -msgstr "Администрация {{ instance.name }}" +#, fuzzy +msgid "Administration of {0}" +msgstr "Администрирование" msgid "Instances" msgstr "Узлы" @@ -643,3 +619,21 @@ msgstr "Иллюстрация" msgid "None" msgstr "Нет" + +#~ msgid "Home to" +#~ msgstr "Дом для" + +#~ msgid "people" +#~ msgstr "человек" + +#~ msgid "Who wrote" +#~ msgstr "Которые написали" + +#~ msgid "articles" +#~ msgstr "статей" + +#~ msgid "And connected to" +#~ msgstr "И подключен к" + +#~ msgid "other instances" +#~ msgstr "другим узлам" diff --git a/rust-toolchain b/rust-toolchain index c4773552..b676ea3a 100644 --- a/rust-toolchain +++ b/rust-toolchain @@ -1 +1 @@ -nightly-2018-07-17 +nightly-2018-10-06 diff --git a/src/api/apps.rs b/src/api/apps.rs index b69a225d..808636f1 100644 --- a/src/api/apps.rs +++ b/src/api/apps.rs @@ -1,5 +1,5 @@ use canapi::Provider; -use rocket_contrib::Json; +use rocket_contrib::json::Json; use serde_json; use plume_api::apps::AppEndpoint; @@ -10,7 +10,7 @@ use plume_models::{ }; #[post("/apps", data = "")] -fn create(conn: DbConn, data: Json) -> Json { +pub fn create(conn: DbConn, data: Json) -> Json { let post = >::create(&*conn, (*data).clone()).ok(); Json(json!(post)) } diff --git a/src/api/mod.rs b/src/api/mod.rs index 530deb54..defdd8b8 100644 --- a/src/api/mod.rs +++ b/src/api/mod.rs @@ -1,4 +1,5 @@ -use rocket_contrib::Json; +use rocket::request::Form; +use rocket_contrib::json::Json; use serde_json; use plume_common::utils::random_hex; @@ -10,7 +11,7 @@ use plume_models::{ }; #[derive(FromForm)] -struct OAuthRequest { +pub struct OAuthRequest { client_id: String, client_secret: String, password: String, @@ -18,8 +19,8 @@ struct OAuthRequest { scopes: String, } -#[get("/oauth2?")] -fn oauth(query: OAuthRequest, conn: DbConn) -> Json { +#[get("/oauth2?")] +pub fn oauth(query: Form, conn: DbConn) -> Json { let app = App::find_by_client_id(&*conn, &query.client_id).expect("OAuth request from unknown client"); if app.client_secret == query.client_secret { if let Some(user) = User::find_local(&*conn, &query.username) { @@ -28,7 +29,7 @@ fn oauth(query: OAuthRequest, conn: DbConn) -> Json { app_id: app.id, user_id: user.id, value: random_hex(), - scopes: query.scopes, + scopes: query.scopes.clone(), }); Json(json!({ "token": token.value diff --git a/src/api/posts.rs b/src/api/posts.rs index 15ac3501..91634fa9 100644 --- a/src/api/posts.rs +++ b/src/api/posts.rs @@ -1,6 +1,6 @@ use canapi::Provider; use rocket::http::uri::Origin; -use rocket_contrib::Json; +use rocket_contrib::json::Json; use serde_json; use serde_qs; @@ -15,13 +15,13 @@ use api::authorization::*; use Searcher; #[get("/posts/")] -fn get(id: i32, conn: DbConn, auth: Option>, search: Searcher) -> Json { +pub fn get(id: i32, conn: DbConn, auth: Option>, search: Searcher) -> Json { let post = )>>::get(&(&*conn, &search, auth.map(|a| a.0.user_id)), id).ok(); Json(json!(post)) } #[get("/posts")] -fn list(conn: DbConn, uri: &Origin, auth: Option>, search: Searcher) -> Json { +pub fn list(conn: DbConn, uri: &Origin, auth: Option>, search: Searcher) -> Json { let query: PostEndpoint = serde_qs::from_str(uri.query().unwrap_or("")).expect("api::list: invalid query error"); let post = )>>::list(&(&*conn, &search, auth.map(|a| a.0.user_id)), query); Json(json!(post)) diff --git a/src/main.rs b/src/main.rs index 63b1e83f..a4b034eb 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,7 +1,7 @@ -#![feature(custom_derive, plugin, decl_macro)] -#![plugin(rocket_codegen)] +#![feature(custom_derive, plugin, decl_macro, proc_macro_hygiene)] extern crate activitypub; +extern crate askama_escape; extern crate atom_syndication; extern crate canapi; extern crate chrono; @@ -10,7 +10,6 @@ extern crate ctrlc; extern crate diesel; extern crate dotenv; extern crate failure; -extern crate gettextrs; extern crate guid_create; extern crate heck; extern crate multipart; @@ -22,6 +21,7 @@ extern crate plume_models; extern crate rocket; extern crate rocket_contrib; extern crate rocket_csrf; +#[macro_use] extern crate rocket_i18n; extern crate rpassword; extern crate scheduled_thread_pool; @@ -38,7 +38,6 @@ extern crate webfinger; use diesel::r2d2::ConnectionManager; use rocket::State; -use rocket_contrib::Template; use rocket_csrf::CsrfFairingBuilder; use plume_models::{DATABASE_URL, Connection, db_conn::DbPool, search::Searcher as UnmanagedSearcher}; @@ -49,6 +48,8 @@ use std::time::Duration; mod api; mod inbox; +#[macro_use] +mod template_utils; mod routes; type Worker<'a> = State<'a, ScheduledThreadPool>; @@ -77,7 +78,6 @@ fn main() { exit(0); }).expect("Error setting Ctrl-c handler"); - rocket::ignite() .mount("/", routes![ routes::blogs::paginated_details, @@ -140,8 +140,7 @@ fn main() { routes::reshares::create, routes::reshares::create_auth, - routes::search::index, - routes::search::query, + routes::search::search, routes::session::new, routes::session::new_message, @@ -187,17 +186,14 @@ fn main() { api::posts::get, api::posts::list, ]) - .catch(catchers![ + .register(catchers![ routes::errors::not_found, routes::errors::server_error ]) .manage(dbpool) .manage(workpool) .manage(searcher) - .attach(Template::custom(|engines| { - rocket_i18n::tera(&mut engines.tera); - })) - .attach(rocket_i18n::I18n::new("plume")) + .manage(include_i18n!("plume", [ "de", "en", "fr", "gl", "it", "ja", "nb", "pl", "ru" ])) .attach(CsrfFairingBuilder::new() .set_default_target("/csrf-violation?target=".to_owned(), rocket::http::Method::Post) .add_exceptions(vec![ @@ -210,3 +206,5 @@ fn main() { .finalize().expect("main: csrf fairing creation error")) .launch(); } + +include!(concat!(env!("OUT_DIR"), "/templates.rs")); diff --git a/src/routes/blogs.rs b/src/routes/blogs.rs index 1846abd5..0e55c260 100644 --- a/src/routes/blogs.rs +++ b/src/routes/blogs.rs @@ -5,8 +5,7 @@ use rocket::{ request::LenientForm, response::{Redirect, Flash, content::Content} }; -use rocket_contrib::Template; -use serde_json; +use rocket_i18n::I18n; use std::{collections::HashMap, borrow::Cow}; use validator::{Validate, ValidationError, ValidationErrors}; @@ -21,61 +20,62 @@ use plume_models::{ users::User }; use routes::Page; +use template_utils::Ructe; use Searcher; #[get("/~/?", rank = 2)] -fn paginated_details(name: String, conn: DbConn, user: Option, page: Page) -> Template { - may_fail!(user.map(|u| u.to_json(&*conn)), Blog::find_by_fqn(&*conn, &name), "Requested blog couldn't be found", |blog| { - let posts = Post::blog_page(&*conn, &blog, page.limits()); - let articles = Post::get_for_blog(&*conn, &blog); - let authors = &blog.list_authors(&*conn); +pub fn paginated_details(intl: I18n, name: String, conn: DbConn, user: Option, page: Page) -> Result { + let blog = Blog::find_by_fqn(&*conn, &name) + .ok_or_else(|| render!(errors::not_found(&(&*conn, &intl.catalog, user.clone()))))?; + let posts = Post::blog_page(&*conn, &blog, page.limits()); + let articles = Post::get_for_blog(&*conn, &blog); // TODO only count them in DB + let authors = &blog.list_authors(&*conn); - Template::render("blogs/details", json!({ - "blog": &blog.to_json(&*conn), - "account": user.clone().map(|u| u.to_json(&*conn)), - "is_author": user.map(|x| x.is_author_in(&*conn, &blog)), - "posts": posts.into_iter().map(|p| p.to_json(&*conn)).collect::>(), - "authors": authors.into_iter().map(|u| u.to_json(&*conn)).collect::>(), - "n_authors": authors.len(), - "n_articles": articles.len(), - "page": page.page, - "n_pages": Page::total(articles.len() as i32) - })) - }) + Ok(render!(blogs::details( + &(&*conn, &intl.catalog, user.clone()), + blog.clone(), + blog.get_fqn(&*conn), + authors, + articles.len(), + page.0, + Page::total(articles.len() as i32), + user.map(|x| x.is_author_in(&*conn, &blog)).unwrap_or(false), + posts + ))) } #[get("/~/", rank = 3)] -fn details(name: String, conn: DbConn, user: Option) -> Template { - paginated_details(name, conn, user, Page::first()) +pub fn details(intl: I18n, name: String, conn: DbConn, user: Option) -> Result { + paginated_details(intl, name, conn, user, Page::first()) } #[get("/~/", rank = 1)] -fn activity_details(name: String, conn: DbConn, _ap: ApRequest) -> Option> { +pub fn activity_details(name: String, conn: DbConn, _ap: ApRequest) -> Option> { let blog = Blog::find_local(&*conn, &name)?; Some(ActivityStream::new(blog.to_activity(&*conn))) } #[get("/blogs/new")] -fn new(user: User, conn: DbConn) -> Template { - Template::render("blogs/new", json!({ - "account": user.to_json(&*conn), - "errors": null, - "form": null - })) +pub fn new(user: User, conn: DbConn, intl: I18n) -> Ructe { + render!(blogs::new( + &(&*conn, &intl.catalog, Some(user)), + &NewBlogForm::default(), + ValidationErrors::default() + )) } #[get("/blogs/new", rank = 2)] -fn new_auth() -> Flash{ +pub fn new_auth(i18n: I18n) -> Flash{ utils::requires_login( - "You need to be logged in order to create a new blog", + i18n!(i18n.catalog, "You need to be logged in order to create a new blog"), uri!(new) ) } -#[derive(FromForm, Validate, Serialize)] -struct NewBlogForm { +#[derive(Default, FromForm, Validate, Serialize)] +pub struct NewBlogForm { #[validate(custom(function = "valid_slug", message = "Invalid name"))] - pub title: String + pub title: String, } fn valid_slug(title: &str) -> Result<(), ValidationError> { @@ -87,9 +87,8 @@ fn valid_slug(title: &str) -> Result<(), ValidationError> { } } -#[post("/blogs/new", data = "")] -fn create(conn: DbConn, data: LenientForm, user: User) -> Result { - let form = data.get(); +#[post("/blogs/new", data = "
")] +pub fn create(conn: DbConn, form: LenientForm, user: User, intl: I18n) -> Result { let slug = utils::make_actor_id(&form.title); let mut errors = match form.validate() { @@ -121,36 +120,37 @@ fn create(conn: DbConn, data: LenientForm, user: User) -> Result/delete")] -fn delete(conn: DbConn, name: String, user: Option, searcher: Searcher) -> Result>{ +pub fn delete(conn: DbConn, name: String, user: Option, intl: I18n, searcher: Searcher) -> Result>{ let blog = Blog::find_local(&*conn, &name).ok_or(None)?; - if user.map(|u| u.is_author_in(&*conn, &blog)).unwrap_or(false) { + if user.clone().map(|u| u.is_author_in(&*conn, &blog)).unwrap_or(false) { blog.delete(&conn, &searcher); Ok(Redirect::to(uri!(super::instance::index))) } else { - Err(Some(Template::render("errors/403", json!({// TODO actually return 403 error code - "error_message": "You are not allowed to delete this blog." - })))) + // TODO actually return 403 error code + Err(Some(render!(errors::not_authorized( + &(&*conn, &intl.catalog, user), + "You are not allowed to delete this blog." + )))) } } #[get("/~//outbox")] -fn outbox(name: String, conn: DbConn) -> Option> { +pub fn outbox(name: String, conn: DbConn) -> Option> { let blog = Blog::find_local(&*conn, &name)?; Some(blog.outbox(&*conn)) } #[get("/~//atom.xml")] -fn atom_feed(name: String, conn: DbConn) -> Option> { +pub fn atom_feed(name: String, conn: DbConn) -> Option> { let blog = Blog::find_by_fqn(&*conn, &name)?; let feed = FeedBuilder::default() .title(blog.title.clone()) diff --git a/src/routes/comments.rs b/src/routes/comments.rs index 21b2491c..880c06b2 100644 --- a/src/routes/comments.rs +++ b/src/routes/comments.rs @@ -3,9 +3,9 @@ use rocket::{ request::LenientForm, response::Redirect }; -use rocket_contrib::Template; -use serde_json; +use rocket_i18n::I18n; use validator::Validate; +use template_utils::Ructe; use plume_common::{utils, activity_pub::{broadcast, ApRequest, ActivityStream}}; use plume_models::{ @@ -15,24 +15,24 @@ use plume_models::{ mentions::Mention, posts::Post, safe_string::SafeString, + tags::Tag, users::User }; use Worker; -#[derive(FromForm, Debug, Validate, Serialize)] -struct NewCommentForm { +#[derive(Default, FromForm, Debug, Validate, Serialize)] +pub struct NewCommentForm { pub responding_to: Option, #[validate(length(min = "1", message = "Your comment can't be empty"))] pub content: String, pub warning: String, } -#[post("/~///comment", data = "")] -fn create(blog_name: String, slug: String, data: LenientForm, user: User, conn: DbConn, worker: Worker) - -> Result> { +#[post("/~///comment", data = "")] +pub fn create(blog_name: String, slug: String, form: LenientForm, user: User, conn: DbConn, worker: Worker, intl: I18n) + -> Result> { let blog = Blog::find_by_fqn(&*conn, &blog_name).ok_or(None)?; let post = Post::find_by_slug(&*conn, &slug, blog.id).ok_or(None)?; - let form = data.get(); form.validate() .map(|_| { let (html, mentions, _hashtags) = utils::md_to_html(form.content.as_ref()); @@ -62,28 +62,30 @@ fn create(blog_name: String, slug: String, data: LenientForm, us .map_err(|errors| { // TODO: de-duplicate this code let comments = Comment::list_by_post(&*conn, post.id); - let comms = comments.clone(); - Some(Template::render("posts/details", json!({ - "author": post.get_authors(&*conn)[0].to_json(&*conn), - "post": post, - "blog": blog, - "comments": &comments.into_iter().map(|c| c.to_json(&*conn, &comms)).collect::>(), - "n_likes": post.get_likes(&*conn).len(), - "has_liked": user.has_liked(&*conn, &post), - "n_reshares": post.get_reshares(&*conn).len(), - "has_reshared": user.has_reshared(&*conn, &post), - "account": user.to_json(&*conn), - "date": &post.creation_date.timestamp(), - "previous": form.responding_to.and_then(|r| Comment::get(&*conn, r)).map(|r| r.to_json(&*conn, &[])), - "user_fqn": user.get_fqn(&*conn), - "comment_form": form, - "comment_errors": errors, - }))) + let previous = form.responding_to.map(|r| Comment::get(&*conn, r) + .expect("posts::details_reponse: Error retrieving previous comment")); + + Some(render!(posts::details( + &(&*conn, &intl.catalog, Some(user.clone())), + post.clone(), + blog, + &*form, + errors, + Tag::for_post(&*conn, post.id), + comments.into_iter().filter(|c| c.in_response_to_id.is_none()).collect::>(), + previous, + post.get_likes(&*conn).len(), + post.get_reshares(&*conn).len(), + user.has_liked(&*conn, &post), + user.has_reshared(&*conn, &post), + user.is_following(&*conn, post.get_authors(&*conn)[0].id), + post.get_authors(&*conn)[0].clone() + ))) }) } #[get("/~/<_blog>/<_slug>/comment/")] -fn activity_pub(_blog: String, _slug: String, id: i32, _ap: ApRequest, conn: DbConn) -> Option> { +pub fn activity_pub(_blog: String, _slug: String, id: i32, _ap: ApRequest, conn: DbConn) -> Option> { Comment::get(&*conn, id).map(|c| ActivityStream::new(c.to_activity(&*conn))) } diff --git a/src/routes/errors.rs b/src/routes/errors.rs index 8ddf0a02..f450e939 100644 --- a/src/routes/errors.rs +++ b/src/routes/errors.rs @@ -1,40 +1,36 @@ -use rocket_contrib::Template; use rocket::Request; use rocket::request::FromRequest; +use rocket_i18n::I18n; use plume_models::db_conn::DbConn; use plume_models::users::User; +use template_utils::Ructe; #[catch(404)] -fn not_found(req: &Request) -> Template { +pub fn not_found(req: &Request) -> Ructe { let conn = req.guard::().succeeded(); + let intl = req.guard::().succeeded(); let user = User::from_request(req).succeeded(); - Template::render("errors/404", json!({ - "error_message": "Page not found", - "account": user.and_then(|u| conn.map(|conn| u.to_json(&*conn))) - })) + render!(errors::not_found( + &(&*conn.unwrap(), &intl.unwrap().catalog, user) + )) } #[catch(500)] -fn server_error(req: &Request) -> Template { +pub fn server_error(req: &Request) -> Ructe { let conn = req.guard::().succeeded(); + let intl = req.guard::().succeeded(); let user = User::from_request(req).succeeded(); - Template::render("errors/500", json!({ - "error_message": "Server error", - "account": user.and_then(|u| conn.map(|conn| u.to_json(&*conn))) - })) + render!(errors::server_error( + &(&*conn.unwrap(), &intl.unwrap().catalog, user) + )) } -#[derive(FromForm)] -pub struct Uri { - target: String, -} - -#[post("/csrf-violation?")] -fn csrf_violation(uri: Option) -> Template { - if let Some(uri) = uri { - eprintln!("Csrf violation while acceding \"{}\"", uri.target) +#[post("/csrf-violation?")] +pub fn csrf_violation(target: Option, conn: DbConn, intl: I18n, user: Option) -> Ructe { + if let Some(uri) = target { + eprintln!("Csrf violation while acceding \"{}\"", uri) } - Template::render("errors/csrf", json!({ - "error_message":"" - })) + render!(errors::csrf( + &(&*conn, &intl.catalog, user) + )) } diff --git a/src/routes/instance.rs b/src/routes/instance.rs index 24b27f16..013c8cd5 100644 --- a/src/routes/instance.rs +++ b/src/routes/instance.rs @@ -1,8 +1,8 @@ -use gettextrs::gettext; use rocket::{request::LenientForm, response::{status, Redirect}}; -use rocket_contrib::{Json, Template}; +use rocket_contrib::json::Json; +use rocket_i18n::I18n; use serde_json; -use validator::{Validate}; +use validator::{Validate, ValidationErrors}; use plume_common::activity_pub::sign::{Signable, verify_http_headers}; @@ -18,10 +18,11 @@ use plume_models::{ }; use inbox::Inbox; use routes::Page; +use template_utils::Ructe; use Searcher; #[get("/")] -fn index(conn: DbConn, user: Option) -> Template { +pub fn index(conn: DbConn, user: Option, intl: I18n) -> Ructe { match Instance::get_local(&*conn) { Some(inst) => { let federated = Post::get_recents_page(&*conn, Page::first().limits()); @@ -33,101 +34,107 @@ fn index(conn: DbConn, user: Option) -> Template { Post::user_feed_page(&*conn, in_feed, Page::first().limits()) }); - Template::render("instance/index", json!({ - "instance": inst, - "account": user.map(|u| u.to_json(&*conn)), - "federated": federated.into_iter().map(|p| p.to_json(&*conn)).collect::>(), - "local": local.into_iter().map(|p| p.to_json(&*conn)).collect::>(), - "user_feed": user_feed.map(|f| f.into_iter().map(|p| p.to_json(&*conn)).collect::>()), - "n_users": User::count_local(&*conn), - "n_articles": Post::count_local(&*conn) - })) + render!(instance::index( + &(&*conn, &intl.catalog, user), + inst, + User::count_local(&*conn) as i32, + Post::count_local(&*conn) as i32, + local, + federated, + user_feed + )) } None => { - Template::render("errors/500", json!({ - "error_message": gettext("You need to configure your instance before using it.".to_string()) - })) + render!(errors::server_error( + &(&*conn, &intl.catalog, user) + )) } } } #[get("/local?")] -fn paginated_local(conn: DbConn, user: Option, page: Page) -> Template { +pub fn paginated_local(conn: DbConn, user: Option, page: Page, intl: I18n) -> Ructe { let instance = Instance::get_local(&*conn).expect("instance::paginated_local: local instance not found error"); let articles = Post::get_instance_page(&*conn, instance.id, page.limits()); - Template::render("instance/local", json!({ - "account": user.map(|u| u.to_json(&*conn)), - "instance": instance, - "page": page.page, - "n_pages": Page::total(Post::count_local(&*conn) as i32), - "articles": articles.into_iter().map(|p| p.to_json(&*conn)).collect::>() - })) + render!(instance::local( + &(&*conn, &intl.catalog, user), + instance, + articles, + page.0, + Page::total(Post::count_local(&*conn) as i32) + )) } #[get("/local")] -fn local(conn: DbConn, user: Option) -> Template { - paginated_local(conn, user, Page::first()) +pub fn local(conn: DbConn, user: Option, intl: I18n) -> Ructe { + paginated_local(conn, user, Page::first(), intl) } #[get("/feed")] -fn feed(conn: DbConn, user: User) -> Template { - paginated_feed(conn, user, Page::first()) +pub fn feed(conn: DbConn, user: User, intl: I18n) -> Ructe { + paginated_feed(conn, user, Page::first(), intl) } #[get("/feed?")] -fn paginated_feed(conn: DbConn, user: User, page: Page) -> Template { +pub fn paginated_feed(conn: DbConn, user: User, page: Page, intl: I18n) -> Ructe { let followed = user.get_following(&*conn); let mut in_feed = followed.into_iter().map(|u| u.id).collect::>(); in_feed.push(user.id); let articles = Post::user_feed_page(&*conn, in_feed, page.limits()); - Template::render("instance/feed", json!({ - "account": user.to_json(&*conn), - "page": page.page, - "n_pages": Page::total(Post::count_local(&*conn) as i32), - "articles": articles.into_iter().map(|p| p.to_json(&*conn)).collect::>() - })) + render!(instance::feed( + &(&*conn, &intl.catalog, Some(user)), + articles, + page.0, + Page::total(Post::count_local(&*conn) as i32) + )) } #[get("/federated")] -fn federated(conn: DbConn, user: Option) -> Template { - paginated_federated(conn, user, Page::first()) +pub fn federated(conn: DbConn, user: Option, intl: I18n) -> Ructe { + paginated_federated(conn, user, Page::first(), intl) } #[get("/federated?")] -fn paginated_federated(conn: DbConn, user: Option, page: Page) -> Template { +pub fn paginated_federated(conn: DbConn, user: Option, page: Page, intl: I18n) -> Ructe { let articles = Post::get_recents_page(&*conn, page.limits()); - Template::render("instance/federated", json!({ - "account": user.map(|u| u.to_json(&*conn)), - "page": page.page, - "n_pages": Page::total(Post::count_local(&*conn) as i32), - "articles": articles.into_iter().map(|p| p.to_json(&*conn)).collect::>() - })) + render!(instance::federated( + &(&*conn, &intl.catalog, user), + articles, + page.0, + Page::total(Post::count_local(&*conn) as i32) + )) } #[get("/admin")] -fn admin(conn: DbConn, admin: Admin) -> Template { - Template::render("instance/admin", json!({ - "account": admin.0.to_json(&*conn), - "instance": Instance::get_local(&*conn), - "errors": null, - "form": null - })) +pub fn admin(conn: DbConn, admin: Admin, intl: I18n) -> Ructe { + let local_inst = Instance::get_local(&*conn).expect("instance::admin: local instance not found"); + render!(instance::admin( + &(&*conn, &intl.catalog, Some(admin.0)), + local_inst.clone(), + InstanceSettingsForm { + name: local_inst.name.clone(), + open_registrations: local_inst.open_registrations, + short_description: local_inst.short_description, + long_description: local_inst.long_description, + default_license: local_inst.default_license, + }, + ValidationErrors::default() + )) } -#[derive(FromForm, Validate, Serialize)] -struct InstanceSettingsForm { +#[derive(Clone, FromForm, Validate, Serialize)] +pub struct InstanceSettingsForm { #[validate(length(min = "1"))] - name: String, - open_registrations: bool, - short_description: SafeString, - long_description: SafeString, + pub name: String, + pub open_registrations: bool, + pub short_description: SafeString, + pub long_description: SafeString, #[validate(length(min = "1"))] - default_license: String + pub default_license: String } #[post("/admin", data = "")] -fn update_settings(conn: DbConn, admin: Admin, form: LenientForm) -> Result { - let form = form.get(); +pub fn update_settings(conn: DbConn, admin: Admin, form: LenientForm, intl: I18n) -> Result { form.validate() .map(|_| { let instance = Instance::get_local(&*conn).expect("instance::update_settings: local instance not found error"); @@ -138,33 +145,36 @@ fn update_settings(conn: DbConn, admin: Admin, form: LenientForm Template { - admin_instances_paginated(admin, conn, Page::first()) +pub fn admin_instances(admin: Admin, conn: DbConn, intl: I18n) -> Ructe { + admin_instances_paginated(admin, conn, Page::first(), intl) } #[get("/admin/instances?")] -fn admin_instances_paginated(admin: Admin, conn: DbConn, page: Page) -> Template { +pub fn admin_instances_paginated(admin: Admin, conn: DbConn, page: Page, intl: I18n) -> Ructe { let instances = Instance::page(&*conn, page.limits()); - Template::render("instance/list", json!({ - "account": admin.0.to_json(&*conn), - "instances": instances, - "instance": Instance::get_local(&*conn), - "page": page.page, - "n_pages": Page::total(Instance::count(&*conn) as i32), - })) + render!(instance::list( + &(&*conn, &intl.catalog, Some(admin.0)), + Instance::get_local(&*conn).expect("admin_instances: local instance error"), + instances, + page.0, + Page::total(Instance::count(&*conn) as i32) + )) } #[post("/admin/instances//block")] -fn toggle_block(_admin: Admin, conn: DbConn, id: i32) -> Redirect { +pub fn toggle_block(_admin: Admin, conn: DbConn, id: i32) -> Redirect { if let Some(inst) = Instance::get(&*conn, id) { inst.toggle_block(&*conn); } @@ -173,25 +183,22 @@ fn toggle_block(_admin: Admin, conn: DbConn, id: i32) -> Redirect { } #[get("/admin/users")] -fn admin_users(admin: Admin, conn: DbConn) -> Template { - admin_users_paginated(admin, conn, Page::first()) +pub fn admin_users(admin: Admin, conn: DbConn, intl: I18n) -> Ructe { + admin_users_paginated(admin, conn, Page::first(), intl) } #[get("/admin/users?")] -fn admin_users_paginated(admin: Admin, conn: DbConn, page: Page) -> Template { - let users = User::get_local_page(&*conn, page.limits()).into_iter() - .map(|u| u.to_json(&*conn)).collect::>(); - - Template::render("instance/users", json!({ - "account": admin.0.to_json(&*conn), - "users": users, - "page": page.page, - "n_pages": Page::total(User::count_local(&*conn) as i32) - })) +pub fn admin_users_paginated(admin: Admin, conn: DbConn, page: Page, intl: I18n) -> Ructe { + render!(instance::users( + &(&*conn, &intl.catalog, Some(admin.0)), + User::get_local_page(&*conn, page.limits()), + page.0, + Page::total(User::count_local(&*conn) as i32) + )) } #[post("/admin/users//ban")] -fn ban(_admin: Admin, conn: DbConn, id: i32, searcher: Searcher) -> Redirect { +pub fn ban(_admin: Admin, conn: DbConn, id: i32, searcher: Searcher) -> Redirect { if let Some(u) = User::get(&*conn, id) { u.delete(&*conn, &searcher); } @@ -199,7 +206,7 @@ fn ban(_admin: Admin, conn: DbConn, id: i32, searcher: Searcher) -> Redirect { } #[post("/inbox", data = "")] -fn shared_inbox(conn: DbConn, data: String, headers: Headers, searcher: Searcher) -> Result> { +pub fn shared_inbox(conn: DbConn, data: String, headers: Headers, searcher: Searcher) -> Result> { let act: serde_json::Value = serde_json::from_str(&data[..]).expect("instance::shared_inbox: deserialization error"); let activity = act.clone(); @@ -227,7 +234,7 @@ fn shared_inbox(conn: DbConn, data: String, headers: Headers, searcher: Searcher } #[get("/nodeinfo")] -fn nodeinfo(conn: DbConn) -> Json { +pub fn nodeinfo(conn: DbConn) -> Json { Json(json!({ "version": "2.0", "software": { @@ -252,20 +259,19 @@ fn nodeinfo(conn: DbConn) -> Json { } #[get("/about")] -fn about(user: Option, conn: DbConn) -> Template { - Template::render("instance/about", json!({ - "account": user.map(|u| u.to_json(&*conn)), - "instance": Instance::get_local(&*conn), - "admin": Instance::get_local(&*conn).map(|i| i.main_admin(&*conn).to_json(&*conn)), - "version": env!("CARGO_PKG_VERSION"), - "n_users": User::count_local(&*conn), - "n_articles": Post::count_local(&*conn), - "n_instances": Instance::count(&*conn) - 1 - })) +pub fn about(user: Option, conn: DbConn, intl: I18n) -> Ructe { + render!(instance::about( + &(&*conn, &intl.catalog, user), + Instance::get_local(&*conn).expect("Local instance not found"), + Instance::get_local(&*conn).expect("Local instance not found").main_admin(&*conn), + User::count_local(&*conn), + Post::count_local(&*conn), + Instance::count(&*conn) - 1 + )) } #[get("/manifest.json")] -fn web_manifest(conn: DbConn) -> Json { +pub fn web_manifest(conn: DbConn) -> Json { let instance = Instance::get_local(&*conn).expect("instance::web_manifest: local instance not found error"); Json(json!({ "name": &instance.name, diff --git a/src/routes/likes.rs b/src/routes/likes.rs index c94e1ee2..be08e645 100644 --- a/src/routes/likes.rs +++ b/src/routes/likes.rs @@ -1,4 +1,5 @@ -use rocket::{response::{Redirect, Flash}}; +use rocket::response::{Redirect, Flash}; +use rocket_i18n::I18n; use plume_common::activity_pub::{broadcast, inbox::{Notify, Deletable}}; use plume_common::utils; @@ -12,7 +13,7 @@ use plume_models::{ use Worker; #[post("/~///like")] -fn create(blog: String, slug: String, user: User, conn: DbConn, worker: Worker) -> Option { +pub fn create(blog: String, slug: String, user: User, conn: DbConn, worker: Worker) -> Option { let b = Blog::find_by_fqn(&*conn, &blog)?; let post = Post::find_by_slug(&*conn, &slug, b.id)?; @@ -39,9 +40,9 @@ fn create(blog: String, slug: String, user: User, conn: DbConn, worker: Worker) } #[post("/~///like", rank = 2)] -fn create_auth(blog: String, slug: String) -> Flash{ +pub fn create_auth(blog: String, slug: String, i18n: I18n) -> Flash{ utils::requires_login( - "You need to be logged in order to like a post", + i18n!(i18n.catalog, "You need to be logged in order to like a post"), uri!(create: blog = blog, slug = slug) ) } diff --git a/src/routes/medias.rs b/src/routes/medias.rs index 761c8d9a..79703fd2 100644 --- a/src/routes/medias.rs +++ b/src/routes/medias.rs @@ -1,31 +1,29 @@ use guid_create::GUID; use multipart::server::{Multipart, save::{SavedData, SaveResult}}; use rocket::{Data, http::ContentType, response::{Redirect, status}}; -use rocket_contrib::Template; -use serde_json; +use rocket_i18n::I18n; use std::fs; use plume_models::{db_conn::DbConn, medias::*, users::User}; +use template_utils::Ructe; #[get("/medias")] -fn list(user: User, conn: DbConn) -> Template { +pub fn list(user: User, conn: DbConn, intl: I18n) -> Ructe { let medias = Media::for_user(&*conn, user.id); - Template::render("medias/index", json!({ - "account": user.to_json(&*conn), - "medias": medias.into_iter().map(|m| m.to_json(&*conn)).collect::>() - })) + render!(medias::index( + &(&*conn, &intl.catalog, Some(user)), + medias + )) } #[get("/medias/new")] -fn new(user: User, conn: DbConn) -> Template { - Template::render("medias/new", json!({ - "account": user.to_json(&*conn), - "form": {}, - "errors": {} - })) +pub fn new(user: User, conn: DbConn, intl: I18n) -> Ructe { + render!(medias::new( + &(&*conn, &intl.catalog, Some(user)) + )) } #[post("/medias/new", data = "")] -fn upload(user: User, data: Data, ct: &ContentType, conn: DbConn) -> Result> { +pub fn upload(user: User, data: Data, ct: &ContentType, conn: DbConn) -> Result> { if ct.is_form_data() { let (_, boundary) = ct.params().find(|&(k, _)| k == "boundary").ok_or_else(|| status::BadRequest(Some("No boundary")))?; @@ -86,23 +84,23 @@ fn read(data: &SavedData) -> String { } #[get("/medias/")] -fn details(id: i32, user: User, conn: DbConn) -> Template { - let media = Media::get(&*conn, id); - Template::render("medias/details", json!({ - "account": user.to_json(&*conn), - "media": media.map(|m| m.to_json(&*conn)) - })) +pub fn details(id: i32, user: User, conn: DbConn, intl: I18n) -> Ructe { + let media = Media::get(&*conn, id).expect("Media::details: media not found"); + render!(medias::details( + &(&*conn, &intl.catalog, Some(user)), + media + )) } #[post("/medias//delete")] -fn delete(id: i32, _user: User, conn: DbConn) -> Option { +pub fn delete(id: i32, _user: User, conn: DbConn) -> Option { let media = Media::get(&*conn, id)?; media.delete(&*conn); Some(Redirect::to(uri!(list))) } #[post("/medias//avatar")] -fn set_avatar(id: i32, user: User, conn: DbConn) -> Option { +pub fn set_avatar(id: i32, user: User, conn: DbConn) -> Option { let media = Media::get(&*conn, id)?; user.set_avatar(&*conn, media.id); Some(Redirect::to(uri!(details: id = id))) diff --git a/src/routes/mod.rs b/src/routes/mod.rs index a0167d11..df283a93 100644 --- a/src/routes/mod.rs +++ b/src/routes/mod.rs @@ -1,70 +1,23 @@ use atom_syndication::{ContentBuilder, Entry, EntryBuilder, LinkBuilder, Person, PersonBuilder}; use rocket::{ - http::{RawStr, - uri::{FromUriParam, UriDisplay}}, + http::RawStr, request::FromFormValue, - response::NamedFile -}; -use std::{ - fmt, - path::{Path, PathBuf} + response::NamedFile, }; +use std::path::{Path, PathBuf}; use plume_models::{Connection, posts::Post}; -macro_rules! may_fail { - ($account:expr, $expr:expr, $template:expr, $msg:expr, | $res:ident | $block:block) => { - { - let res = $expr; - if res.is_some() { - let $res = res.unwrap(); - $block - } else { - Template::render(concat!("errors/", $template), json!({ - "error_message": $msg, - "account": $account - })) - } - } - }; - ($account:expr, $expr:expr, $msg:expr, | $res:ident | $block:block) => { - may_fail!($account, $expr, "404", $msg, |$res| { - $block - }) - }; - ($account:expr, $expr:expr, | $res:ident | $block:block) => { - may_fail!($account, $expr, "", |$res| { - $block - }) - }; -} - const ITEMS_PER_PAGE: i32 = 12; -#[derive(FromForm)] -pub struct Page { - page: i32 -} - -impl UriDisplay for Page { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - write!(f, "page={}", &self.page as &UriDisplay) - } -} - -impl FromUriParam for Page { - type Target = Page; - fn from_uri_param(num: i32) -> Page { - Page { page: num } - } -} +#[derive(Copy, Clone)] +pub struct Page(i32); impl<'v> FromFormValue<'v> for Page { type Error = &'v RawStr; - fn from_form_value(form_value: &'v RawStr) -> Result { match form_value.parse::() { - Ok(page) => Ok(Page{page}), + Ok(page) => Ok(Page(page)), _ => Err(form_value), } } @@ -72,9 +25,7 @@ impl<'v> FromFormValue<'v> for Page { impl Page { pub fn first() -> Page { - Page { - page: 1 - } + Page(1) } /// Computes the total number of pages needed to display n_items @@ -87,7 +38,7 @@ impl Page { } pub fn limits(&self) -> (i32, i32) { - ((self.page - 1) * ITEMS_PER_PAGE, self.page * ITEMS_PER_PAGE) + ((self.0 - 1) * ITEMS_PER_PAGE, self.0 * ITEMS_PER_PAGE) } } @@ -126,6 +77,6 @@ pub mod search; pub mod well_known; #[get("/static/", rank = 2)] -fn static_files(file: PathBuf) -> Option { +pub fn static_files(file: PathBuf) -> Option { NamedFile::open(Path::new("static/").join(file)).ok() } diff --git a/src/routes/notifications.rs b/src/routes/notifications.rs index ffdd7149..1c75877f 100644 --- a/src/routes/notifications.rs +++ b/src/routes/notifications.rs @@ -1,29 +1,30 @@ use rocket::response::{Redirect, Flash}; -use rocket_contrib::Template; +use rocket_i18n::I18n; use plume_common::utils; use plume_models::{db_conn::DbConn, notifications::Notification, users::User}; use routes::Page; +use template_utils::Ructe; #[get("/notifications?")] -fn paginated_notifications(conn: DbConn, user: User, page: Page) -> Template { - Template::render("notifications/index", json!({ - "account": user.to_json(&*conn), - "notifications": Notification::page_for_user(&*conn, &user, page.limits()).into_iter().map(|n| n.to_json(&*conn)).collect::>(), - "page": page.page, - "n_pages": Page::total(Notification::find_for_user(&*conn, &user).len() as i32) - })) +pub fn paginated_notifications(conn: DbConn, user: User, page: Page, intl: I18n) -> Ructe { + render!(notifications::index( + &(&*conn, &intl.catalog, Some(user.clone())), + Notification::page_for_user(&*conn, &user, page.limits()), + page.0, + Page::total(Notification::find_for_user(&*conn, &user).len() as i32) + )) } #[get("/notifications")] -fn notifications(conn: DbConn, user: User) -> Template { - paginated_notifications(conn, user, Page::first()) +pub fn notifications(conn: DbConn, user: User, intl: I18n) -> Ructe { + paginated_notifications(conn, user, Page::first(), intl) } #[get("/notifications", rank = 2)] -fn notifications_auth() -> Flash{ +pub fn notifications_auth(i18n: I18n) -> Flash{ utils::requires_login( - "You need to be logged in order to see your notifications", + i18n!(i18n.catalog, "You need to be logged in order to see your notifications"), uri!(notifications) ) } diff --git a/src/routes/posts.rs b/src/routes/posts.rs index 4c9bdb8d..5ec78ca6 100644 --- a/src/routes/posts.rs +++ b/src/routes/posts.rs @@ -1,10 +1,9 @@ use activitypub::object::Article; use chrono::Utc; use heck::{CamelCase, KebabCase}; -use rocket::{request::LenientForm}; +use rocket::request::LenientForm; use rocket::response::{Redirect, Flash}; -use rocket_contrib::Template; -use serde_json; +use rocket_i18n::I18n; use std::{collections::{HashMap, HashSet}, borrow::Cow}; use validator::{Validate, ValidationError, ValidationErrors}; @@ -23,66 +22,74 @@ use plume_models::{ tags::*, users::User }; +use routes::comments::NewCommentForm; +use template_utils::Ructe; use Worker; use Searcher; -#[derive(FromForm)] -struct CommentQuery { - responding_to: Option -} - // See: https://github.com/SergioBenitez/Rocket/pull/454 -#[get("/~//", rank = 4)] -fn details(blog: String, slug: String, conn: DbConn, user: Option) -> Template { - details_response(blog, slug, conn, user, None) +#[get("/~//", rank = 5)] +pub fn details(blog: String, slug: String, conn: DbConn, user: Option, intl: I18n) -> Result { + details_response(blog, slug, conn, user, None, intl) } -#[get("/~//?")] -fn details_response(blog: String, slug: String, conn: DbConn, user: Option, query: Option) -> Template { - may_fail!(user.map(|u| u.to_json(&*conn)), Blog::find_by_fqn(&*conn, &blog), "Couldn't find this blog", |blog| { - may_fail!(user.map(|u| u.to_json(&*conn)), Post::find_by_slug(&*conn, &slug, blog.id), "Couldn't find this post", |post| { - if post.published || post.get_authors(&*conn).into_iter().any(|a| a.id == user.clone().map(|u| u.id).unwrap_or(0)) { - let comments = Comment::list_by_post(&*conn, post.id); - let comms = comments.clone(); +#[get("/~//?", rank = 4)] +pub fn details_response(blog: String, slug: String, conn: DbConn, user: Option, responding_to: Option, intl: I18n) -> Result { + let blog = Blog::find_by_fqn(&*conn, &blog).ok_or_else(|| render!(errors::not_found(&(&*conn, &intl.catalog, user.clone()))))?; + let post = Post::find_by_slug(&*conn, &slug, blog.id).ok_or_else(|| render!(errors::not_found(&(&*conn, &intl.catalog, user.clone()))))?; + if post.published || post.get_authors(&*conn).into_iter().any(|a| a.id == user.clone().map(|u| u.id).unwrap_or(0)) { + let comments = Comment::list_by_post(&*conn, post.id); - let previous = query.and_then(|q| q.responding_to.map(|r| Comment::get(&*conn, r) - .expect("posts::details_reponse: Error retrieving previous comment").to_json(&*conn, &[]))); - Template::render("posts/details", json!({ - "author": post.get_authors(&*conn)[0].to_json(&*conn), - "article": post.to_json(&*conn), - "blog": blog.to_json(&*conn), - "comments": &comments.into_iter().filter_map(|c| if c.in_response_to_id.is_none() { - Some(c.to_json(&*conn, &comms)) - } else { - None - }).collect::>(), - "n_likes": post.get_likes(&*conn).len(), - "has_liked": user.clone().map(|u| u.has_liked(&*conn, &post)).unwrap_or(false), - "n_reshares": post.get_reshares(&*conn).len(), - "has_reshared": user.clone().map(|u| u.has_reshared(&*conn, &post)).unwrap_or(false), - "account": &user.clone().map(|u| u.to_json(&*conn)), - "date": &post.creation_date.timestamp(), - "previous": previous, - "default": { - "warning": previous.map(|p| p["spoiler_text"].clone()) - }, - "user_fqn": user.clone().map(|u| u.get_fqn(&*conn)).unwrap_or_default(), - "is_author": user.clone().map(|u| post.get_authors(&*conn).into_iter().any(|a| u.id == a.id)).unwrap_or(false), - "is_following": user.map(|u| u.is_following(&*conn, post.get_authors(&*conn)[0].id)).unwrap_or(false), - "comment_form": null, - "comment_errors": null, - })) - } else { - Template::render("errors/403", json!({ - "error_message": "This post isn't published yet." - })) - } - }) - }) + let previous = responding_to.map(|r| Comment::get(&*conn, r) + .expect("posts::details_reponse: Error retrieving previous comment")); + + Ok(render!(posts::details( + &(&*conn, &intl.catalog, user.clone()), + post.clone(), + blog, + &NewCommentForm { + warning: previous.clone().map(|p| p.spoiler_text).unwrap_or_default(), + content: previous.clone().map(|p| format!( + "@{} {}", + p.get_author(&*conn).get_fqn(&*conn), + Mention::list_for_comment(&*conn, p.id) + .into_iter() + .filter_map(|m| { + let user = user.clone(); + if let Some(mentioned) = m.get_mentioned(&*conn) { + if user.is_none() || mentioned.id != user.expect("posts::details_response: user error while listing mentions").id { + Some(format!("@{}", mentioned.get_fqn(&*conn))) + } else { + None + } + } else { + None + } + }).collect::>().join(" ")) + ).unwrap_or_default(), + ..NewCommentForm::default() + }, + ValidationErrors::default(), + Tag::for_post(&*conn, post.id), + comments.into_iter().filter(|c| c.in_response_to_id.is_none()).collect::>(), + previous, + post.get_likes(&*conn).len(), + post.get_reshares(&*conn).len(), + user.clone().map(|u| u.has_liked(&*conn, &post)).unwrap_or(false), + user.clone().map(|u| u.has_reshared(&*conn, &post)).unwrap_or(false), + user.map(|u| u.is_following(&*conn, post.get_authors(&*conn)[0].id)).unwrap_or(false), + post.get_authors(&*conn)[0].clone() + ))) + } else { + Err(render!(errors::not_authorized( + &(&*conn, &intl.catalog, user.clone()), + "This post isn't published yet." + ))) + } } #[get("/~//", rank = 3)] -fn activity_details(blog: String, slug: String, conn: DbConn, _ap: ApRequest) -> Result, Option> { +pub fn activity_details(blog: String, slug: String, conn: DbConn, _ap: ApRequest) -> Result, Option> { let blog = Blog::find_by_fqn(&*conn, &blog).ok_or(None)?; let post = Post::find_by_slug(&*conn, &slug, blog.id).ok_or(None)?; if post.published { @@ -93,44 +100,47 @@ fn activity_details(blog: String, slug: String, conn: DbConn, _ap: ApRequest) -> } #[get("/~//new", rank = 2)] -fn new_auth(blog: String) -> Flash { +pub fn new_auth(blog: String, i18n: I18n) -> Flash { utils::requires_login( - "You need to be logged in order to write a new post", + i18n!(i18n.catalog, "You need to be logged in order to write a new post"), uri!(new: blog = blog) ) } #[get("/~//new", rank = 1)] -fn new(blog: String, user: User, conn: DbConn) -> Option