Skip to content

Commit 4d6b93a

Browse files
committed
remove i18n as feature
1 parent 70f6c09 commit 4d6b93a

File tree

6 files changed

+68
-80
lines changed

6 files changed

+68
-80
lines changed

.github/workflows/l10n.yml

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,9 @@ jobs:
3333
fail-fast: false
3434
matrix:
3535
job:
36-
- { os: ubuntu-latest , features: "feat_os_unix,i18n" }
37-
- { os: macos-latest , features: "feat_os_macos,i18n" }
38-
- { os: windows-latest , features: "feat_os_windows,i18n" }
36+
- { os: ubuntu-latest , features: "feat_os_unix" }
37+
- { os: macos-latest , features: "feat_os_macos" }
38+
- { os: windows-latest , features: "feat_os_windows" }
3939
steps:
4040
- uses: actions/checkout@v4
4141
with:
@@ -68,8 +68,8 @@ jobs:
6868
shell: bash
6969
run: |
7070
## Test l10n functionality
71-
cargo test --features i18n -p uucore locale
72-
cargo test --features i18n
71+
cargo test -p uucore locale
72+
cargo test
7373
env:
7474
RUST_BACKTRACE: "1"
7575

@@ -203,18 +203,12 @@ jobs:
203203
run: |
204204
## Test different l10n feature combinations
205205
206-
echo "Testing with i18n feature enabled..."
207-
cargo check --features "i18n" -p uucore
208-
209-
echo "Testing with i18n feature disabled (no feature flag)..."
206+
echo "Testing with i18n enabled by default..."
210207
cargo check -p uucore
211208
212209
echo "Testing with disable_i18n feature..."
213210
cargo check --features "disable_i18n" -p uucore
214211
215-
echo "Testing conflicting features (should work, disable_i18n takes precedence)..."
216-
cargo check --features "i18n,disable_i18n" -p uucore
217-
218212
echo "All feature combinations compiled successfully"
219213
env:
220214
RUST_BACKTRACE: "1"

Cargo.toml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,8 +65,6 @@ feat_selinux = [
6565
# * All utilities will use hardcoded English strings regardless of system locale
6666
# * Automatically disables uucore's default i18n feature
6767
disable_i18n = ["uucore/disable_i18n"]
68-
# i18n support (enabled by default via uucore)
69-
i18n = ["uucore/i18n"]
7068
##
7169
## feature sets
7270
## (common/core and Tier1) feature sets

src/bin/coreutils.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ fn find_prefixed_util<'a>(
8383
fn setup_localization_or_exit(util_name: &str) {
8484
locale::setup_localization(get_canonical_util_name(util_name)).unwrap_or_else(|err| {
8585
match err {
86-
#[cfg(all(feature = "i18n", not(feature = "disable_i18n")))]
86+
#[cfg(not(feature = "disable_i18n"))]
8787
uucore::locale::LocalizationError::ParseResource {
8888
error: err_msg,
8989
snippet,

src/uucore/Cargo.toml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -101,9 +101,7 @@ windows-sys = { workspace = true, optional = true, default-features = false, fea
101101
utmp-classic = { workspace = true, optional = true }
102102

103103
[features]
104-
default = ["i18n"]
105-
# i18n support (enabled by default, disabled when disable_i18n is used)
106-
i18n = ["fluent-bundle", "fluent", "fluent-syntax", "unic-langid"]
104+
default = []
107105
# disable_i18n disables translations and embeds English strings directly
108106
disable_i18n = []
109107
# * non-default features

src/uucore/src/lib/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,7 @@ macro_rules! bin {
184184
)))
185185
.unwrap_or_else(|err| {
186186
match err {
187-
#[cfg(all(feature = "i18n", not(feature = "disable_i18n")))]
187+
#[cfg(not(feature = "disable_i18n"))]
188188
uucore::locale::LocalizationError::ParseResource {
189189
error: err_msg,
190190
snippet,

0 commit comments

Comments
 (0)