Update dependencies and i18n logic
This commit is contained in:
parent
5ce3860f2c
commit
dd71ac8820
3 changed files with 5 additions and 7 deletions
|
|
@ -24,7 +24,7 @@ anyhow = { workspace = true }
|
||||||
thiserror = { workspace = true }
|
thiserror = { workspace = true }
|
||||||
log = { workspace = true }
|
log = { workspace = true }
|
||||||
env_logger = { workspace = true }
|
env_logger = { workspace = true }
|
||||||
chrono = { workspace = true, features = ["serde"] }
|
chrono = { workspace = true, features = ["serde", "clock"] }
|
||||||
serde = { workspace = true, features = ["derive"] }
|
serde = { workspace = true, features = ["derive"] }
|
||||||
serde_json = { workspace = true }
|
serde_json = { workspace = true }
|
||||||
uuid = { workspace = true, features = ["serde", "v4"] }
|
uuid = { workspace = true, features = ["serde", "v4"] }
|
||||||
|
|
@ -35,7 +35,7 @@ tokio = { workspace = true, features = ["sync", "time"] }
|
||||||
diesel = { workspace = true, features = ["postgres", "uuid", "chrono", "serde_json", "r2d2"], optional = true }
|
diesel = { workspace = true, features = ["postgres", "uuid", "chrono", "serde_json", "r2d2"], optional = true }
|
||||||
|
|
||||||
# Optional: HTTP Client
|
# Optional: HTTP Client
|
||||||
reqwest = { workspace = true, features = ["json"], optional = true }
|
reqwest = { workspace = true, features = ["json", "rustls-tls"], optional = true }
|
||||||
|
|
||||||
# Optional: Validation
|
# Optional: Validation
|
||||||
validator = { workspace = true, optional = true }
|
validator = { workspace = true, optional = true }
|
||||||
|
|
|
||||||
|
|
@ -98,7 +98,7 @@ impl LocaleBundle {
|
||||||
|
|
||||||
let path = entry.path();
|
let path = entry.path();
|
||||||
|
|
||||||
if path.extension().map_or(false, |ext| ext == "ftl") {
|
if path.extension().is_some_and(|ext| ext == "ftl") {
|
||||||
let content = fs::read_to_string(&path).map_err(|e| {
|
let content = fs::read_to_string(&path).map_err(|e| {
|
||||||
BotError::config(format!(
|
BotError::config(format!(
|
||||||
"failed to read translation file {}: {e}",
|
"failed to read translation file {}: {e}",
|
||||||
|
|
|
||||||
|
|
@ -72,13 +72,11 @@ impl Locale {
|
||||||
) -> &'a Locale {
|
) -> &'a Locale {
|
||||||
for req in requested {
|
for req in requested {
|
||||||
for avail in available {
|
for avail in available {
|
||||||
if req.language == avail.language {
|
if req.language == avail.language && req.region == avail.region {
|
||||||
if req.region == avail.region {
|
|
||||||
return avail;
|
return avail;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
for req in requested {
|
for req in requested {
|
||||||
for avail in available {
|
for avail in available {
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue