From 874c96a2b9b39a2518793bebaf747e955b43d435 Mon Sep 17 00:00:00 2001 From: Bastien Montagne Date: Thu, 20 Oct 2011 20:38:26 +0000 Subject: Cleaning i18n code. Previous state: Right now, there are "memories" of the "old" (less than a month!) translation way: * A few remaining calls to BLF_gettext() (only UI_translate_do_iface and UI_translate_do_tooltip should be used). * The _() macro still also calls BLF_gettext()! New state: Here are the changes made by the patch: * Removing the no more needed _() macro. * Removing most N_() and _() calls, only keeping the few needed ones (i.e. strings that are in no other way findable by xgettext and/or update_msg script). * Defining in UI_interface.h IFACE_() and TIP_() macros (resp. for UI_translate_do_iface and UI_translate_do_tooltip). * Replacing all calls to BLF_gettext by relevant IFACE_ or TIP_ one. * Replacing all calls to UI_translate_do_iface by IFACE_. * Replacing all calls to UI_translate_do_tooltip by TIP_. All this somewhat clarifies and simplifies the code. On the bf-translations scripts side, this only implies adding IFACE_ and TIP_ as detection markers for xgettext. It also allows to reduce POTFILES.in quite notably (only 20 files remaining in it). Please also have a look at those pages: * Coder POV: http://wiki.blender.org/index.php/Dev:2.5/Source/Interface/Internationalization * Translator POV: http://wiki.blender.org/index.php/Dev:2.5/Doc/How_to/Translate_Blender --- source/blender/editors/space_file/file_draw.c | 22 +++++++++++----------- source/blender/editors/space_file/file_panels.c | 2 +- 2 files changed, 12 insertions(+), 12 deletions(-) (limited to 'source/blender/editors/space_file') diff --git a/source/blender/editors/space_file/file_draw.c b/source/blender/editors/space_file/file_draw.c index 85edcce35ca..6fbfa11d0cf 100644 --- a/source/blender/editors/space_file/file_draw.c +++ b/source/blender/editors/space_file/file_draw.c @@ -182,7 +182,7 @@ void file_draw_buttons(const bContext *C, ARegion *ar) but = uiDefButTextO(block, TEX, "FILE_OT_directory", 0, "", min_x, line1_y, line1_w-chan_offs, btn_h, params->dir, 0.0, (float)FILE_MAX, 0, 0, - UI_translate_do_tooltip(N_("File path"))); + TIP_("File path")); uiButSetCompleteFunc(but, autocomplete_directory, NULL); uiButSetFlag(but, UI_BUT_NO_UTF8); @@ -190,7 +190,7 @@ void file_draw_buttons(const bContext *C, ARegion *ar) but = uiDefBut(block, TEX, B_FS_FILENAME, "", min_x, line2_y, line2_w-chan_offs, btn_h, params->file, 0.0, (float)FILE_MAXFILE, 0, 0, - UI_translate_do_tooltip(overwrite_alert ?N_("File name, overwrite existing") : N_("File name"))); + TIP_(overwrite_alert ?N_("File name, overwrite existing") : N_("File name"))); uiButSetCompleteFunc(but, autocomplete_file, NULL); uiButSetFlag(but, UI_BUT_NO_UTF8); @@ -208,15 +208,15 @@ void file_draw_buttons(const bContext *C, ARegion *ar) if (fnumbuttons && (params->flag & FILE_DIRSEL_ONLY) == 0) { uiBlockBeginAlign(block); but = uiDefIconButO(block, BUT, "FILE_OT_filenum", 0, ICON_ZOOMOUT, - min_x + line2_w + separator - chan_offs, line2_y, - btn_fn_w, btn_h, - UI_translate_do_tooltip(N_("Decrement the filename number"))); + min_x + line2_w + separator - chan_offs, line2_y, + btn_fn_w, btn_h, + TIP_("Decrement the filename number")); RNA_int_set(uiButGetOperatorPtrRNA(but), "increment", -1); - but = uiDefIconButO(block, BUT, "FILE_OT_filenum", 0, ICON_ZOOMIN, - min_x + line2_w + separator + btn_fn_w - chan_offs, line2_y, - btn_fn_w, btn_h, - UI_translate_do_tooltip(N_("Increment the filename number"))); + but = uiDefIconButO(block, BUT, "FILE_OT_filenum", 0, ICON_ZOOMIN, + min_x + line2_w + separator + btn_fn_w - chan_offs, line2_y, + btn_fn_w, btn_h, + TIP_("Increment the filename number")); RNA_int_set(uiButGetOperatorPtrRNA(but), "increment", 1); uiBlockEndAlign(block); } @@ -227,9 +227,9 @@ void file_draw_buttons(const bContext *C, ARegion *ar) uiDefButO(block, BUT, "FILE_OT_execute", WM_OP_EXEC_REGION_WIN, params->title, max_x - loadbutton, line1_y, loadbutton, btn_h, params->title); - uiDefButO(block, BUT, "FILE_OT_cancel", WM_OP_EXEC_REGION_WIN, UI_translate_do_iface(N_("Cancel")), + uiDefButO(block, BUT, "FILE_OT_cancel", WM_OP_EXEC_REGION_WIN, IFACE_("Cancel"), max_x - loadbutton, line2_y, loadbutton, btn_h, - UI_translate_do_tooltip(N_("Cancel"))); + TIP_("Cancel")); } uiEndBlock(C, block); diff --git a/source/blender/editors/space_file/file_panels.c b/source/blender/editors/space_file/file_panels.c index 37dce293d77..fae10c0d84e 100644 --- a/source/blender/editors/space_file/file_panels.c +++ b/source/blender/editors/space_file/file_panels.c @@ -146,7 +146,7 @@ static void file_panel_bookmarks(const bContext *C, Panel *pa) if(sfile) { row= uiLayoutRow(pa->layout, 0); - uiItemO(row, UI_translate_do_iface(N_("Add")), ICON_ZOOMIN, "file.bookmark_add"); + uiItemO(row, IFACE_("Add"), ICON_ZOOMIN, "file.bookmark_add"); uiItemL(row, NULL, ICON_NONE); file_panel_category(C, pa, FS_CATEGORY_BOOKMARKS, &sfile->bookmarknr, ICON_BOOKMARKS, 1, 0); -- cgit v1.2.3