[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [46871] trunk/blender/source/blender/ editors: I18n fixes, mainly for (cycles) nodes (i.e.

Bastien Montagne montagne29 at wanadoo.fr
Tue May 22 10:36:06 CEST 2012


Revision: 46871
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=46871
Author:   mont29
Date:     2012-05-22 08:36:06 +0000 (Tue, 22 May 2012)
Log Message:
-----------
I18n fixes, mainly for (cycles) nodes (i.e. node template in Buttons window).

Note: the problem of sockets translation remains (for all node types), currently they are unavailable from RNA, hence not detected by i18n tools, so only solution is to add N_() in all node sockets templates?\226?\128?\166 yuck! Really have to fix this.

Modified Paths:
--------------
    trunk/blender/source/blender/editors/interface/interface_templates.c
    trunk/blender/source/blender/editors/space_node/node_templates.c

Modified: trunk/blender/source/blender/editors/interface/interface_templates.c
===================================================================
--- trunk/blender/source/blender/editors/interface/interface_templates.c	2012-05-22 08:24:52 UTC (rev 46870)
+++ trunk/blender/source/blender/editors/interface/interface_templates.c	2012-05-22 08:36:06 UTC (rev 46871)
@@ -2154,11 +2154,11 @@
 			manode = give_node_material(ma);
 			if (manode) {
 				char str[MAX_ID_NAME + 12];
-				BLI_snprintf(str, sizeof(str), "Node %s", manode->id.name + 2);
+				BLI_snprintf(str, sizeof(str), IFACE_("Node %s"), manode->id.name + 2);
 				uiItemL(sub, str, ui_id_icon_get(C, &manode->id, 1));
 			}
 			else if (ma->use_nodes) {
-				uiItemL(sub, "Node <none>", ICON_NONE);
+				uiItemL(sub, IFACE_("Node <none>"), ICON_NONE);
 			}
 		}
 	}
@@ -2192,7 +2192,9 @@
 		uiDefButR(block, OPTION, 0, "", 0, 0, UI_UNIT_X, UI_UNIT_Y, itemptr, "lock_weight", 0, 0, 0, 0, 0,  NULL);
 #else
 		uiBlockSetEmboss(block, UI_EMBOSSN);
-		uiDefIconButBitC(block, TOG, DG_LOCK_WEIGHT, 0, (dg->flag & DG_LOCK_WEIGHT) ? ICON_LOCKED : ICON_UNLOCKED, 0, 0, UI_UNIT_X, UI_UNIT_Y, &dg->flag, 0, 0, 0, 0, "Maintain relative weights while painting");
+		uiDefIconButBitC(block, TOG, DG_LOCK_WEIGHT, 0, (dg->flag & DG_LOCK_WEIGHT) ? ICON_LOCKED : ICON_UNLOCKED,
+		                 0, 0, UI_UNIT_X, UI_UNIT_Y, &dg->flag, 0, 0, 0, 0,
+		                 TIP_("Maintain relative weights while painting"));
 		uiBlockSetEmboss(block, UI_EMBOSS);
 #endif
 	}

Modified: trunk/blender/source/blender/editors/space_node/node_templates.c
===================================================================
--- trunk/blender/source/blender/editors/space_node/node_templates.c	2012-05-22 08:24:52 UTC (rev 46870)
+++ trunk/blender/source/blender/editors/space_node/node_templates.c	2012-05-22 08:36:06 UTC (rev 46871)
@@ -291,7 +291,7 @@
 			if (node->id)
 				BLI_strncpy(node_name, node->id->name+2, UI_MAX_NAME_STR);
 			else
-				BLI_strncpy(node_name, "Group", UI_MAX_NAME_STR);
+				BLI_strncpy(node_name, N_("Group"), UI_MAX_NAME_STR);
 		}
 		else
 			BLI_strncpy(node_name, node->typeinfo->name, UI_MAX_NAME_STR);
@@ -300,16 +300,16 @@
 		    node->outputs.first != node->outputs.last &&
 		    !(node->typeinfo->flag & NODE_OPTIONS))
 		{
-			BLI_snprintf(name, UI_MAX_NAME_STR, "%s | %s", node_name, sock->link->fromsock->name);
+			BLI_snprintf(name, UI_MAX_NAME_STR, "%s | %s", IFACE_(node_name), IFACE_(sock->link->fromsock->name));
 		}
 		else {
-			BLI_strncpy(name, node_name, UI_MAX_NAME_STR);
+			BLI_strncpy(name, IFACE_(node_name), UI_MAX_NAME_STR);
 		}
 	}
 	else if (sock->type == SOCK_SHADER)
-		BLI_strncpy(name, "None", UI_MAX_NAME_STR);
+		BLI_strncpy(name, IFACE_("None"), UI_MAX_NAME_STR);
 	else
-		BLI_strncpy(name, "Default", UI_MAX_NAME_STR);
+		BLI_strncpy(name, IFACE_("Default"), UI_MAX_NAME_STR);
 }
 
 static int ui_compatible_sockets(int typeA, int typeB)
@@ -360,7 +360,7 @@
 					column= uiLayoutColumn(layout, 0);
 					uiBlockSetCurLayout(block, column);
 
-					uiItemL(column, cname, ICON_NODE);
+					uiItemL(column, IFACE_(cname), ICON_NODE);
 					but= block->buttons.last;
 					but->flag= UI_TEXT_LEFT;
 
@@ -381,7 +381,7 @@
 					BLI_strncpy(name, ngroup->id.name+2, UI_MAX_NAME_STR);
 
 				but = uiDefBut(block, BUT, 0, ngroup->id.name+2, 0, 0, UI_UNIT_X*4, UI_UNIT_Y,
-					NULL, 0.0, 0.0, 0.0, 0.0, "Add node to input");
+					NULL, 0.0, 0.0, 0.0, 0.0, TIP_("Add node to input"));
 
 				argN = MEM_dupallocN(arg);
 				argN->type = NODE_GROUP;
@@ -417,7 +417,7 @@
 					column= uiLayoutColumn(layout, 0);
 					uiBlockSetCurLayout(block, column);
 
-					uiItemL(column, cname, ICON_NODE);
+					uiItemL(column, IFACE_(cname), ICON_NODE);
 					but= block->buttons.last;
 					but->flag= UI_TEXT_LEFT;
 
@@ -426,19 +426,19 @@
 
 				if (num > 1) {
 					if (j == 0) {
-						uiItemL(column, ntype->name, ICON_NODE);
+						uiItemL(column, IFACE_(ntype->name), ICON_NODE);
 						but= block->buttons.last;
 						but->flag= UI_TEXT_LEFT;
 					}
 
-					BLI_snprintf(name, UI_MAX_NAME_STR, "  %s", stemp->name);
+					BLI_snprintf(name, UI_MAX_NAME_STR, "  %s", IFACE_(stemp->name));
 					j++;
 				}
 				else
-					BLI_strncpy(name, ntype->name, UI_MAX_NAME_STR);
+					BLI_strncpy(name, IFACE_(ntype->name), UI_MAX_NAME_STR);
 
 				but = uiDefBut(block, BUT, 0, name, 0, 0, UI_UNIT_X*4, UI_UNIT_Y,
-					NULL, 0.0, 0.0, 0.0, 0.0, "Add node to input");
+					NULL, 0.0, 0.0, 0.0, 0.0, TIP_("Add node to input"));
 
 				argN = MEM_dupallocN(arg);
 				argN->type = ntype->type;
@@ -486,16 +486,16 @@
 		but= block->buttons.last;
 		but->flag= UI_TEXT_LEFT;
 
-		but = uiDefBut(block, BUT, 0, "Remove", 0, 0, UI_UNIT_X*4, UI_UNIT_Y,
-			NULL, 0.0, 0.0, 0.0, 0.0, "Remove nodes connected to the input");
+		but = uiDefBut(block, BUT, 0, IFACE_("Remove"), 0, 0, UI_UNIT_X*4, UI_UNIT_Y,
+			NULL, 0.0, 0.0, 0.0, 0.0, TIP_("Remove nodes connected to the input"));
 		uiButSetNFunc(but, ui_node_link, MEM_dupallocN(arg), SET_INT_IN_POINTER(UI_NODE_LINK_REMOVE));
 
-		but = uiDefBut(block, BUT, 0, "Disconnect", 0, 0, UI_UNIT_X*4, UI_UNIT_Y,
-			NULL, 0.0, 0.0, 0.0, 0.0, "Disconnect nodes connected to the input");
+		but = uiDefBut(block, BUT, 0, IFACE_("Disconnect"), 0, 0, UI_UNIT_X*4, UI_UNIT_Y,
+			NULL, 0.0, 0.0, 0.0, 0.0, TIP_("Disconnect nodes connected to the input"));
 		uiButSetNFunc(but, ui_node_link, MEM_dupallocN(arg), SET_INT_IN_POINTER(UI_NODE_LINK_DISCONNECT));
 	}
 
-	ui_node_menu_column(arg, NODE_CLASS_GROUP, IFACE_("Group"));
+	ui_node_menu_column(arg, NODE_CLASS_GROUP, N_("Group"));
 }
 
 void uiTemplateNodeLink(uiLayout *layout, bNodeTree *ntree, bNode *node, bNodeSocket *sock)
@@ -586,7 +586,7 @@
 	/* indented label */
 	memset(label, ' ', indent);
 	label[indent] = '\0';
-	BLI_snprintf(label, UI_MAX_NAME_STR, "%s%s:", label, input->name);
+	BLI_snprintf(label, UI_MAX_NAME_STR, "%s%s:", label, IFACE_(input->name));
 
 	/* split in label and value */
 	split = uiLayoutSplit(layout, 0.35f, 0);
@@ -615,7 +615,7 @@
 
 	if (dependency_loop) {
 		row = uiLayoutRow(split, 0);
-		uiItemL(row, "Dependency Loop", ICON_ERROR);
+		uiItemL(row, IFACE_("Dependency Loop"), ICON_ERROR);
 	}
 	else if (lnode) {
 		/* input linked to a node */




More information about the Bf-blender-cvs mailing list