From 9ceace2a47f81eafbe47993fabbc8acaf49386ad Mon Sep 17 00:00:00 2001 From: Marek Roszko Date: Mon, 15 Jan 2024 22:08:17 -0500 Subject: [PATCH] Add share/locale to catalog paths on windows (cherry picked from commit fc62d36441ae477f7ec804ac0ad49965dacf525a) --- common/paths.cpp | 11 +++++++++++ common/pgm_base.cpp | 4 ++++ include/paths.h | 6 ++++++ 3 files changed, 21 insertions(+) diff --git a/common/paths.cpp b/common/paths.cpp index 635478d2c9..391a079eb0 100644 --- a/common/paths.cpp +++ b/common/paths.cpp @@ -183,6 +183,17 @@ wxString PATHS::GetStockDataPath( bool aRespectRunFromBuildDir ) } +#ifdef __WXMSW__ +/** + * Gets the stock (install) data path, which is the base path for things like scripting, etc + */ +wxString PATHS::GetWindowsBaseSharePath() +{ + return getWindowsKiCadRoot() + wxT( "share\\" ); +} +#endif + + wxString PATHS::GetStockEDALibraryPath() { wxString path; diff --git a/common/pgm_base.cpp b/common/pgm_base.cpp index 8899927df2..86e2ac51ed 100644 --- a/common/pgm_base.cpp +++ b/common/pgm_base.cpp @@ -814,6 +814,10 @@ wxString PGM_BASE::GetLanguageTag() void PGM_BASE::SetLanguagePath() { +#ifdef _MSC_VER + wxLocale::AddCatalogLookupPathPrefix( PATHS::GetWindowsBaseSharePath() + + wxT( "locale" ) ); +#endif wxLocale::AddCatalogLookupPathPrefix( PATHS::GetLocaleDataPath() ); if( wxGetEnv( wxT( "KICAD_RUN_FROM_BUILD_DIR" ), nullptr ) ) diff --git a/include/paths.h b/include/paths.h index 7dfa9f5d1d..e84398a501 100644 --- a/include/paths.h +++ b/include/paths.h @@ -175,6 +175,12 @@ public: * @return The macOS specific bundle data directory for KiCad */ static wxString GetWindowsFontConfigDir(); + + + /** + * Gets the stock (install) data path, which is the base path for things like scripting, etc + */ + static wxString GetWindowsBaseSharePath(); #endif private: