mirror of
https://github.com/ankitects/anki.git
synced 2025-12-10 21:36:55 -05:00
update to latest Fluent
This commit is contained in:
parent
3433c02242
commit
e4002d7a5e
24 changed files with 566 additions and 226 deletions
99
Cargo.lock
generated
99
Cargo.lock
generated
|
|
@ -1,5 +1,15 @@
|
|||
# This file is automatically @generated by Cargo.
|
||||
# It is not intended for manual editing.
|
||||
[[package]]
|
||||
name = "Inflector"
|
||||
version = "0.11.4"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "fe438c63458706e03479442743baae6c88256498e6431708f6dfc520a26515d3"
|
||||
dependencies = [
|
||||
"lazy_static",
|
||||
"regex",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "addr2line"
|
||||
version = "0.14.1"
|
||||
|
|
@ -62,7 +72,7 @@ dependencies = [
|
|||
"failure",
|
||||
"flate2",
|
||||
"fluent",
|
||||
"fluent-syntax",
|
||||
"fluent-bundle",
|
||||
"fnv",
|
||||
"futures",
|
||||
"hex",
|
||||
|
|
@ -110,6 +120,7 @@ name = "anki_i18n"
|
|||
version = "0.0.0"
|
||||
dependencies = [
|
||||
"fluent",
|
||||
"fluent-bundle",
|
||||
"fluent-syntax",
|
||||
"inflections",
|
||||
"intl-memoizer",
|
||||
|
|
@ -592,9 +603,9 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "fluent"
|
||||
version = "0.13.1"
|
||||
version = "0.15.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "ef9e54ec7b674ae3477d948ae790e90ae24d54fb31c2e7173252978d9b09bdfa"
|
||||
checksum = "bc4d7142005e2066e4844caf9f271b93fc79836ee96ec85057b8c109687e629a"
|
||||
dependencies = [
|
||||
"fluent-bundle",
|
||||
"unic-langid",
|
||||
|
|
@ -602,15 +613,16 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "fluent-bundle"
|
||||
version = "0.13.2"
|
||||
version = "0.15.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "092ebd50cd3f8a6d664bf156e3550d2f7232fbe446da6707d727cca53f707ce2"
|
||||
checksum = "5b589dfaa7e69ddf497be48cd0d184d7ff6e2cbb8186d1bb01c26d5cf5449a17"
|
||||
dependencies = [
|
||||
"fluent-langneg",
|
||||
"fluent-syntax",
|
||||
"intl-memoizer",
|
||||
"intl_pluralrules",
|
||||
"rental",
|
||||
"ouroboros",
|
||||
"rustc-hash",
|
||||
"smallvec",
|
||||
"unic-langid",
|
||||
]
|
||||
|
|
@ -626,9 +638,12 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "fluent-syntax"
|
||||
version = "0.10.3"
|
||||
version = "0.11.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "784f660373ea898f712a7e67b43f35bf79608d46112747c29767d087611d716b"
|
||||
checksum = "c0abed97648395c902868fee9026de96483933faa54ea3b40d652f7dfe61ca78"
|
||||
dependencies = [
|
||||
"thiserror",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "fnv"
|
||||
|
|
@ -1514,6 +1529,29 @@ dependencies = [
|
|||
"vcpkg",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "ouroboros"
|
||||
version = "0.8.3"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "5f6d5c203fe8d786d9d7bec8203cbbff3eb2cf8410c0d70cfd05b3d5f5d545da"
|
||||
dependencies = [
|
||||
"ouroboros_macro",
|
||||
"stable_deref_trait",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "ouroboros_macro"
|
||||
version = "0.8.3"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "129943a960e6a08c7e70ca5a09f113c273fe7f10ae8420992c78293e3dffdf65"
|
||||
dependencies = [
|
||||
"Inflector",
|
||||
"proc-macro-error",
|
||||
"proc-macro2",
|
||||
"quote",
|
||||
"syn",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "parking_lot"
|
||||
version = "0.11.1"
|
||||
|
|
@ -1699,6 +1737,30 @@ dependencies = [
|
|||
"toml",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "proc-macro-error"
|
||||
version = "1.0.4"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "da25490ff9892aab3fcf7c36f08cfb902dd3e71ca0f9f9517bea02a73a5ce38c"
|
||||
dependencies = [
|
||||
"proc-macro-error-attr",
|
||||
"proc-macro2",
|
||||
"quote",
|
||||
"syn",
|
||||
"version_check",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "proc-macro-error-attr"
|
||||
version = "1.0.4"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "a1be40180e52ecc98ad80b184934baf3d0d29f979574e439af5a55274b35f869"
|
||||
dependencies = [
|
||||
"proc-macro2",
|
||||
"quote",
|
||||
"version_check",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "proc-macro-hack"
|
||||
version = "0.5.19"
|
||||
|
|
@ -1981,27 +2043,6 @@ dependencies = [
|
|||
"winapi 0.3.9",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "rental"
|
||||
version = "0.5.5"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "8545debe98b2b139fb04cad8618b530e9b07c152d99a5de83c860b877d67847f"
|
||||
dependencies = [
|
||||
"rental-impl",
|
||||
"stable_deref_trait",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "rental-impl"
|
||||
version = "0.5.5"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "475e68978dc5b743f2f40d8e0a8fdc83f1c5e78cbf4b8fa5e74e73beebc340de"
|
||||
dependencies = [
|
||||
"proc-macro2",
|
||||
"quote",
|
||||
"syn",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "reqwest"
|
||||
version = "0.10.8"
|
||||
|
|
|
|||
100
cargo/crates.bzl
100
cargo/crates.bzl
|
|
@ -11,6 +11,16 @@ load("@bazel_tools//tools/build_defs/repo:utils.bzl", "maybe") # buildifier: di
|
|||
|
||||
def raze_fetch_remote_crates():
|
||||
"""This function defines a collection of repos and should be called in a WORKSPACE file"""
|
||||
maybe(
|
||||
http_archive,
|
||||
name = "raze__Inflector__0_11_4",
|
||||
url = "https://crates.io/api/v1/crates/Inflector/0.11.4/download",
|
||||
type = "tar.gz",
|
||||
sha256 = "fe438c63458706e03479442743baae6c88256498e6431708f6dfc520a26515d3",
|
||||
strip_prefix = "Inflector-0.11.4",
|
||||
build_file = Label("//cargo/remote:BUILD.Inflector-0.11.4.bazel"),
|
||||
)
|
||||
|
||||
maybe(
|
||||
http_archive,
|
||||
name = "raze__addr2line__0_14_1",
|
||||
|
|
@ -583,22 +593,22 @@ def raze_fetch_remote_crates():
|
|||
|
||||
maybe(
|
||||
http_archive,
|
||||
name = "raze__fluent__0_13_1",
|
||||
url = "https://crates.io/api/v1/crates/fluent/0.13.1/download",
|
||||
name = "raze__fluent__0_15_0",
|
||||
url = "https://crates.io/api/v1/crates/fluent/0.15.0/download",
|
||||
type = "tar.gz",
|
||||
sha256 = "ef9e54ec7b674ae3477d948ae790e90ae24d54fb31c2e7173252978d9b09bdfa",
|
||||
strip_prefix = "fluent-0.13.1",
|
||||
build_file = Label("//cargo/remote:BUILD.fluent-0.13.1.bazel"),
|
||||
sha256 = "bc4d7142005e2066e4844caf9f271b93fc79836ee96ec85057b8c109687e629a",
|
||||
strip_prefix = "fluent-0.15.0",
|
||||
build_file = Label("//cargo/remote:BUILD.fluent-0.15.0.bazel"),
|
||||
)
|
||||
|
||||
maybe(
|
||||
http_archive,
|
||||
name = "raze__fluent_bundle__0_13_2",
|
||||
url = "https://crates.io/api/v1/crates/fluent-bundle/0.13.2/download",
|
||||
name = "raze__fluent_bundle__0_15_0",
|
||||
url = "https://crates.io/api/v1/crates/fluent-bundle/0.15.0/download",
|
||||
type = "tar.gz",
|
||||
sha256 = "092ebd50cd3f8a6d664bf156e3550d2f7232fbe446da6707d727cca53f707ce2",
|
||||
strip_prefix = "fluent-bundle-0.13.2",
|
||||
build_file = Label("//cargo/remote:BUILD.fluent-bundle-0.13.2.bazel"),
|
||||
sha256 = "5b589dfaa7e69ddf497be48cd0d184d7ff6e2cbb8186d1bb01c26d5cf5449a17",
|
||||
strip_prefix = "fluent-bundle-0.15.0",
|
||||
build_file = Label("//cargo/remote:BUILD.fluent-bundle-0.15.0.bazel"),
|
||||
)
|
||||
|
||||
maybe(
|
||||
|
|
@ -613,12 +623,12 @@ def raze_fetch_remote_crates():
|
|||
|
||||
maybe(
|
||||
http_archive,
|
||||
name = "raze__fluent_syntax__0_10_3",
|
||||
url = "https://crates.io/api/v1/crates/fluent-syntax/0.10.3/download",
|
||||
name = "raze__fluent_syntax__0_11_0",
|
||||
url = "https://crates.io/api/v1/crates/fluent-syntax/0.11.0/download",
|
||||
type = "tar.gz",
|
||||
sha256 = "784f660373ea898f712a7e67b43f35bf79608d46112747c29767d087611d716b",
|
||||
strip_prefix = "fluent-syntax-0.10.3",
|
||||
build_file = Label("//cargo/remote:BUILD.fluent-syntax-0.10.3.bazel"),
|
||||
sha256 = "c0abed97648395c902868fee9026de96483933faa54ea3b40d652f7dfe61ca78",
|
||||
strip_prefix = "fluent-syntax-0.11.0",
|
||||
build_file = Label("//cargo/remote:BUILD.fluent-syntax-0.11.0.bazel"),
|
||||
)
|
||||
|
||||
maybe(
|
||||
|
|
@ -1531,6 +1541,26 @@ def raze_fetch_remote_crates():
|
|||
build_file = Label("//cargo/remote:BUILD.openssl-sys-0.9.60.bazel"),
|
||||
)
|
||||
|
||||
maybe(
|
||||
http_archive,
|
||||
name = "raze__ouroboros__0_8_3",
|
||||
url = "https://crates.io/api/v1/crates/ouroboros/0.8.3/download",
|
||||
type = "tar.gz",
|
||||
sha256 = "5f6d5c203fe8d786d9d7bec8203cbbff3eb2cf8410c0d70cfd05b3d5f5d545da",
|
||||
strip_prefix = "ouroboros-0.8.3",
|
||||
build_file = Label("//cargo/remote:BUILD.ouroboros-0.8.3.bazel"),
|
||||
)
|
||||
|
||||
maybe(
|
||||
http_archive,
|
||||
name = "raze__ouroboros_macro__0_8_3",
|
||||
url = "https://crates.io/api/v1/crates/ouroboros_macro/0.8.3/download",
|
||||
type = "tar.gz",
|
||||
sha256 = "129943a960e6a08c7e70ca5a09f113c273fe7f10ae8420992c78293e3dffdf65",
|
||||
strip_prefix = "ouroboros_macro-0.8.3",
|
||||
build_file = Label("//cargo/remote:BUILD.ouroboros_macro-0.8.3.bazel"),
|
||||
)
|
||||
|
||||
maybe(
|
||||
http_archive,
|
||||
name = "raze__parking_lot__0_11_1",
|
||||
|
|
@ -1741,6 +1771,26 @@ def raze_fetch_remote_crates():
|
|||
build_file = Label("//cargo/remote:BUILD.proc-macro-crate-0.1.5.bazel"),
|
||||
)
|
||||
|
||||
maybe(
|
||||
http_archive,
|
||||
name = "raze__proc_macro_error__1_0_4",
|
||||
url = "https://crates.io/api/v1/crates/proc-macro-error/1.0.4/download",
|
||||
type = "tar.gz",
|
||||
sha256 = "da25490ff9892aab3fcf7c36f08cfb902dd3e71ca0f9f9517bea02a73a5ce38c",
|
||||
strip_prefix = "proc-macro-error-1.0.4",
|
||||
build_file = Label("//cargo/remote:BUILD.proc-macro-error-1.0.4.bazel"),
|
||||
)
|
||||
|
||||
maybe(
|
||||
http_archive,
|
||||
name = "raze__proc_macro_error_attr__1_0_4",
|
||||
url = "https://crates.io/api/v1/crates/proc-macro-error-attr/1.0.4/download",
|
||||
type = "tar.gz",
|
||||
sha256 = "a1be40180e52ecc98ad80b184934baf3d0d29f979574e439af5a55274b35f869",
|
||||
strip_prefix = "proc-macro-error-attr-1.0.4",
|
||||
build_file = Label("//cargo/remote:BUILD.proc-macro-error-attr-1.0.4.bazel"),
|
||||
)
|
||||
|
||||
maybe(
|
||||
http_archive,
|
||||
name = "raze__proc_macro_hack__0_5_19",
|
||||
|
|
@ -2021,26 +2071,6 @@ def raze_fetch_remote_crates():
|
|||
build_file = Label("//cargo/remote:BUILD.remove_dir_all-0.5.3.bazel"),
|
||||
)
|
||||
|
||||
maybe(
|
||||
http_archive,
|
||||
name = "raze__rental__0_5_5",
|
||||
url = "https://crates.io/api/v1/crates/rental/0.5.5/download",
|
||||
type = "tar.gz",
|
||||
sha256 = "8545debe98b2b139fb04cad8618b530e9b07c152d99a5de83c860b877d67847f",
|
||||
strip_prefix = "rental-0.5.5",
|
||||
build_file = Label("//cargo/remote:BUILD.rental-0.5.5.bazel"),
|
||||
)
|
||||
|
||||
maybe(
|
||||
http_archive,
|
||||
name = "raze__rental_impl__0_5_5",
|
||||
url = "https://crates.io/api/v1/crates/rental-impl/0.5.5/download",
|
||||
type = "tar.gz",
|
||||
sha256 = "475e68978dc5b743f2f40d8e0a8fdc83f1c5e78cbf4b8fa5e74e73beebc340de",
|
||||
strip_prefix = "rental-impl-0.5.5",
|
||||
build_file = Label("//cargo/remote:BUILD.rental-impl-0.5.5.bazel"),
|
||||
)
|
||||
|
||||
maybe(
|
||||
new_git_repository,
|
||||
name = "raze__reqwest__0_10_8",
|
||||
|
|
|
|||
|
|
@ -1,4 +1,13 @@
|
|||
[
|
||||
{
|
||||
"name": "Inflector",
|
||||
"version": "0.11.4",
|
||||
"authors": "Josh Teeter<joshteeter@gmail.com>",
|
||||
"repository": "https://github.com/whatisinternet/inflector",
|
||||
"license": "BSD-2-Clause",
|
||||
"license_file": null,
|
||||
"description": "Adds String based inflections for Rust. Snake, kebab, camel, sentence, class, title and table cases as well as ordinalize, deordinalize, demodulize, foreign key, and pluralize/singularize are supported as both traits and pure functions acting on String types."
|
||||
},
|
||||
{
|
||||
"name": "addr2line",
|
||||
"version": "0.14.1",
|
||||
|
|
@ -541,7 +550,7 @@
|
|||
},
|
||||
{
|
||||
"name": "fluent",
|
||||
"version": "0.13.1",
|
||||
"version": "0.15.0",
|
||||
"authors": "Zibi Braniecki <gandalf@mozilla.com>|Staś Małolepszy <stas@mozilla.com>",
|
||||
"repository": "https://github.com/projectfluent/fluent-rs",
|
||||
"license": "Apache-2.0 OR MIT",
|
||||
|
|
@ -550,7 +559,7 @@
|
|||
},
|
||||
{
|
||||
"name": "fluent-bundle",
|
||||
"version": "0.13.2",
|
||||
"version": "0.15.0",
|
||||
"authors": "Zibi Braniecki <gandalf@mozilla.com>|Staś Małolepszy <stas@mozilla.com>",
|
||||
"repository": "https://github.com/projectfluent/fluent-rs",
|
||||
"license": "Apache-2.0 OR MIT",
|
||||
|
|
@ -568,7 +577,7 @@
|
|||
},
|
||||
{
|
||||
"name": "fluent-syntax",
|
||||
"version": "0.10.3",
|
||||
"version": "0.11.0",
|
||||
"authors": "Zibi Braniecki <gandalf@mozilla.com>|Staś Małolepszy <stas@mozilla.com>",
|
||||
"repository": "https://github.com/projectfluent/fluent-rs",
|
||||
"license": "Apache-2.0 OR MIT",
|
||||
|
|
@ -1394,6 +1403,24 @@
|
|||
"license_file": null,
|
||||
"description": "FFI bindings to OpenSSL"
|
||||
},
|
||||
{
|
||||
"name": "ouroboros",
|
||||
"version": "0.8.3",
|
||||
"authors": "Joshua Maros <joshua-maros@github.com>",
|
||||
"repository": "https://github.com/joshua-maros/ouroboros",
|
||||
"license": "Apache-2.0 OR MIT",
|
||||
"license_file": null,
|
||||
"description": "Easy, safe self-referential struct generation."
|
||||
},
|
||||
{
|
||||
"name": "ouroboros_macro",
|
||||
"version": "0.8.3",
|
||||
"authors": "Joshua Maros <joshua-maros@github.com>",
|
||||
"repository": "https://github.com/joshua-maros/ouroboros",
|
||||
"license": "Apache-2.0 OR MIT",
|
||||
"license_file": null,
|
||||
"description": "Proc macro for ouroboros crate."
|
||||
},
|
||||
{
|
||||
"name": "parking_lot",
|
||||
"version": "0.11.1",
|
||||
|
|
@ -1583,6 +1610,24 @@
|
|||
"license_file": null,
|
||||
"description": "Replacement for crate (macro_rules keyword) in proc-macros"
|
||||
},
|
||||
{
|
||||
"name": "proc-macro-error",
|
||||
"version": "1.0.4",
|
||||
"authors": "CreepySkeleton <creepy-skeleton@yandex.ru>",
|
||||
"repository": "https://gitlab.com/CreepySkeleton/proc-macro-error",
|
||||
"license": "Apache-2.0 OR MIT",
|
||||
"license_file": null,
|
||||
"description": "Almost drop-in replacement to panics in proc-macros"
|
||||
},
|
||||
{
|
||||
"name": "proc-macro-error-attr",
|
||||
"version": "1.0.4",
|
||||
"authors": "CreepySkeleton <creepy-skeleton@yandex.ru>",
|
||||
"repository": "https://gitlab.com/CreepySkeleton/proc-macro-error",
|
||||
"license": "Apache-2.0 OR MIT",
|
||||
"license_file": null,
|
||||
"description": "Attribute macro for proc-macro-error crate"
|
||||
},
|
||||
{
|
||||
"name": "proc-macro-hack",
|
||||
"version": "0.5.19",
|
||||
|
|
@ -1835,24 +1880,6 @@
|
|||
"license_file": null,
|
||||
"description": "A safe, reliable implementation of remove_dir_all for Windows"
|
||||
},
|
||||
{
|
||||
"name": "rental",
|
||||
"version": "0.5.5",
|
||||
"authors": "Jameson Ernst <jameson@jpernst.com>",
|
||||
"repository": "https://github.com/jpernst/rental",
|
||||
"license": "Apache-2.0 OR MIT",
|
||||
"license_file": null,
|
||||
"description": "A macro to generate safe self-referential structs, plus premade types for common use cases."
|
||||
},
|
||||
{
|
||||
"name": "rental-impl",
|
||||
"version": "0.5.5",
|
||||
"authors": "Jameson Ernst <jameson@jpernst.com>",
|
||||
"repository": "https://github.com/jpernst/rental",
|
||||
"license": "Apache-2.0 OR MIT",
|
||||
"license_file": null,
|
||||
"description": "An implementation detail of rental. Should not be used directly."
|
||||
},
|
||||
{
|
||||
"name": "reqwest",
|
||||
"version": "0.10.8",
|
||||
|
|
|
|||
70
cargo/remote/BUILD.Inflector-0.11.4.bazel
vendored
Normal file
70
cargo/remote/BUILD.Inflector-0.11.4.bazel
vendored
Normal file
|
|
@ -0,0 +1,70 @@
|
|||
"""
|
||||
@generated
|
||||
cargo-raze crate build file.
|
||||
|
||||
DO NOT EDIT! Replaced on runs of cargo-raze
|
||||
"""
|
||||
|
||||
# buildifier: disable=load
|
||||
load(
|
||||
"@io_bazel_rules_rust//rust:rust.bzl",
|
||||
"rust_binary",
|
||||
"rust_library",
|
||||
"rust_test",
|
||||
)
|
||||
|
||||
# buildifier: disable=load
|
||||
load("@bazel_skylib//lib:selects.bzl", "selects")
|
||||
|
||||
package(default_visibility = [
|
||||
# Public for visibility by "@raze__crate__version//" targets.
|
||||
#
|
||||
# Prefer access through "//cargo", which limits external
|
||||
# visibility to explicit Cargo.toml dependencies.
|
||||
"//visibility:public",
|
||||
])
|
||||
|
||||
licenses([
|
||||
"restricted", # BSD-2-Clause from expression "BSD-2-Clause"
|
||||
])
|
||||
|
||||
# Generated Targets
|
||||
|
||||
alias(
|
||||
name = "Inflector",
|
||||
actual = ":inflector",
|
||||
tags = [
|
||||
"cargo-raze",
|
||||
"manual",
|
||||
],
|
||||
)
|
||||
|
||||
rust_library(
|
||||
name = "inflector",
|
||||
srcs = glob(["**/*.rs"]),
|
||||
crate_features = [
|
||||
"default",
|
||||
"heavyweight",
|
||||
"lazy_static",
|
||||
"regex",
|
||||
],
|
||||
crate_root = "src/lib.rs",
|
||||
crate_type = "lib",
|
||||
data = [],
|
||||
edition = "2015",
|
||||
rustc_flags = [
|
||||
"--cap-lints=allow",
|
||||
],
|
||||
tags = [
|
||||
"cargo-raze",
|
||||
"manual",
|
||||
],
|
||||
version = "0.11.4",
|
||||
# buildifier: leave-alone
|
||||
deps = [
|
||||
"@raze__lazy_static__1_4_0//:lazy_static",
|
||||
"@raze__regex__1_4_3//:regex",
|
||||
],
|
||||
)
|
||||
|
||||
# Unsupported target "lib" with type "test" omitted
|
||||
|
|
@ -46,10 +46,10 @@ rust_library(
|
|||
"cargo-raze",
|
||||
"manual",
|
||||
],
|
||||
version = "0.13.1",
|
||||
version = "0.15.0",
|
||||
# buildifier: leave-alone
|
||||
deps = [
|
||||
"@raze__fluent_bundle__0_13_2//:fluent_bundle",
|
||||
"@raze__fluent_bundle__0_15_0//:fluent_bundle",
|
||||
"@raze__unic_langid__0_9_0//:unic_langid",
|
||||
],
|
||||
)
|
||||
|
|
@ -32,10 +32,13 @@ licenses([
|
|||
|
||||
# Unsupported target "resolver" with type "bench" omitted
|
||||
|
||||
# Unsupported target "resolver_iai" with type "bench" omitted
|
||||
|
||||
rust_library(
|
||||
name = "fluent_bundle",
|
||||
srcs = glob(["**/*.rs"]),
|
||||
crate_features = [
|
||||
"default",
|
||||
],
|
||||
crate_root = "src/lib.rs",
|
||||
crate_type = "lib",
|
||||
|
|
@ -48,14 +51,15 @@ rust_library(
|
|||
"cargo-raze",
|
||||
"manual",
|
||||
],
|
||||
version = "0.13.2",
|
||||
version = "0.15.0",
|
||||
# buildifier: leave-alone
|
||||
deps = [
|
||||
"@raze__fluent_langneg__0_13_0//:fluent_langneg",
|
||||
"@raze__fluent_syntax__0_10_3//:fluent_syntax",
|
||||
"@raze__fluent_syntax__0_11_0//:fluent_syntax",
|
||||
"@raze__intl_memoizer__0_5_1//:intl_memoizer",
|
||||
"@raze__intl_pluralrules__7_0_1//:intl_pluralrules",
|
||||
"@raze__rental__0_5_5//:rental",
|
||||
"@raze__ouroboros__0_8_3//:ouroboros",
|
||||
"@raze__rustc_hash__1_1_0//:rustc_hash",
|
||||
"@raze__smallvec__1_6_1//:smallvec",
|
||||
"@raze__unic_langid__0_9_0//:unic_langid",
|
||||
],
|
||||
|
|
@ -32,6 +32,8 @@ licenses([
|
|||
|
||||
# Unsupported target "parser" with type "bench" omitted
|
||||
|
||||
# Unsupported target "parser_iai" with type "bench" omitted
|
||||
|
||||
rust_binary(
|
||||
# Prefix bin name to disambiguate from (probable) collision with lib name
|
||||
# N.B.: The exact form of this is subject to change.
|
||||
|
|
@ -50,11 +52,12 @@ rust_binary(
|
|||
"cargo-raze",
|
||||
"manual",
|
||||
],
|
||||
version = "0.10.3",
|
||||
version = "0.11.0",
|
||||
# buildifier: leave-alone
|
||||
deps = [
|
||||
# Binaries get an implicit dependency on their crate's lib
|
||||
":fluent_syntax",
|
||||
"@raze__thiserror__1_0_24//:thiserror",
|
||||
],
|
||||
)
|
||||
|
||||
|
|
@ -76,11 +79,12 @@ rust_binary(
|
|||
"cargo-raze",
|
||||
"manual",
|
||||
],
|
||||
version = "0.10.3",
|
||||
version = "0.11.0",
|
||||
# buildifier: leave-alone
|
||||
deps = [
|
||||
# Binaries get an implicit dependency on their crate's lib
|
||||
":fluent_syntax",
|
||||
"@raze__thiserror__1_0_24//:thiserror",
|
||||
],
|
||||
)
|
||||
|
||||
|
|
@ -101,9 +105,10 @@ rust_library(
|
|||
"cargo-raze",
|
||||
"manual",
|
||||
],
|
||||
version = "0.10.3",
|
||||
version = "0.11.0",
|
||||
# buildifier: leave-alone
|
||||
deps = [
|
||||
"@raze__thiserror__1_0_24//:thiserror",
|
||||
],
|
||||
)
|
||||
|
||||
57
cargo/remote/BUILD.ouroboros-0.8.3.bazel
vendored
Normal file
57
cargo/remote/BUILD.ouroboros-0.8.3.bazel
vendored
Normal file
|
|
@ -0,0 +1,57 @@
|
|||
"""
|
||||
@generated
|
||||
cargo-raze crate build file.
|
||||
|
||||
DO NOT EDIT! Replaced on runs of cargo-raze
|
||||
"""
|
||||
|
||||
# buildifier: disable=load
|
||||
load(
|
||||
"@io_bazel_rules_rust//rust:rust.bzl",
|
||||
"rust_binary",
|
||||
"rust_library",
|
||||
"rust_test",
|
||||
)
|
||||
|
||||
# buildifier: disable=load
|
||||
load("@bazel_skylib//lib:selects.bzl", "selects")
|
||||
|
||||
package(default_visibility = [
|
||||
# Public for visibility by "@raze__crate__version//" targets.
|
||||
#
|
||||
# Prefer access through "//cargo", which limits external
|
||||
# visibility to explicit Cargo.toml dependencies.
|
||||
"//visibility:public",
|
||||
])
|
||||
|
||||
licenses([
|
||||
"notice", # MIT from expression "MIT OR Apache-2.0"
|
||||
])
|
||||
|
||||
# Generated Targets
|
||||
|
||||
rust_library(
|
||||
name = "ouroboros",
|
||||
srcs = glob(["**/*.rs"]),
|
||||
crate_features = [
|
||||
],
|
||||
crate_root = "src/lib.rs",
|
||||
crate_type = "lib",
|
||||
data = [],
|
||||
edition = "2018",
|
||||
proc_macro_deps = [
|
||||
"@raze__ouroboros_macro__0_8_3//:ouroboros_macro",
|
||||
],
|
||||
rustc_flags = [
|
||||
"--cap-lints=allow",
|
||||
],
|
||||
tags = [
|
||||
"cargo-raze",
|
||||
"manual",
|
||||
],
|
||||
version = "0.8.3",
|
||||
# buildifier: leave-alone
|
||||
deps = [
|
||||
"@raze__stable_deref_trait__1_2_0//:stable_deref_trait",
|
||||
],
|
||||
)
|
||||
|
|
@ -31,14 +31,14 @@ licenses([
|
|||
# Generated Targets
|
||||
|
||||
rust_library(
|
||||
name = "rental_impl",
|
||||
name = "ouroboros_macro",
|
||||
srcs = glob(["**/*.rs"]),
|
||||
crate_features = [
|
||||
],
|
||||
crate_root = "src/lib.rs",
|
||||
crate_type = "proc-macro",
|
||||
data = [],
|
||||
edition = "2015",
|
||||
edition = "2018",
|
||||
rustc_flags = [
|
||||
"--cap-lints=allow",
|
||||
],
|
||||
|
|
@ -46,10 +46,12 @@ rust_library(
|
|||
"cargo-raze",
|
||||
"manual",
|
||||
],
|
||||
version = "0.5.5",
|
||||
version = "0.8.3",
|
||||
# buildifier: leave-alone
|
||||
deps = [
|
||||
"@raze__Inflector__0_11_4//:Inflector",
|
||||
"@raze__proc_macro2__1_0_24//:proc_macro2",
|
||||
"@raze__proc_macro_error__1_0_4//:proc_macro_error",
|
||||
"@raze__quote__1_0_9//:quote",
|
||||
"@raze__syn__1_0_63//:syn",
|
||||
],
|
||||
101
cargo/remote/BUILD.proc-macro-error-1.0.4.bazel
vendored
Normal file
101
cargo/remote/BUILD.proc-macro-error-1.0.4.bazel
vendored
Normal file
|
|
@ -0,0 +1,101 @@
|
|||
"""
|
||||
@generated
|
||||
cargo-raze crate build file.
|
||||
|
||||
DO NOT EDIT! Replaced on runs of cargo-raze
|
||||
"""
|
||||
|
||||
# buildifier: disable=load
|
||||
load(
|
||||
"@io_bazel_rules_rust//rust:rust.bzl",
|
||||
"rust_binary",
|
||||
"rust_library",
|
||||
"rust_test",
|
||||
)
|
||||
|
||||
# buildifier: disable=load
|
||||
load("@bazel_skylib//lib:selects.bzl", "selects")
|
||||
|
||||
package(default_visibility = [
|
||||
# Public for visibility by "@raze__crate__version//" targets.
|
||||
#
|
||||
# Prefer access through "//cargo", which limits external
|
||||
# visibility to explicit Cargo.toml dependencies.
|
||||
"//visibility:public",
|
||||
])
|
||||
|
||||
licenses([
|
||||
"notice", # MIT from expression "MIT OR Apache-2.0"
|
||||
])
|
||||
|
||||
# Generated Targets
|
||||
# buildifier: disable=load-on-top
|
||||
load(
|
||||
"@io_bazel_rules_rust//cargo:cargo_build_script.bzl",
|
||||
"cargo_build_script",
|
||||
)
|
||||
|
||||
cargo_build_script(
|
||||
name = "proc_macro_error_build_script",
|
||||
srcs = glob(["**/*.rs"]),
|
||||
build_script_env = {
|
||||
},
|
||||
crate_features = [
|
||||
"default",
|
||||
"syn",
|
||||
"syn-error",
|
||||
],
|
||||
crate_root = "build.rs",
|
||||
data = glob(["**"]),
|
||||
edition = "2018",
|
||||
rustc_flags = [
|
||||
"--cap-lints=allow",
|
||||
],
|
||||
tags = [
|
||||
"cargo-raze",
|
||||
"manual",
|
||||
],
|
||||
version = "1.0.4",
|
||||
visibility = ["//visibility:private"],
|
||||
deps = [
|
||||
"@raze__version_check__0_9_2//:version_check",
|
||||
],
|
||||
)
|
||||
|
||||
rust_library(
|
||||
name = "proc_macro_error",
|
||||
srcs = glob(["**/*.rs"]),
|
||||
crate_features = [
|
||||
"default",
|
||||
"syn",
|
||||
"syn-error",
|
||||
],
|
||||
crate_root = "src/lib.rs",
|
||||
crate_type = "lib",
|
||||
data = [],
|
||||
edition = "2018",
|
||||
proc_macro_deps = [
|
||||
"@raze__proc_macro_error_attr__1_0_4//:proc_macro_error_attr",
|
||||
],
|
||||
rustc_flags = [
|
||||
"--cap-lints=allow",
|
||||
],
|
||||
tags = [
|
||||
"cargo-raze",
|
||||
"manual",
|
||||
],
|
||||
version = "1.0.4",
|
||||
# buildifier: leave-alone
|
||||
deps = [
|
||||
":proc_macro_error_build_script",
|
||||
"@raze__proc_macro2__1_0_24//:proc_macro2",
|
||||
"@raze__quote__1_0_9//:quote",
|
||||
"@raze__syn__1_0_63//:syn",
|
||||
],
|
||||
)
|
||||
|
||||
# Unsupported target "macro-errors" with type "test" omitted
|
||||
|
||||
# Unsupported target "ok" with type "test" omitted
|
||||
|
||||
# Unsupported target "runtime-errors" with type "test" omitted
|
||||
85
cargo/remote/BUILD.proc-macro-error-attr-1.0.4.bazel
vendored
Normal file
85
cargo/remote/BUILD.proc-macro-error-attr-1.0.4.bazel
vendored
Normal file
|
|
@ -0,0 +1,85 @@
|
|||
"""
|
||||
@generated
|
||||
cargo-raze crate build file.
|
||||
|
||||
DO NOT EDIT! Replaced on runs of cargo-raze
|
||||
"""
|
||||
|
||||
# buildifier: disable=load
|
||||
load(
|
||||
"@io_bazel_rules_rust//rust:rust.bzl",
|
||||
"rust_binary",
|
||||
"rust_library",
|
||||
"rust_test",
|
||||
)
|
||||
|
||||
# buildifier: disable=load
|
||||
load("@bazel_skylib//lib:selects.bzl", "selects")
|
||||
|
||||
package(default_visibility = [
|
||||
# Public for visibility by "@raze__crate__version//" targets.
|
||||
#
|
||||
# Prefer access through "//cargo", which limits external
|
||||
# visibility to explicit Cargo.toml dependencies.
|
||||
"//visibility:public",
|
||||
])
|
||||
|
||||
licenses([
|
||||
"notice", # MIT from expression "MIT OR Apache-2.0"
|
||||
])
|
||||
|
||||
# Generated Targets
|
||||
# buildifier: disable=load-on-top
|
||||
load(
|
||||
"@io_bazel_rules_rust//cargo:cargo_build_script.bzl",
|
||||
"cargo_build_script",
|
||||
)
|
||||
|
||||
cargo_build_script(
|
||||
name = "proc_macro_error_attr_build_script",
|
||||
srcs = glob(["**/*.rs"]),
|
||||
build_script_env = {
|
||||
},
|
||||
crate_features = [
|
||||
],
|
||||
crate_root = "build.rs",
|
||||
data = glob(["**"]),
|
||||
edition = "2018",
|
||||
rustc_flags = [
|
||||
"--cap-lints=allow",
|
||||
],
|
||||
tags = [
|
||||
"cargo-raze",
|
||||
"manual",
|
||||
],
|
||||
version = "1.0.4",
|
||||
visibility = ["//visibility:private"],
|
||||
deps = [
|
||||
"@raze__version_check__0_9_2//:version_check",
|
||||
],
|
||||
)
|
||||
|
||||
rust_library(
|
||||
name = "proc_macro_error_attr",
|
||||
srcs = glob(["**/*.rs"]),
|
||||
crate_features = [
|
||||
],
|
||||
crate_root = "src/lib.rs",
|
||||
crate_type = "proc-macro",
|
||||
data = [],
|
||||
edition = "2018",
|
||||
rustc_flags = [
|
||||
"--cap-lints=allow",
|
||||
],
|
||||
tags = [
|
||||
"cargo-raze",
|
||||
"manual",
|
||||
],
|
||||
version = "1.0.4",
|
||||
# buildifier: leave-alone
|
||||
deps = [
|
||||
":proc_macro_error_attr_build_script",
|
||||
"@raze__proc_macro2__1_0_24//:proc_macro2",
|
||||
"@raze__quote__1_0_9//:quote",
|
||||
],
|
||||
)
|
||||
93
cargo/remote/BUILD.rental-0.5.5.bazel
vendored
93
cargo/remote/BUILD.rental-0.5.5.bazel
vendored
|
|
@ -1,93 +0,0 @@
|
|||
"""
|
||||
@generated
|
||||
cargo-raze crate build file.
|
||||
|
||||
DO NOT EDIT! Replaced on runs of cargo-raze
|
||||
"""
|
||||
|
||||
# buildifier: disable=load
|
||||
load(
|
||||
"@io_bazel_rules_rust//rust:rust.bzl",
|
||||
"rust_binary",
|
||||
"rust_library",
|
||||
"rust_test",
|
||||
)
|
||||
|
||||
# buildifier: disable=load
|
||||
load("@bazel_skylib//lib:selects.bzl", "selects")
|
||||
|
||||
package(default_visibility = [
|
||||
# Public for visibility by "@raze__crate__version//" targets.
|
||||
#
|
||||
# Prefer access through "//cargo", which limits external
|
||||
# visibility to explicit Cargo.toml dependencies.
|
||||
"//visibility:public",
|
||||
])
|
||||
|
||||
licenses([
|
||||
"notice", # MIT from expression "MIT OR Apache-2.0"
|
||||
])
|
||||
|
||||
# Generated Targets
|
||||
|
||||
rust_library(
|
||||
name = "rental",
|
||||
srcs = glob(["**/*.rs"]),
|
||||
crate_features = [
|
||||
"default",
|
||||
"std",
|
||||
],
|
||||
crate_root = "src/lib.rs",
|
||||
crate_type = "lib",
|
||||
data = [],
|
||||
edition = "2015",
|
||||
proc_macro_deps = [
|
||||
"@raze__rental_impl__0_5_5//:rental_impl",
|
||||
],
|
||||
rustc_flags = [
|
||||
"--cap-lints=allow",
|
||||
],
|
||||
tags = [
|
||||
"cargo-raze",
|
||||
"manual",
|
||||
],
|
||||
version = "0.5.5",
|
||||
# buildifier: leave-alone
|
||||
deps = [
|
||||
"@raze__stable_deref_trait__1_2_0//:stable_deref_trait",
|
||||
],
|
||||
)
|
||||
|
||||
# Unsupported target "clone" with type "test" omitted
|
||||
|
||||
# Unsupported target "complex" with type "test" omitted
|
||||
|
||||
# Unsupported target "complex_mut" with type "test" omitted
|
||||
|
||||
# Unsupported target "covariant" with type "test" omitted
|
||||
|
||||
# Unsupported target "debug" with type "test" omitted
|
||||
|
||||
# Unsupported target "drop_order" with type "test" omitted
|
||||
|
||||
# Unsupported target "generic" with type "test" omitted
|
||||
|
||||
# Unsupported target "lt_params" with type "test" omitted
|
||||
|
||||
# Unsupported target "map" with type "test" omitted
|
||||
|
||||
# Unsupported target "simple_mut" with type "test" omitted
|
||||
|
||||
# Unsupported target "simple_ref" with type "test" omitted
|
||||
|
||||
# Unsupported target "string" with type "test" omitted
|
||||
|
||||
# Unsupported target "subrental" with type "test" omitted
|
||||
|
||||
# Unsupported target "target_ty_hack" with type "test" omitted
|
||||
|
||||
# Unsupported target "trait" with type "test" omitted
|
||||
|
||||
# Unsupported target "unused" with type "test" omitted
|
||||
|
||||
# Unsupported target "vec_slice" with type "test" omitted
|
||||
|
|
@ -35,6 +35,7 @@ rust_library(
|
|||
srcs = glob(["**/*.rs"]),
|
||||
crate_features = [
|
||||
"alloc",
|
||||
"default",
|
||||
"std",
|
||||
],
|
||||
crate_root = "src/lib.rs",
|
||||
|
|
|
|||
|
|
@ -123,7 +123,7 @@ def stage_commit():
|
|||
)
|
||||
|
||||
|
||||
update_cargo_lock()
|
||||
# update_cargo_lock()
|
||||
run_cargo_raze()
|
||||
write_licenses()
|
||||
update_crates_bzl()
|
||||
|
|
|
|||
|
|
@ -31,7 +31,6 @@ cargo_build_script(
|
|||
"@extra_ftl//:l10n.toml",
|
||||
],
|
||||
deps = [
|
||||
"//rslib/cargo:fluent_syntax",
|
||||
"//rslib/cargo:prost_build",
|
||||
],
|
||||
)
|
||||
|
|
|
|||
|
|
@ -14,7 +14,6 @@ path = "src/lib.rs"
|
|||
# After updating anything below, run ../cargo/update.py
|
||||
|
||||
[build-dependencies]
|
||||
fluent-syntax = "0.10"
|
||||
prost-build = "0.7"
|
||||
|
||||
[dev-dependencies]
|
||||
|
|
@ -41,7 +40,8 @@ chrono = "0.4.13"
|
|||
coarsetime = "0.1.16"
|
||||
failure = "0.1.8"
|
||||
flate2 = "1.0.16"
|
||||
fluent = "0.13.1"
|
||||
fluent = "0.15"
|
||||
fluent-bundle = "0.15"
|
||||
futures = "0.3.5"
|
||||
hex = "0.4.2"
|
||||
htmlescape = "0.3.1"
|
||||
|
|
|
|||
|
|
@ -113,7 +113,7 @@ alias(
|
|||
|
||||
alias(
|
||||
name = "fluent",
|
||||
actual = "@raze__fluent__0_13_1//:fluent",
|
||||
actual = "@raze__fluent__0_15_0//:fluent",
|
||||
tags = [
|
||||
"cargo-raze",
|
||||
"manual",
|
||||
|
|
@ -121,8 +121,8 @@ alias(
|
|||
)
|
||||
|
||||
alias(
|
||||
name = "fluent_syntax",
|
||||
actual = "@raze__fluent_syntax__0_10_3//:fluent_syntax",
|
||||
name = "fluent_bundle",
|
||||
actual = "@raze__fluent_bundle__0_15_0//:fluent_bundle",
|
||||
tags = [
|
||||
"cargo-raze",
|
||||
"manual",
|
||||
|
|
|
|||
|
|
@ -44,6 +44,7 @@ rust_library(
|
|||
deps = [
|
||||
":build_script",
|
||||
"//rslib/i18n/cargo:fluent",
|
||||
"//rslib/i18n/cargo:fluent_bundle",
|
||||
"//rslib/i18n/cargo:intl_memoizer",
|
||||
"//rslib/i18n/cargo:num_format",
|
||||
"//rslib/i18n/cargo:phf",
|
||||
|
|
|
|||
|
|
@ -18,8 +18,8 @@ path = "build/write_json.rs"
|
|||
# After updating anything below, run ../cargo/update.py
|
||||
|
||||
[build-dependencies]
|
||||
fluent-syntax = "0.10"
|
||||
fluent = "0.13.1"
|
||||
fluent-syntax = "0.11.0"
|
||||
fluent = "0.15.0"
|
||||
unic-langid = { version = "0.9", features = ["macros"] }
|
||||
serde = { version = "1.0.114", features = ["derive"] }
|
||||
serde_json = "1.0.56"
|
||||
|
|
@ -27,9 +27,10 @@ inflections = "1.1.1"
|
|||
|
||||
[dependencies]
|
||||
phf = { version = "0.8", features = ["macros"] }
|
||||
fluent = "0.13.1"
|
||||
fluent = "0.15.0"
|
||||
num-format = "0.4.0"
|
||||
unic-langid = { version = "0.9", features = ["macros"] }
|
||||
serde = { version = "1.0.114", features = ["derive"] }
|
||||
serde_json = "1.0.56"
|
||||
intl-memoizer = "0.5"
|
||||
fluent-bundle = "0.15.0"
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@ fn check_content(lang: &str, fname: &str, content: &str) {
|
|||
panic!("{}\nUnable to parse {}/{}: {:?}", content, lang, fname, e);
|
||||
});
|
||||
|
||||
let mut bundle: FluentBundle<FluentResource> = FluentBundle::new(&[lang_id]);
|
||||
let mut bundle: FluentBundle<FluentResource> = FluentBundle::new(vec![lang_id]);
|
||||
bundle.add_resource(resource).unwrap_or_else(|e| {
|
||||
panic!(
|
||||
"{}\nUnable to bundle - duplicate key? {}/{}: {:?}",
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@
|
|||
|
||||
use crate::gather::TranslationsByLang;
|
||||
use fluent_syntax::ast::{Entry, Expression, InlineExpression, Pattern, PatternElement};
|
||||
use fluent_syntax::parser::Parser;
|
||||
use fluent_syntax::parser::parse;
|
||||
use serde::Serialize;
|
||||
use std::{collections::HashSet, fmt::Write};
|
||||
#[derive(Debug, PartialOrd, Ord, PartialEq, Eq, Serialize)]
|
||||
|
|
@ -59,7 +59,7 @@ pub fn get_modules(data: &TranslationsByLang) -> Vec<Module> {
|
|||
}
|
||||
|
||||
fn extract_metadata(ftl_text: &str) -> Vec<Translation> {
|
||||
let res = Parser::new(ftl_text).parse().unwrap();
|
||||
let res = parse(ftl_text).unwrap();
|
||||
let mut output = vec![];
|
||||
|
||||
for entry in res.body {
|
||||
|
|
@ -147,11 +147,11 @@ impl Visitor {
|
|||
|
||||
fn visit_expression(&mut self, expression: &Expression<&str>) {
|
||||
match expression {
|
||||
Expression::SelectExpression { selector, variants } => {
|
||||
Expression::Select { selector, variants } => {
|
||||
self.visit_inline_expression(&selector, true);
|
||||
self.visit_pattern(&variants.last().unwrap().value)
|
||||
}
|
||||
Expression::InlineExpression(expr) => self.visit_inline_expression(expr, false),
|
||||
Expression::Inline(expr) => self.visit_inline_expression(expr, false),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -14,7 +14,16 @@ licenses([
|
|||
# Aliased targets
|
||||
alias(
|
||||
name = "fluent",
|
||||
actual = "@raze__fluent__0_13_1//:fluent",
|
||||
actual = "@raze__fluent__0_15_0//:fluent",
|
||||
tags = [
|
||||
"cargo-raze",
|
||||
"manual",
|
||||
],
|
||||
)
|
||||
|
||||
alias(
|
||||
name = "fluent_bundle",
|
||||
actual = "@raze__fluent_bundle__0_15_0//:fluent_bundle",
|
||||
tags = [
|
||||
"cargo-raze",
|
||||
"manual",
|
||||
|
|
@ -23,7 +32,7 @@ alias(
|
|||
|
||||
alias(
|
||||
name = "fluent_syntax",
|
||||
actual = "@raze__fluent_syntax__0_10_3//:fluent_syntax",
|
||||
actual = "@raze__fluent_syntax__0_11_0//:fluent_syntax",
|
||||
tags = [
|
||||
"cargo-raze",
|
||||
"manual",
|
||||
|
|
@ -75,15 +84,6 @@ alias(
|
|||
],
|
||||
)
|
||||
|
||||
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",
|
||||
|
|
|
|||
|
|
@ -3,7 +3,8 @@
|
|||
|
||||
mod generated;
|
||||
|
||||
use fluent::{concurrent::FluentBundle, FluentArgs, FluentResource, FluentValue};
|
||||
use fluent::{FluentArgs, FluentResource, FluentValue};
|
||||
use fluent_bundle::bundle::FluentBundle as FluentBundleOrig;
|
||||
use num_format::Locale;
|
||||
use serde::Serialize;
|
||||
use std::borrow::Cow;
|
||||
|
|
@ -12,6 +13,8 @@ use unic_langid::LanguageIdentifier;
|
|||
|
||||
use generated::{KEYS_BY_MODULE, STRINGS};
|
||||
|
||||
type FluentBundle<T> = FluentBundleOrig<T, intl_memoizer::concurrent::IntlLangMemoizer>;
|
||||
|
||||
pub use fluent::fluent_args as tr_args;
|
||||
|
||||
fn remapped_lang_name(lang: &LanguageIdentifier) -> &str {
|
||||
|
|
@ -88,7 +91,7 @@ fn get_bundle(
|
|||
})
|
||||
.ok()?;
|
||||
|
||||
let mut bundle: FluentBundle<FluentResource> = FluentBundle::new(locales);
|
||||
let mut bundle: FluentBundle<FluentResource> = FluentBundle::new_concurrent(locales.to_vec());
|
||||
bundle
|
||||
.add_resource(res)
|
||||
.map_err(|e| {
|
||||
|
|
@ -236,7 +239,7 @@ impl I18n {
|
|||
None => continue,
|
||||
};
|
||||
|
||||
let pat = match msg.value {
|
||||
let pat = match msg.value() {
|
||||
Some(val) => val,
|
||||
// empty value
|
||||
None => continue,
|
||||
|
|
|
|||
|
|
@ -1,22 +1,20 @@
|
|||
// Copyright: Ankitects Pty Ltd and contributors
|
||||
// License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
|
||||
|
||||
use std::collections::HashMap;
|
||||
|
||||
use super::Backend;
|
||||
use crate::{
|
||||
backend_proto as pb,
|
||||
prelude::*,
|
||||
scheduler::timespan::{answer_button_time, time_span},
|
||||
};
|
||||
use fluent::FluentValue;
|
||||
use fluent::{FluentArgs, FluentValue};
|
||||
pub(super) use pb::i18n_service::Service as I18nService;
|
||||
|
||||
impl I18nService for Backend {
|
||||
fn translate_string(&self, input: pb::TranslateStringIn) -> Result<pb::String> {
|
||||
let args = input
|
||||
.args
|
||||
.iter()
|
||||
.map(|(k, v)| (k.as_str(), translate_arg_to_fluent_val(&v)))
|
||||
.collect();
|
||||
let args = build_fluent_args(input.args);
|
||||
|
||||
Ok(self
|
||||
.tr
|
||||
|
|
@ -45,11 +43,19 @@ impl I18nService for Backend {
|
|||
}
|
||||
}
|
||||
|
||||
fn translate_arg_to_fluent_val(arg: &pb::TranslateArgValue) -> FluentValue {
|
||||
fn build_fluent_args(input: HashMap<String, pb::TranslateArgValue>) -> FluentArgs<'static> {
|
||||
let mut args = FluentArgs::new();
|
||||
for (key, val) in input {
|
||||
args.set(key, translate_arg_to_fluent_val(&val));
|
||||
}
|
||||
args
|
||||
}
|
||||
|
||||
fn translate_arg_to_fluent_val(arg: &pb::TranslateArgValue) -> FluentValue<'static> {
|
||||
use pb::translate_arg_value::Value as V;
|
||||
match &arg.value {
|
||||
Some(val) => match val {
|
||||
V::Str(s) => FluentValue::String(s.into()),
|
||||
V::Str(s) => FluentValue::String(s.to_owned().into()),
|
||||
V::Number(f) => FluentValue::Number(f.into()),
|
||||
},
|
||||
None => FluentValue::String("".into()),
|
||||
|
|
|
|||
Loading…
Reference in a new issue