move voxygen/i18n to client/i18n to indicate that it can be used by more frontends if they want to make use of our helpers

This commit is contained in:
Marcel Märtens 2022-09-27 14:09:20 +02:00
parent 7f46bc5b78
commit 81cdcfc1a0
14 changed files with 33 additions and 31 deletions

42
Cargo.lock generated
View File

@ -6675,6 +6675,7 @@ dependencies = [
"tokio", "tokio",
"tracing", "tracing",
"vek 0.15.8", "vek 0.15.8",
"veloren-client-i18n",
"veloren-common", "veloren-common",
"veloren-common-base", "veloren-common-base",
"veloren-common-ecs", "veloren-common-ecs",
@ -6683,10 +6684,27 @@ dependencies = [
"veloren-common-state", "veloren-common-state",
"veloren-common-systems", "veloren-common-systems",
"veloren-network", "veloren-network",
"veloren-voxygen-i18n",
"veloren-voxygen-i18n-helpers", "veloren-voxygen-i18n-helpers",
] ]
[[package]]
name = "veloren-client-i18n"
version = "0.13.0"
dependencies = [
"clap 3.2.22",
"deunicode",
"fluent",
"fluent-bundle",
"fluent-syntax",
"hashbrown 0.12.3",
"intl-memoizer",
"ron 0.8.0",
"serde",
"tracing",
"unic-langid",
"veloren-common-assets",
]
[[package]] [[package]]
name = "veloren-common" name = "veloren-common"
version = "0.10.0" version = "0.10.0"
@ -7082,6 +7100,7 @@ dependencies = [
"treeculler", "treeculler",
"vek 0.15.8", "vek 0.15.8",
"veloren-client", "veloren-client",
"veloren-client-i18n",
"veloren-common", "veloren-common",
"veloren-common-base", "veloren-common-base",
"veloren-common-ecs", "veloren-common-ecs",
@ -7092,7 +7111,6 @@ dependencies = [
"veloren-server", "veloren-server",
"veloren-voxygen-anim", "veloren-voxygen-anim",
"veloren-voxygen-egui", "veloren-voxygen-egui",
"veloren-voxygen-i18n",
"veloren-voxygen-i18n-helpers", "veloren-voxygen-i18n-helpers",
"veloren-world", "veloren-world",
"wgpu", "wgpu",
@ -7126,32 +7144,14 @@ dependencies = [
"veloren-common-dynlib", "veloren-common-dynlib",
] ]
[[package]]
name = "veloren-voxygen-i18n"
version = "0.13.0"
dependencies = [
"clap 3.2.22",
"deunicode",
"fluent",
"fluent-bundle",
"fluent-syntax",
"hashbrown 0.12.3",
"intl-memoizer",
"ron 0.8.0",
"serde",
"tracing",
"unic-langid",
"veloren-common-assets",
]
[[package]] [[package]]
name = "veloren-voxygen-i18n-helpers" name = "veloren-voxygen-i18n-helpers"
version = "0.10.0" version = "0.10.0"
dependencies = [ dependencies = [
"tracing", "tracing",
"veloren-client-i18n",
"veloren-common", "veloren-common",
"veloren-common-net", "veloren-common-net",
"veloren-voxygen-i18n",
] ]
[[package]] [[package]]

View File

@ -12,6 +12,7 @@ members = [
"common/systems", "common/systems",
"common/frontend", "common/frontend",
"client", "client",
"client/i18n",
"plugin/api", "plugin/api",
"plugin/derive", "plugin/derive",
"plugin/rt", "plugin/rt",
@ -21,7 +22,6 @@ members = [
"voxygen", "voxygen",
"voxygen/anim", "voxygen/anim",
"voxygen/i18n-helpers", "voxygen/i18n-helpers",
"voxygen/i18n",
"voxygen/egui", "voxygen/egui",
"world", "world",
"network", "network",

View File

@ -7,7 +7,7 @@ edition = "2021"
[features] [features]
simd = ["vek/platform_intrinsics"] simd = ["vek/platform_intrinsics"]
plugins = ["common-state/plugins"] plugins = ["common-state/plugins"]
bin_bot = ["common-ecs", "serde", "ron", "clap", "structopt", "rustyline", "common-frontend", "async-channel", "voxygen-i18n-helpers", "voxygen-i18n"] bin_bot = ["common-ecs", "serde", "ron", "clap", "structopt", "rustyline", "common-frontend", "async-channel", "voxygen-i18n-helpers", "client-i18n"]
tracy = ["common-base/tracy"] tracy = ["common-base/tracy"]
tick_network = [] tick_network = []
@ -38,7 +38,7 @@ authc = { git = "https://gitlab.com/veloren/auth.git", rev = "fb3dcbc4962b367253
async-channel = { version = "1.6", optional = true } async-channel = { version = "1.6", optional = true }
common-ecs = { package = "veloren-common-ecs", path = "../common/ecs", optional = true } common-ecs = { package = "veloren-common-ecs", path = "../common/ecs", optional = true }
voxygen-i18n-helpers = { package = "veloren-voxygen-i18n-helpers", path = "../voxygen/i18n-helpers", optional = true } voxygen-i18n-helpers = { package = "veloren-voxygen-i18n-helpers", path = "../voxygen/i18n-helpers", optional = true }
voxygen-i18n = { package = "veloren-voxygen-i18n", path = "../voxygen/i18n", optional = true } client-i18n = { package = "veloren-client-i18n", path = "i18n", optional = true }
serde = { version = "1.0", features = [ "rc", "derive" ], optional = true } serde = { version = "1.0", features = [ "rc", "derive" ], optional = true }
ron = { version = "0.8", default-features = false, optional = true } ron = { version = "0.8", default-features = false, optional = true }
clap = { version = "3.1.8", optional = true, features = ["color", "std"] } clap = { version = "3.1.8", optional = true, features = ["color", "std"] }
@ -50,7 +50,7 @@ common-frontend = { package = "veloren-common-frontend", path = "../common/front
[dev-dependencies] [dev-dependencies]
voxygen-i18n-helpers = { package = "veloren-voxygen-i18n-helpers", path = "../voxygen/i18n-helpers" } voxygen-i18n-helpers = { package = "veloren-voxygen-i18n-helpers", path = "../voxygen/i18n-helpers" }
voxygen-i18n = { package = "veloren-voxygen-i18n", path = "../voxygen/i18n" } client-i18n = { package = "veloren-client-i18n", path = "i18n" }
[[example]] [[example]]
name = "chat-cli" name = "chat-cli"

View File

@ -1,6 +1,7 @@
#![deny(unsafe_code)] #![deny(unsafe_code)]
#![deny(clippy::clone_on_ref_ptr)] #![deny(clippy::clone_on_ref_ptr)]
use client_i18n::LocalizationHandle;
use common::{clock::Clock, comp}; use common::{clock::Clock, comp};
use std::{ use std::{
io, io,
@ -31,7 +32,7 @@ fn main() {
info!("loading localisation"); info!("loading localisation");
let localisation = voxygen_i18n::LocalizationHandle::load_expect("en"); let localisation = LocalizationHandle::load_expect("en");
info!("Starting chat-cli..."); info!("Starting chat-cli...");

View File

@ -1,8 +1,8 @@
[package] [package]
authors = ["juliancoffee <lightdarkdaughter@gmail.com>"] authors = ["juliancoffee <lightdarkdaughter@gmail.com>"]
edition = "2021" edition = "2021"
name = "veloren-voxygen-i18n" name = "veloren-client-i18n"
description = "Crate for internalization and diagnostic of existing localizations." description = "Optional crate for internalization and diagnostic of existing localizations for frontends to consume"
version = "0.13.0" version = "0.13.0"
[dependencies] [dependencies]

View File

@ -2816,6 +2816,7 @@ impl Drop for Client {
#[cfg(test)] #[cfg(test)]
mod tests { mod tests {
use super::*; use super::*;
use client_i18n::LocalizationHandle;
#[test] #[test]
/// THIS TEST VERIFIES THE CONSTANT API. /// THIS TEST VERIFIES THE CONSTANT API.
@ -2845,7 +2846,7 @@ mod tests {
password, password,
|suggestion: &str| suggestion == auth_server, |suggestion: &str| suggestion == auth_server,
)); ));
let localisation = voxygen_i18n::LocalizationHandle::load_expect("en"); let localisation = LocalizationHandle::load_expect("en");
let _ = veloren_client.map(|mut client| { let _ = veloren_client.map(|mut client| {
//clock //clock

View File

@ -49,7 +49,7 @@ common-systems = {package = "veloren-common-systems", path = "../common/systems"
common-state = {package = "veloren-common-state", path = "../common/state"} common-state = {package = "veloren-common-state", path = "../common/state"}
anim = {package = "veloren-voxygen-anim", path = "anim"} anim = {package = "veloren-voxygen-anim", path = "anim"}
i18n = {package = "veloren-voxygen-i18n", path = "i18n"} i18n = {package = "veloren-client-i18n", path = "../client/i18n"}
i18n-helpers = {package = "veloren-voxygen-i18n-helpers", path = "i18n-helpers"} i18n-helpers = {package = "veloren-voxygen-i18n-helpers", path = "i18n-helpers"}
voxygen-egui = {package = "veloren-voxygen-egui", path = "egui", optional = true } voxygen-egui = {package = "veloren-voxygen-egui", path = "egui", optional = true }

View File

@ -8,6 +8,6 @@ version = "0.10.0"
[dependencies] [dependencies]
common-net = {package = "veloren-common-net", path = "../../common/net"} common-net = {package = "veloren-common-net", path = "../../common/net"}
common = {package = "veloren-common", path = "../../common"} common = {package = "veloren-common", path = "../../common"}
i18n = {package = "veloren-voxygen-i18n", path = "../i18n"} i18n = {package = "veloren-client-i18n", path = "../../client/i18n"}
# Utility # Utility
tracing = "0.1" tracing = "0.1"