kanarip / rpms / blender

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