anki/rslib/cargo/BUILD.bazel
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

491 lines
7.7 KiB
Python

"""
@generated
cargo-raze generated Bazel file.
DO NOT EDIT! Replaced on runs of cargo-raze
"""
package(default_visibility = ["//visibility:public"])
licenses([
"notice", # See individual crates for specific licenses
])
# Aliased targets
alias(
name = "ammonia",
actual = "@raze__ammonia__3_1_1//:ammonia",
tags = [
"cargo-raze",
"manual",
],
)
alias(
name = "askama",
actual = "@raze__askama__0_10_5//:askama",
tags = [
"cargo-raze",
"manual",
],
)
alias(
name = "async_compression",
actual = "@raze__async_compression__0_3_7//:async_compression",
tags = [
"cargo-raze",
"manual",
],
)
alias(
name = "async_trait",
actual = "@raze__async_trait__0_1_48//:async_trait",
tags = [
"cargo-raze",
"manual",
],
)
alias(
name = "blake3",
actual = "@raze__blake3__0_3_7//:blake3",
tags = [
"cargo-raze",
"manual",
],
)
alias(
name = "bytes",
actual = "@raze__bytes__0_5_6//:bytes",
tags = [
"cargo-raze",
"manual",
],
)
alias(
name = "chrono",
actual = "@raze__chrono__0_4_19//:chrono",
tags = [
"cargo-raze",
"manual",
],
)
alias(
name = "coarsetime",
actual = "@raze__coarsetime__0_1_18//:coarsetime",
tags = [
"cargo-raze",
"manual",
],
)
alias(
name = "env_logger",
actual = "@raze__env_logger__0_8_3//:env_logger",
tags = [
"cargo-raze",
"manual",
],
)
alias(
name = "failure",
actual = "@raze__failure__0_1_8//:failure",
tags = [
"cargo-raze",
"manual",
],
)
alias(
name = "flate2",
actual = "@raze__flate2__1_0_20//:flate2",
tags = [
"cargo-raze",
"manual",
],
)
alias(
name = "fluent",
actual = "@raze__fluent__0_13_1//:fluent",
tags = [
"cargo-raze",
"manual",
],
)
alias(
name = "fluent_syntax",
actual = "@raze__fluent_syntax__0_10_3//:fluent_syntax",
tags = [
"cargo-raze",
"manual",
],
)
alias(
name = "fnv",
actual = "@raze__fnv__1_0_7//:fnv",
tags = [
"cargo-raze",
"manual",
],
)
alias(
name = "futures",
actual = "@raze__futures__0_3_13//:futures",
tags = [
"cargo-raze",
"manual",
],
)
alias(
name = "hex",
actual = "@raze__hex__0_4_3//:hex",
tags = [
"cargo-raze",
"manual",
],
)
alias(
name = "htmlescape",
actual = "@raze__htmlescape__0_3_1//:htmlescape",
tags = [
"cargo-raze",
"manual",
],
)
alias(
name = "intl_memoizer",
actual = "@raze__intl_memoizer__0_5_1//:intl_memoizer",
tags = [
"cargo-raze",
"manual",
],
)
alias(
name = "itertools",
actual = "@raze__itertools__0_9_0//:itertools",
tags = [
"cargo-raze",
"manual",
],
)
alias(
name = "lazy_static",
actual = "@raze__lazy_static__1_4_0//:lazy_static",
tags = [
"cargo-raze",
"manual",
],
)
alias(
name = "nom",
actual = "@raze__nom__6_1_2//:nom",
tags = [
"cargo-raze",
"manual",
],
)
alias(
name = "num_integer",
actual = "@raze__num_integer__0_1_44//:num_integer",
tags = [
"cargo-raze",
"manual",
],
)
alias(
name = "num_enum",
actual = "@raze__num_enum__0_5_1//:num_enum",
tags = [
"cargo-raze",
"manual",
],
)
alias(
name = "once_cell",
actual = "@raze__once_cell__1_7_2//:once_cell",
tags = [
"cargo-raze",
"manual",
],
)
alias(
name = "pin_project",
actual = "@raze__pin_project__1_0_5//:pin_project",
tags = [
"cargo-raze",
"manual",
],
)
alias(
name = "proc_macro_nested",
actual = "@raze__proc_macro_nested__0_1_6//:proc_macro_nested",
tags = [
"cargo-raze",
"manual",
],
)
alias(
name = "prost",
actual = "@raze__prost__0_7_0//:prost",
tags = [
"cargo-raze",
"manual",
],
)
alias(
name = "prost_build",
actual = "@raze__prost_build__0_7_0//:prost_build",
tags = [
"cargo-raze",
"manual",
],
)
alias(
name = "pulldown_cmark",
actual = "@raze__pulldown_cmark__0_8_0//:pulldown_cmark",
tags = [
"cargo-raze",
"manual",
],
)
alias(
name = "rand",
actual = "@raze__rand__0_7_3//:rand",
tags = [
"cargo-raze",
"manual",
],
)
alias(
name = "regex",
actual = "@raze__regex__1_4_3//:regex",
tags = [
"cargo-raze",
"manual",
],
)
alias(
name = "reqwest",
actual = "@raze__reqwest__0_10_8//:reqwest",
tags = [
"cargo-raze",
"manual",
],
)
alias(
name = "rusqlite",
actual = "@raze__rusqlite__0_24_2//:rusqlite",
tags = [
"cargo-raze",
"manual",
],
)
alias(
name = "scopeguard",
actual = "@raze__scopeguard__1_1_0//:scopeguard",
tags = [
"cargo-raze",
"manual",
],
)
alias(
name = "serde",
actual = "@raze__serde__1_0_124//:serde",
tags = [
"cargo-raze",
"manual",
],
)
alias(
name = "serde_aux",
actual = "@raze__serde_aux__0_6_1//:serde_aux",
tags = [
"cargo-raze",
"manual",
],
)
alias(
name = "serde_derive",
actual = "@raze__serde_derive__1_0_124//:serde_derive",
tags = [
"cargo-raze",
"manual",
],
)
alias(
name = "serde_json",
actual = "@raze__serde_json__1_0_64//:serde_json",
tags = [
"cargo-raze",
"manual",
],
)
alias(
name = "serde_repr",
actual = "@raze__serde_repr__0_1_6//:serde_repr",
tags = [
"cargo-raze",
"manual",
],
)
alias(
name = "serde_tuple",
actual = "@raze__serde_tuple__0_5_0//:serde_tuple",
tags = [
"cargo-raze",
"manual",
],
)
alias(
name = "sha1",
actual = "@raze__sha1__0_6_0//:sha1",
tags = [
"cargo-raze",
"manual",
],
)
alias(
name = "slog",
actual = "@raze__slog__2_7_0//:slog",
tags = [
"cargo-raze",
"manual",
],
)
alias(
name = "slog_async",
actual = "@raze__slog_async__2_6_0//:slog_async",
tags = [
"cargo-raze",
"manual",
],
)
alias(
name = "slog_envlogger",
actual = "@raze__slog_envlogger__2_2_0//:slog_envlogger",
tags = [
"cargo-raze",
"manual",
],
)
alias(
name = "slog_term",
actual = "@raze__slog_term__2_6_0//:slog_term",
tags = [
"cargo-raze",
"manual",
],
)
alias(
name = "strum",
actual = "@raze__strum__0_20_0//:strum",
tags = [
"cargo-raze",
"manual",
],
)
alias(
name = "tempfile",
actual = "@raze__tempfile__3_2_0//:tempfile",
tags = [
"cargo-raze",
"manual",
],
)
alias(
name = "tokio",
actual = "@raze__tokio__0_2_25//:tokio",
tags = [
"cargo-raze",
"manual",
],
)
alias(
name = "unic_langid",
actual = "@raze__unic_langid__0_9_0//:unic_langid",
tags = [
"cargo-raze",
"manual",
],
)
alias(
name = "unicase",
actual = "@raze__unicase__2_6_0//:unicase",
tags = [
"cargo-raze",
"manual",
],
)
alias(
name = "unicode_normalization",
actual = "@raze__unicode_normalization__0_1_17//:unicode_normalization",
tags = [
"cargo-raze",
"manual",
],
)
alias(
name = "utime",
actual = "@raze__utime__0_3_1//:utime",
tags = [
"cargo-raze",
"manual",
],
)
alias(
name = "zip",
actual = "@raze__zip__0_5_6//:zip",
tags = [
"cargo-raze",
"manual",
],
)