diff -Naur blender-2.79.old/source/blender/blenkernel/BKE_appdir.h blender-2.79/source/blender/blenkernel/BKE_appdir.h
--- blender-2.79.old/source/blender/blenkernel/BKE_appdir.h 2017-09-12 05:44:17.000000000 +0200
+++ blender-2.79/source/blender/blenkernel/BKE_appdir.h 2017-09-12 14:18:41.069008086 +0200
@@ -71,6 +71,7 @@
BLENDER_SYSTEM_DATAFILES = 52,
BLENDER_SYSTEM_SCRIPTS = 53,
BLENDER_SYSTEM_PYTHON = 54,
+ BLENDER_SYSTEM_LOCALE = 55,
};
/* for BKE_appdir_folder_id_version only */
diff -Naur blender-2.79.old/source/blender/blenkernel/intern/appdir.c blender-2.79/source/blender/blenkernel/intern/appdir.c
--- blender-2.79.old/source/blender/blenkernel/intern/appdir.c 2017-09-12 05:44:17.000000000 +0200
+++ blender-2.79/source/blender/blenkernel/intern/appdir.c 2017-09-12 14:18:41.070008105 +0200
@@ -421,6 +421,9 @@
if (get_path_system(path, path_len, "python", subfolder, "BLENDER_SYSTEM_PYTHON", ver)) break;
return NULL;
+ case BLENDER_SYSTEM_LOCALE:
+ BLI_strncpy(path, "/usr/share/locale", FILE_MAX); break;
+
default:
BLI_assert(0);
break;
diff -Naur blender-2.79.old/source/blender/blentranslation/intern/blt_lang.c blender-2.79/source/blender/blentranslation/intern/blt_lang.c
--- blender-2.79.old/source/blender/blentranslation/intern/blt_lang.c 2017-09-11 06:34:59.000000000 +0200
+++ blender-2.79/source/blender/blentranslation/intern/blt_lang.c 2017-09-12 14:18:41.070008105 +0200
@@ -88,9 +88,9 @@
num_locales = num_locales_menu = 0;
}
-static void fill_locales(void)
+static void fill_locales(char *locale_path)
{
- const char * const languages_path = BKE_appdir_folder_id(BLENDER_DATAFILES, "locale");
+ const char * const languages_path = locale_path;
char languages[FILE_MAX];
LinkNode *lines = NULL, *line;
char *str;
@@ -98,7 +98,7 @@
free_locales();
- BLI_join_dirfile(languages, FILE_MAX, languages_path, "languages");
+ BLI_join_dirfile(languages, FILE_MAX, locale_path, "languages");
line = lines = BLI_file_read_as_lines(languages);
/* This whole "parsing" code is a bit weak, in that it expects strictly formatted input file...
@@ -198,7 +198,7 @@
void BLT_lang_init(void)
{
#ifdef WITH_INTERNATIONAL
- const char * const messagepath = BKE_appdir_folder_id(BLENDER_DATAFILES, "locale");
+ const char * const messagepath = BKE_appdir_folder_id(BLENDER_SYSTEM_LOCALE, NULL);
#endif
/* Make sure LANG is correct and wouldn't cause std::rumtime_error. */
@@ -231,7 +231,7 @@
#ifdef WITH_INTERNATIONAL
if (messagepath) {
bl_locale_init(messagepath, TEXT_DOMAIN_NAME);
- fill_locales();
+ fill_locales(messagepath);
}
else {
printf("%s: 'locale' data path for translations not found, continuing\n", __func__);
diff -Naur blender-2.79.old/source/creator/CMakeLists.txt blender-2.79/source/creator/CMakeLists.txt
--- blender-2.79.old/source/creator/CMakeLists.txt 2017-09-12 14:18:20.233618882 +0200
+++ blender-2.79/source/creator/CMakeLists.txt 2017-09-12 14:18:41.070008105 +0200
@@ -364,7 +364,7 @@
)
set(_locale_dir "${CMAKE_SOURCE_DIR}/release/datafiles/locale")
- set(_locale_target_dir ${TARGETDIR_VER}/datafiles/locale)
+ set(_locale_target_dir ${CMAKE_INSTALL_PREFIX}/share/locale)
file(GLOB _po_files "${_locale_dir}/po/*.po")
foreach(_po_file ${_po_files})