MCPcopy Create free account
hub / github.com/OpenTTD/OpenTTD / MacOSSetCurrentLocaleName

Function MacOSSetCurrentLocaleName

src/os/macosx/string_osx.cpp:316–322  ·  view source on GitHub ↗

Store current language locale as a CoreFoundation locale. */

Source from the content-addressed store, hash-verified

314
315/** Store current language locale as a CoreFoundation locale. */
316void MacOSSetCurrentLocaleName(std::string_view iso_code)
317{
318 if (!MacOSVersionIsAtLeast(10, 5, 0)) return;
319
320 CFAutoRelease<CFStringRef> iso(CFStringCreateWithBytes(kCFAllocatorDefault, reinterpret_cast<const UInt8 *>(iso_code.data()), iso_code.size(), kCFStringEncodingUTF8, false));
321 _osx_locale.reset(CFLocaleCreate(kCFAllocatorDefault, iso.get()));
322}
323
324/**
325 * Compares two strings using case insensitive natural sort.

Callers 1

ReadLanguagePackFunction · 0.85

Calls 5

MacOSVersionIsAtLeastFunction · 0.85
dataMethod · 0.45
sizeMethod · 0.45
resetMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected