diff -Naur blender-2.78a.old/source/blender/blenkernel/BKE_appdir.h blender-2.78a/source/blender/blenkernel/BKE_appdir.h
--- blender-2.78a.old/source/blender/blenkernel/BKE_appdir.h 2017-01-29 23:04:06.554693018 +0100
+++ blender-2.78a/source/blender/blenkernel/BKE_appdir.h 2017-01-29 23:08:38.102468829 +0100
@@ -67,6 +67,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.78a.old/source/blender/blenkernel/intern/appdir.c blender-2.78a/source/blender/blenkernel/intern/appdir.c
--- blender-2.78a.old/source/blender/blenkernel/intern/appdir.c 2017-01-29 23:04:06.556693053 +0100
+++ blender-2.78a/source/blender/blenkernel/intern/appdir.c 2017-01-29 23:08:38.103468846 +0100
@@ -398,6 +398,9 @@
if (get_path_system(path, "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.78a.old/source/blender/blentranslation/intern/blt_lang.c blender-2.78a/source/blender/blentranslation/intern/blt_lang.c
--- blender-2.78a.old/source/blender/blentranslation/intern/blt_lang.c 2017-01-29 23:04:06.566693229 +0100
+++ blender-2.78a/source/blender/blentranslation/intern/blt_lang.c 2017-01-29 23:08:38.104468864 +0100
@@ -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.78a.old/source/creator/CMakeLists.txt blender-2.78a/source/creator/CMakeLists.txt
--- blender-2.78a.old/source/creator/CMakeLists.txt 2017-01-29 23:08:17.342103709 +0100
+++ blender-2.78a/source/creator/CMakeLists.txt 2017-01-29 23:09:04.788938173 +0100
@@ -376,7 +376,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})