churchyard / rpms / blender

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