We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 66e7f8c commit c556ee0Copy full SHA for c556ee0
src/uucore/src/lib/features/i18n/month.rs
@@ -44,7 +44,14 @@ fn get_month_names() -> &'static Vec<(String, u8)> {
44
static MONTH_NAMES: OnceLock<Vec<(String, u8)>> = OnceLock::new();
45
MONTH_NAMES.get_or_init(|| {
46
let loc = get_time_locale().0.clone();
47
- load_month_names(&loc)
+ // For undefined locale (C/POSIX), ICU returns generic month names like "M01", "M02"
48
+ // which aren't useful for matching. Skip directly to English fallback.
49
+ let result = if loc == locale!("und") {
50
+ None
51
+ } else {
52
+ load_month_names(&loc)
53
+ };
54
+ result
55
.or_else(|| load_month_names(&locale!("en")))
56
.expect("ICU should always have English month data")
57
})
0 commit comments