diff --git a/src/cmake_config.h.in b/src/cmake_config.h.in
index 04f368594e750517603ac27ccecb8872d7abd1dd..bda7a891abc5ba7b26a747b1701cb3fbb544a751 100644
--- a/src/cmake_config.h.in
+++ b/src/cmake_config.h.in
@@ -12,6 +12,7 @@
 #define VERSION_STRING "@VERSION_STRING@"
 #define PRODUCT_VERSION_STRING "@VERSION_MAJOR@.@VERSION_MINOR@"
 #define STATIC_SHAREDIR "@SHAREDIR@"
+#define STATIC_LOCALEDIR "@LOCALEDIR@"
 #define BUILD_TYPE "@CMAKE_BUILD_TYPE@"
 #cmakedefine01 RUN_IN_PLACE
 #cmakedefine01 USE_GETTEXT
diff --git a/src/main.cpp b/src/main.cpp
index 950d30b5a21607c08f8cb182d758d9971c4d6392..dece274280cd29d8bb46a10a017b374e1d641ad1 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -472,10 +472,10 @@ static bool init_common(int *log_level, const Settings &cmd_args, int argc, char
 	httpfetch_init(g_settings->getS32("curl_parallel_limit"));
 
 #ifdef _MSC_VER
-	init_gettext((porting::path_share + DIR_DELIM + "locale").c_str(),
+	init_gettext(porting::path_locale.c_str(),
 		g_settings->get("language"), argc, argv);
 #else
-	init_gettext((porting::path_share + DIR_DELIM + "locale").c_str(),
+	init_gettext(porting::path_locale.c_str(),
 		g_settings->get("language"));
 #endif
 
diff --git a/src/porting.cpp b/src/porting.cpp
index cb9f3270bea76533a9214d8dce50fd25701eccbb..5fea1d9cf4dc259ae2fd50a542ddcf1123d57f77 100644
--- a/src/porting.cpp
+++ b/src/porting.cpp
@@ -136,6 +136,8 @@ void signal_handler_init(void)
 // Default to RUN_IN_PLACE style relative paths
 std::string path_share = "..";
 std::string path_user = "..";
+std::string path_locale = path_share + DIR_DELIM + "locale";
+
 
 std::string getDataPath(const char *subpath)
 {
@@ -503,13 +505,17 @@ void initializePaths()
 		path_share = execpath;
 		path_user  = execpath;
 	}
-
 #else
 	infostream << "Using system-wide paths (NOT RUN_IN_PLACE)" << std::endl;
 
 	if (!setSystemPaths())
 		errorstream << "Failed to get one or more system-wide path" << std::endl;
 
+#endif
+#ifdef STATIC_LOCALEDIR
+	path_locale = STATIC_LOCALEDIR[0] ? STATIC_LOCALEDIR : getDataPath("locale");
+#else
+	path_locale = getDataPath("locale");
 #endif
 
 	infostream << "Detected share path: " << path_share << std::endl;
diff --git a/src/porting.h b/src/porting.h
index a4016e8d7b43e5ee4e4e6587cbb9c2b1bc83cdf2..a86d37fbb91a50dcc1fc1381959ad34a8640f7c1 100644
--- a/src/porting.h
+++ b/src/porting.h
@@ -142,6 +142,11 @@ extern std::string path_share;
 */
 extern std::string path_user;
 
+/*
+	Path to gettext locale files
+*/
+extern std::string path_locale;
+
 /*
 	Get full path of stuff in data directory.
 	Example: "stone.png" -> "../data/stone.png"
@@ -149,7 +154,7 @@ extern std::string path_user;
 std::string getDataPath(const char *subpath);
 
 /*
-	Initialize path_share and path_user.
+	Initialize path_*.
 */
 void initializePaths();