From bd64f536503feba0f8893dc063220f263e4341a9 Mon Sep 17 00:00:00 2001
From: Sergey Fedorov <vital.had@gmail.com>
Date: Mon, 1 Dec 2025 15:04:37 +0800
Subject: [PATCH 3/5] uilocale-related backports

548e1ac17bec16ea0a3be394d1da3d96a442c3f8
924fdbfc161d1bc6057b0e46eb756752d850413f
8cf2920e3632ed776004d7ea8a1cb0013474bcc1
b57b9cbe121bf39a410669b6d10cf95ddcc95882
ed9869733dedbccd28fa449b70a1df61c2afe569
---
 build/bakefiles/files.bkl | 6 +++---
 build/cmake/files.cmake   | 6 +++---
 build/files               | 6 +++---
 src/unix/uilocale.cpp     | 5 +++++
 4 files changed, 14 insertions(+), 9 deletions(-)

diff --git a/build/bakefiles/files.bkl b/build/bakefiles/files.bkl
index be5b539168..8ec455431c 100644
--- a/build/bakefiles/files.bkl
+++ b/build/bakefiles/files.bkl
@@ -97,6 +97,7 @@ IMPORTANT: please read docs/tech/tn0016.txt before modifying this file!
 <set var="BASE_UNIX_AND_DARWIN_NOTWXMAC_SRC" hints="files">
     $(BASE_UNIX_AND_DARWIN_SRC)
     src/unix/mimetype.cpp
+    src/unix/uilocale.cpp
 </set>
 
 <set var="BASE_UNIX_AND_DARWIN_NOTWXMAC_HDR" hints="files">
@@ -115,7 +116,6 @@ IMPORTANT: please read docs/tech/tn0016.txt before modifying this file!
     src/unix/fswatcher_inotify.cpp
     src/unix/stdpaths.cpp
     src/unix/secretstore.cpp
-    src/unix/uilocale.cpp
 </set>
 <set var="BASE_UNIX_HDR" hints="files">
     $(BASE_UNIX_AND_DARWIN_NOTWXMAC_HDR)
@@ -189,7 +189,7 @@ IMPORTANT: please read docs/tech/tn0016.txt before modifying this file!
     src/osx/core/strconv_cf.cpp
     src/osx/cocoa/utils_base.mm
     src/osx/core/secretstore.cpp
-    src/osx/core/uilocale.mm
+    src/osx/cocoa/stdpaths.mm
 </set>
 <set var="BASE_COREFOUNDATION_HDR" hints="files">
     wx/osx/core/cfdataref.h
@@ -215,7 +215,7 @@ IMPORTANT: please read docs/tech/tn0016.txt before modifying this file!
     $(BASE_COREFOUNDATION_SRC)
     $(BASE_UNIX_AND_DARWIN_SRC)
     src/osx/fswatcher_fsevents.cpp
-    src/osx/cocoa/stdpaths.mm
+    src/osx/core/uilocale.mm
 </set>
 <set var="BASE_OSX_SHARED_HDR" hints="files">
     $(BASE_COREFOUNDATION_HDR)
diff --git a/build/cmake/files.cmake b/build/cmake/files.cmake
index b6b53cbbfb..0c8671947c 100644
--- a/build/cmake/files.cmake
+++ b/build/cmake/files.cmake
@@ -35,6 +35,7 @@ set(BASE_UNIX_AND_DARWIN_HDR
 set(BASE_UNIX_AND_DARWIN_NOTWXMAC_SRC
     ${BASE_UNIX_AND_DARWIN_SRC}
     src/unix/mimetype.cpp
+    src/unix/uilocale.cpp
 )
 
 set(BASE_UNIX_AND_DARWIN_NOTWXMAC_HDR
@@ -47,7 +48,6 @@ set(BASE_UNIX_SRC
     src/unix/fswatcher_inotify.cpp
     src/unix/secretstore.cpp
     src/unix/stdpaths.cpp
-    src/unix/uilocale.cpp
 )
 
 set(BASE_UNIX_HDR
@@ -116,7 +116,7 @@ set(BASE_COREFOUNDATION_SRC
     src/osx/core/secretstore.cpp
     src/osx/core/strconv_cf.cpp
     src/osx/cocoa/utils_base.mm
-    src/osx/core/uilocale.mm
+    src/osx/cocoa/stdpaths.mm
 )
 
 set(BASE_COREFOUNDATION_HDR
@@ -141,9 +141,9 @@ set(BASE_COREFOUNDATION_HDR
 set(BASE_OSX_SHARED_SRC
     src/osx/core/mimetype.cpp
     src/osx/fswatcher_fsevents.cpp
-    src/osx/cocoa/stdpaths.mm
     ${BASE_COREFOUNDATION_SRC}
     ${BASE_UNIX_AND_DARWIN_SRC}
+    src/osx/core/uilocale.mm
 )
 
 set(BASE_OSX_SHARED_HDR
diff --git a/build/files b/build/files
index e92a5d7432..9eaddb8002 100644
--- a/build/files
+++ b/build/files
@@ -57,6 +57,7 @@ BASE_UNIX_AND_DARWIN_HDR =
 BASE_UNIX_AND_DARWIN_NOTWXMAC_SRC =
     $(BASE_UNIX_AND_DARWIN_SRC)
     src/unix/mimetype.cpp
+    src/unix/uilocale.cpp
 
 BASE_UNIX_AND_DARWIN_NOTWXMAC_HDR =
     $(BASE_UNIX_AND_DARWIN_HDR)
@@ -71,7 +72,6 @@ BASE_UNIX_SRC =
     src/unix/fswatcher_inotify.cpp
     src/unix/secretstore.cpp
     src/unix/stdpaths.cpp
-    src/unix/uilocale.cpp
 
 BASE_UNIX_HDR =
     $(BASE_UNIX_AND_DARWIN_NOTWXMAC_HDR)
@@ -141,7 +141,7 @@ BASE_COREFOUNDATION_SRC =
     src/osx/core/evtloop_cf.cpp
     src/osx/core/secretstore.cpp
     src/osx/core/strconv_cf.cpp
-    src/osx/core/uilocale.mm
+    src/osx/cocoa/stdpaths.mm
     src/osx/cocoa/utils_base.mm
 
 BASE_COREFOUNDATION_HDR =
@@ -164,8 +164,8 @@ BASE_COREFOUNDATION_HDR =
 # Base files used by OS X ports (not Carbon)
 BASE_OSX_SHARED_SRC =
     src/osx/core/mimetype.cpp
+    src/osx/core/uilocale.mm
     src/osx/fswatcher_fsevents.cpp
-    src/osx/cocoa/stdpaths.mm
     $(BASE_COREFOUNDATION_SRC)
     $(BASE_UNIX_AND_DARWIN_SRC)
 
diff --git a/src/unix/uilocale.cpp b/src/unix/uilocale.cpp
index 4aaebee4a5..b05d77ca85 100644
--- a/src/unix/uilocale.cpp
+++ b/src/unix/uilocale.cpp
@@ -21,6 +21,11 @@
 #if wxUSE_INTL
 
 #include <locale.h>
+
+#ifdef HAVE_XLOCALE_H
+    #include <xlocale.h>
+#endif
+
 #ifdef HAVE_LANGINFO_H
     #include <langinfo.h>
 #endif
-- 
2.24.3 (Apple Git-128)

