roblox_slang/lib.rs
1//! # Roblox Slang
2//!
3//! Type-safe internationalization (i18n) for Roblox experiences.
4//!
5//! Roblox Slang is a CLI tool and library that generates type-safe Luau code
6//! from translation files, enabling autocomplete and compile-time validation
7//! for game localization.
8//!
9//! ## Features
10//!
11//! - **Type-safe translations**: Generate Luau code with full autocomplete support
12//! - **Multiple input formats**: JSON, YAML, and CSV
13//! - **Pluralization**: CLDR-compliant plural rules for all languages
14//! - **String interpolation**: Type-safe parameter substitution
15//! - **Roblox Cloud integration**: Upload/download translations to Roblox Cloud
16//! - **Watch mode**: Auto-rebuild on file changes
17//! - **Validation**: Detect missing keys, conflicts, and coverage issues
18//!
19//! ## Quick Start
20//!
21//! ```bash
22//! # Initialize a new project
23//! roblox-slang init
24//!
25//! # Build translations
26//! roblox-slang build
27//!
28//! # Watch for changes
29//! roblox-slang build --watch
30//! ```
31//!
32//! ## Library Usage
33//!
34//! ```no_run
35//! use roblox_slang::{Config, parser, generator, config};
36//! use std::path::Path;
37//!
38//! # fn main() -> anyhow::Result<()> {
39//! // Load configuration
40//! let cfg = config::load_config(Path::new("slang-roblox.yaml"))?;
41//!
42//! // Parse translations
43//! let translations = parser::json::parse_json_file(
44//! Path::new("translations/en.json"),
45//! "en"
46//! )?;
47//!
48//! // Generate Luau code
49//! let luau_code = generator::luau::generate_luau(&translations, &cfg.base_locale)?;
50//! # Ok(())
51//! # }
52//! ```
53//!
54//! ## Modules
55//!
56//! - [`cli`]: Command-line interface implementation
57//! - [`config`]: Configuration file parsing and validation
58//! - [`generator`]: Luau code and CSV generation
59//! - [`migrator`]: Migration from other i18n formats
60//! - [`parser`]: Translation file parsing (JSON, YAML, CSV)
61//! - [`utils`]: Utility functions (flattening, validation, etc.)
62//! - [`validator`]: Translation validation and analysis
63
64pub mod cli;
65pub mod config;
66pub mod generator;
67pub mod migrator;
68pub mod parser;
69pub mod roblox;
70pub mod utils;
71pub mod validator;
72
73// Re-export commonly used types
74pub use config::Config;
75pub use parser::types::Translation;