diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2011-09-15 17:20:18 +0400 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2011-09-15 17:20:18 +0400 |
commit | 0eda51f2eabe24016efdc8f07825f1ba667cac33 (patch) | |
tree | 03d6f876da6b1256b8890b89db09b63952fa544f /source/blender/windowmanager/intern/wm_files.c | |
parent | 30293dc2ca8052ad0c7113c77365feca590f4d05 (diff) |
Fixing issues with i18n stuff:
- Make gettext stuff draw-time. so switching between languages
can happens without restart now.
- Added option to translate visible interface (menus, buttons, labels)
and tooltips. Now it's possible to have english UI and localized tooltips.
- Clean-up sources, do not use gettext stuff for things which can be
collected with RNA.
- Fix issues with windows 64bit and ru_RU locale on my desktop
(it was codepage issue).
- Added operator "Get Messages" which generates new text block with
with all strings collected from RNA.
- Changed script for updating blender.pot so now it appends
messages collected from rna to automatically gathered messages.
To update .pot you have to re-generate messages.txt using "Get Messages"
operator and then run update_pot script.
- Clean up old translation stuff which wasn't used and most probably
wouldn't be used.
- Return back "International Fonts" option, so if it's disabled, no
gettext lookups happens on draw.
- Merged read_homefile function back. No need in splitting it.
TODO:
- Custom fonts and font size.
Current font isn't nice at least for russian locale, it's
difficult to read it.
- Put references to messages.txt so gettext can merge translation when
name/description of some property changes.
Diffstat (limited to 'source/blender/windowmanager/intern/wm_files.c')
-rw-r--r-- | source/blender/windowmanager/intern/wm_files.c | 22 |
1 files changed, 7 insertions, 15 deletions
diff --git a/source/blender/windowmanager/intern/wm_files.c b/source/blender/windowmanager/intern/wm_files.c index 5933d8ed4d6..a0be707f840 100644 --- a/source/blender/windowmanager/intern/wm_files.c +++ b/source/blender/windowmanager/intern/wm_files.c @@ -452,8 +452,9 @@ void WM_read_file(bContext *C, const char *filepath, ReportList *reports) /* called on startup, (context entirely filled with NULLs) */ /* or called for 'New File' */ /* op can be NULL */ -int WM_read_homefile(bContext *C, ReportList *UNUSED(reports), short from_memory, ListBase *wmbase) +int WM_read_homefile(bContext *C, ReportList *UNUSED(reports), short from_memory) { + ListBase wmbase; char tstr[FILE_MAXDIR+FILE_MAXFILE]; int success= 0; @@ -474,7 +475,7 @@ int WM_read_homefile(bContext *C, ReportList *UNUSED(reports), short from_memory G.fileflags &= ~G_FILE_NO_UI; /* put aside screens to match with persistant windows later */ - wm_window_match_init(C, wmbase); + wm_window_match_init(C, &wmbase); if (!from_memory && BLI_exists(tstr)) { success = (BKE_read_file(C, tstr, NULL) != BKE_READ_FILE_FAIL); @@ -486,7 +487,7 @@ int WM_read_homefile(bContext *C, ReportList *UNUSED(reports), short from_memory } if(success==0) { success = BKE_read_file_from_memory(C, datatoc_startup_blend, datatoc_startup_blend_size, NULL); - if (wmbase->first == NULL) wm_clear_default_size(C); + if (wmbase.first == NULL) wm_clear_default_size(C); #ifdef WITH_PYTHON_SECURITY /* not default */ /* use alternative setting for security nuts @@ -494,15 +495,7 @@ int WM_read_homefile(bContext *C, ReportList *UNUSED(reports), short from_memory U.flag |= USER_SCRIPT_AUTOEXEC_DISABLE; #endif } - return TRUE; -} - -/* split from the old WM_read_homefile, as the locale setting should - * be called after loading user preference, while the - * WM_read_homefile_proc may need i18n support. So we split them, and - * insert locale setting steps */ -int WM_read_homefile_proc(bContext *C, ListBase *wmbase) -{ + /* prevent buggy files that had G_FILE_RELATIVE_REMAP written out by mistake. Screws up autosaves otherwise * can remove this eventually, only in a 2.53 and older, now its not written */ G.fileflags &= ~G_FILE_RELATIVE_REMAP; @@ -511,7 +504,7 @@ int WM_read_homefile_proc(bContext *C, ListBase *wmbase) wm_init_userdef(C); /* match the read WM with current WM */ - wm_window_match_do(C, wmbase); + wm_window_match_do(C, &wmbase); WM_check(C); /* opens window(s), checks keymaps */ G.main->name[0]= '\0'; @@ -556,9 +549,8 @@ int WM_read_homefile_proc(bContext *C, ListBase *wmbase) int WM_read_homefile_exec(bContext *C, wmOperator *op) { - ListBase wmbase; int from_memory= strcmp(op->type->idname, "WM_OT_read_factory_settings") == 0; - return WM_read_homefile(C, op->reports, from_memory, &wmbase) && WM_read_homefile_proc(C, &wmbase) ? OPERATOR_FINISHED : OPERATOR_CANCELLED; + return WM_read_homefile(C, op->reports, from_memory) ? OPERATOR_FINISHED : OPERATOR_CANCELLED; } void WM_read_history(void) |