anki/rslib/Cargo.toml
Damien Elmes 9aece2a7b8 rework translation handling
Instead of generating a fluent.proto file with a giant enum, create
a .json file representing the translations that downstream consumers
can use for code generation.

This enables the generation of a separate method for each translation,
with a docstring that shows the actual text, and any required arguments
listed in the function signature.

The codebase is still using the old enum for now; updating it will need
to come in future commits, and the old enum will need to be kept
around, as add-ons are referencing it.

Other changes:

- move translation code into a separate crate
- store the translations on a per-file/module basis, which will allow
us to avoid sending 1000+ strings on each JS page load in the future
- drop the undocumented support for external .ftl files, that we weren't
using
- duplicate strings in translation files are now checked for at build
time
- fix i18n test failing when run outside Bazel
- drop slog dependency in i18n module
2021-03-26 09:41:32 +10:00

89 lines
2.2 KiB
TOML

[package]
name = "anki"
version = "0.0.0"
edition = "2018"
authors = ["Ankitects Pty Ltd and contributors"]
license = "AGPL-3.0-or-later"
description = "Anki's Rust library code"
build = "build/main.rs"
[lib]
name = "anki"
path = "src/lib.rs"
# After updating anything below, run ../cargo/update.py
[build-dependencies]
fluent-syntax = "0.10"
prost-build = "0.7"
[dev-dependencies]
env_logger = "0.8.1"
[dependencies]
# pinned as any changes could invalidate sqlite indexes
unicase = "=2.6.0"
# transitive dependency; 0.1.7 is currently broken on Windows (perhaps
# only in Bazel)
proc-macro-nested = "=0.1.6"
# slog-term 2.7+ depends on term 0.7.0, which is currently broken on Windows,
# as cargo-raze doesn't seem to be included the rustversion crate.
slog-term = "=2.6.0"
anki_i18n = { path = "i18n" }
askama = "0.10.1"
async-compression = { version = "0.3.5", features = ["stream", "gzip"] }
blake3 = "0.3.5"
bytes = "0.5.5"
chrono = "0.4.13"
coarsetime = "0.1.16"
failure = "0.1.8"
flate2 = "1.0.16"
fluent = "0.13.1"
futures = "0.3.5"
hex = "0.4.2"
htmlescape = "0.3.1"
intl-memoizer = "0.5"
itertools = "0.9.0"
lazy_static = "1.4.0"
nom = "6.0.1"
num_enum = "0.5.0"
num-integer = "0.1.43"
once_cell = "1.4.1"
pin-project = "1"
prost = "0.7"
rand = "0.7.3"
regex = "1.3.9"
reqwest = { git = "https://github.com/ankitects/reqwest.git", tag = "anki-2020-11-03", default-features = false, features = [
"json",
"socks",
"stream",
"rustls-tls",
"native-tls",
] }
rusqlite = { version = "0.24.1", features = ["trace", "functions", "collation", "bundled"] }
scopeguard = "1.1.0"
serde = "1.0.114"
serde_derive = "1.0.114"
serde_json = "1.0.56"
serde_repr = "0.1.6"
serde_tuple = "0.5.0"
serde-aux = "0.6.1"
sha1 = "0.6.0"
slog = { version = "2.5.2", features = ["max_level_trace", "release_max_level_debug"] }
slog-async = "2.5.0"
slog-envlogger = "2.2.0"
tempfile = "3.1.0"
tokio = { version = "0.2.21", features = ["fs", "rt-threaded"] }
unic-langid = { version = "0.9", features = ["macros"] }
unicode-normalization = "0.1.13"
utime = "0.3.1"
zip = { version = "0.5.6", default-features = false, features = ["deflate", "time"] }
async-trait = "0.1.42"
ammonia = "3.1.0"
pulldown-cmark = "0.8.0"
fnv = "1.0.7"
strum = { version = "0.20.0", features = ["derive"] }