|
7 | 7 | // SPDX-License-Identifier: MIT |
8 | 8 | // |
9 | 9 |
|
| 10 | +use core::str::FromStr; |
| 11 | +use std::collections::{BTreeMap, BTreeSet}; |
| 12 | +use std::ffi::OsString; |
| 13 | +use std::io::Read; |
| 14 | +use std::path::{Path, PathBuf}; |
| 15 | +use std::sync::atomic::Ordering::Relaxed; |
| 16 | +use std::{env, fs, io, process}; |
| 17 | + |
10 | 18 | use clap::Parser; |
11 | 19 | use const_format::formatcp; |
12 | | -use core::str::FromStr; |
13 | | -use gettextrs::{bind_textdomain_codeset, gettext, textdomain}; |
14 | | -use plib::PROJECT_NAME; |
| 20 | +use gettextrs::{bind_textdomain_codeset, gettext, setlocale, textdomain, LocaleCategory}; |
| 21 | + |
15 | 22 | use posixutils_make::{ |
16 | 23 | config::Config, |
17 | 24 | error_code::ErrorCode::{self, *}, |
18 | 25 | parser::{preprocessor::ENV_MACROS, Makefile}, |
19 | 26 | Make, |
20 | 27 | }; |
21 | | -use std::sync::atomic::Ordering::Relaxed; |
22 | | -use std::{ |
23 | | - collections::{BTreeMap, BTreeSet}, |
24 | | - env, |
25 | | - ffi::OsString, |
26 | | - fs, |
27 | | - io::{self, Read}, |
28 | | - path::{Path, PathBuf}, |
29 | | - process, |
30 | | -}; |
31 | 28 |
|
32 | 29 | const MAKEFILE_NAME: [&str; 2] = ["makefile", "Makefile"]; |
33 | 30 | const MAKEFILE_PATH: [&str; 2] = [ |
@@ -111,8 +108,9 @@ struct Args { |
111 | 108 | } |
112 | 109 |
|
113 | 110 | fn main() -> Result<(), Box<dyn std::error::Error>> { |
114 | | - textdomain(PROJECT_NAME)?; |
115 | | - bind_textdomain_codeset(PROJECT_NAME, "UTF-8")?; |
| 111 | + setlocale(LocaleCategory::LcAll, ""); |
| 112 | + textdomain(env!("PROJECT_NAME"))?; |
| 113 | + bind_textdomain_codeset(env!("PROJECT_NAME"), "UTF-8")?; |
116 | 114 |
|
117 | 115 | let Args { |
118 | 116 | directory, |
|
0 commit comments