|
|
@@ -57,9 +57,11 @@ fn resolve_config_path(cli_config: &str) -> std::path::PathBuf {
|
|
|
|
|
|
#[tokio::main]
|
|
|
async fn main() -> Result<()> {
|
|
|
- // Locale: check LANG env var first (works on macOS where sys-locale
|
|
|
- // reads system prefs instead of the env), fall back to auto-detect.
|
|
|
- let locale = std::env::var("LANG").ok();
|
|
|
+ // Locale: check LANG env var first (macOS sys-locale ignores it).
|
|
|
+ // Normalize "ru_RU.UTF-8" → "ru-RU" for unic-langid.
|
|
|
+ let locale = std::env::var("LANG").ok().map(|l| {
|
|
|
+ l.split('.').next().unwrap_or(&l).replace('_', "-")
|
|
|
+ });
|
|
|
let _ = fluent_i18n::set_locale(locale.as_deref());
|
|
|
tracing_subscriber::fmt::init();
|
|
|
let cli = Cli::parse();
|