diff --git a/Cargo.lock b/Cargo.lock index 0165d09..f7f342a 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2713,9 +2713,6 @@ dependencies = [ [[package]] name = "kifu-l10n" version = "0.1.0" -dependencies = [ - "messages-codegen", -] [[package]] name = "kv-log-macro" @@ -2732,12 +2729,15 @@ version = "0.1.0" dependencies = [ "chrono", "chrono-tz", + "convert_case", "fixed_decimal", "fluent", "fluent-ergonomics", "icu", "icu_locid", "icu_provider", + "serde 1.0.193", + "serde_yaml", "sys-locale", "unic-langid", ] @@ -2917,17 +2917,6 @@ dependencies = [ "tokio", ] -[[package]] -name = "messages-codegen" -version = "0.1.0" -dependencies = [ - "convert_case", - "quote", - "serde 1.0.193", - "serde_yaml", - "syn 2.0.48", -] - [[package]] name = "mime" version = "0.2.6" diff --git a/l10n/Cargo.toml b/l10n/Cargo.toml index 3c7d58a..305ae27 100644 --- a/l10n/Cargo.toml +++ b/l10n/Cargo.toml @@ -8,12 +8,15 @@ edition = "2021" [dependencies] chrono = { version = "0.4" } chrono-tz = { version = "0.8" } +convert_case = { version = "0.6" } fixed_decimal = { version = "0.5.5", features = [ "ryu" ] } fluent = { version = "0.16" } fluent-ergonomics = { path = "../fluent-ergonomics" } icu = { version = "1" } icu_locid = { version = "1" } icu_provider = { version = "1" } +serde = { version = "1" } +serde_yaml = { version = "0.9" } sys-locale = { version = "0.3" } unic-langid = { version = "*" } diff --git a/l10n/src/bin/codegen-rust.rs b/l10n/src/bin/codegen-rust.rs index 57bd009..ea40532 100644 --- a/l10n/src/bin/codegen-rust.rs +++ b/l10n/src/bin/codegen-rust.rs @@ -1,7 +1,7 @@ use convert_case::{Case, Casing}; use serde::Deserialize; use serde_yaml; -use std::{collections::HashMap, fmt, fs::File}; +use std::{collections::HashMap, fmt, fs::File, env}; #[derive(Debug, Clone, Deserialize)] struct MessageJS { @@ -121,8 +121,11 @@ impl Message { } fn main() { + let mut args = env::args(); + let _ = args.next(); + let input_file = args.next().unwrap(); let messages: HashMap = - serde_yaml::from_reader(File::open("test-data/messages.yaml").unwrap()).unwrap(); + serde_yaml::from_reader(File::open(input_file).unwrap()).unwrap(); let messages = messages .into_iter()