Fix localized display of date and time in the NS port

* src/nsterm.m (ns_init_locale): If not already set, set LC_ALL to the
current locale ID so that dates, currencies, etc. use the settings
configured in the operating system.  (Bug#51321)
This commit is contained in:
Daniel Martín 2021-10-23 14:44:31 +02:00 committed by Eli Zaretskii
parent 335a660b4b
commit 5e05be566b

View file

@ -543,8 +543,10 @@ - (NSColor *)colorUsingDefaultColorSpace
NSString *localeID = [NSString stringWithFormat:@"%@.UTF-8",
[locale localeIdentifier]];
/* Set LANG to locale, but not if LANG is already set. */
/* Set LANG and LC_ALL to locale, but not if the variables are
already set. */
setenv("LANG", [localeID UTF8String], 0);
setenv("LC_ALL", [localeID UTF8String], 0);
}
@catch (NSException *e)
{