Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrea Weikert <elubie@gmx.net>2010-07-04 19:35:23 +0400
committerAndrea Weikert <elubie@gmx.net>2010-07-04 19:35:23 +0400
commitca81aa704e958a73a55e79654f70eaa9a0fad85a (patch)
tree8b40e3a7613df4e707fcc8efb3a099f9445ac350 /source/blender/blenfont
parent3ca7b160a664e74c6815056a4a8596bb4c2b70be (diff)
Patch [#22339] File/installation paths changes
Patch Tracker: http://projects.blender.org/tracker/?func=detail&aid=22339&group_id=9&atid=127 This patch implements the proposal outlined here: http://wiki.blender.org/index.php/Dev:2.5/Source/Installation/Proposal Original patch by Matt Ebb. Contributions by Nathan Letwory, Damien Plisson and Andrea Weikert NOTE: This is a work in progress commit, some work still needs to be done on the SCons and CMake files for this to work properly, but at least should compile and the files should be created in the right directory. Commit discussed on IRC with Ton and Campbell.
Diffstat (limited to 'source/blender/blenfont')
-rw-r--r--source/blender/blenfont/intern/blf_lang.c58
1 files changed, 6 insertions, 52 deletions
diff --git a/source/blender/blenfont/intern/blf_lang.c b/source/blender/blenfont/intern/blf_lang.c
index bc2de70222d..1baf2c82ef7 100644
--- a/source/blender/blenfont/intern/blf_lang.c
+++ b/source/blender/blenfont/intern/blf_lang.c
@@ -59,65 +59,19 @@ char global_messagepath[1024];
char global_language[32];
char global_encoding_name[32];
-#if defined(__APPLE__)
-void BLF_lang_init(void) /* Apple Only, todo - use BLI_gethome_folder */
-{
- char *bundlepath;
-
- strcpy(global_encoding_name, SYSTEM_ENCODING_DEFAULT);
-
- /* set messagepath directory */
-#ifndef LOCALEDIR
-#define LOCALEDIR "/usr/share/locale"
-#endif
-
- strcpy(global_messagepath, ".blender/locale");
-
- if (!BLI_exist(global_messagepath)) { /* locale not in current dir */
- BLI_make_file_string("/", global_messagepath, BLI_gethome(), ".blender/locale");
- if (!BLI_exist(global_messagepath)) { /* locale not in home dir */
- /* message catalogs are stored inside the application bundle */
- bundlepath= BLI_getbundle();
- strcpy(global_messagepath, bundlepath);
- strcat(global_messagepath, "/Contents/Resources/locale");
- if (!BLI_exist(global_messagepath)) { /* locale not in bundle (now that's odd..) */
- strcpy(global_messagepath, LOCALEDIR);
-
- if (!BLI_exist(global_messagepath)) { /* locale not in LOCALEDIR */
- strcpy(global_messagepath, "message"); /* old compatibility as last */
- }
- }
- }
- }
-}
-#elif defined(_WIN32)
-void BLF_lang_init(void) /* Windows Only, todo - use BLI_gethome_folder */
+void BLF_lang_init(void)
{
- strcpy(global_encoding_name, SYSTEM_ENCODING_DEFAULT);
+ char *messagepath= BLI_get_folder(BLENDER_DATAFILES, "locale");
- strcpy(global_messagepath, ".blender/locale");
-
- if (!BLI_exist(global_messagepath)) { /* locale not in current dir */
- BLI_make_file_string("/", global_messagepath, BLI_gethome(), ".blender/locale");
-
- if (!BLI_exist(global_messagepath)) { /* locale not in home dir */
- BLI_make_file_string("/", global_messagepath, BLI_gethome(), "/locale");
- }
- }
-}
-#else
-void BLF_lang_init(void) /* not win or mac */
-{
- char *messagepath= BLI_gethome_folder("locale", BLI_GETHOME_ALL);
+ BLI_strncpy(global_encoding_name, SYSTEM_ENCODING_DEFAULT, sizeof(global_encoding_name));
- if(messagepath)
- strncpy(global_messagepath, messagepath, sizeof(global_messagepath));
+ if (messagepath)
+ BLI_strncpy(global_messagepath, messagepath, sizeof(global_messagepath));
else
global_messagepath[0]= '\0';
-
}
-#endif
+
void BLF_lang_set(const char *str)
{