forked from bartvdbraak/blender
I18n: various "new data translation" fixes...
This commit is contained in:
parent
0c07c33fec
commit
b4bd43e022
@ -374,6 +374,7 @@ class SpellChecker():
|
||||
"fluidsim",
|
||||
"frameserver",
|
||||
"enum",
|
||||
"gpencil",
|
||||
"idcol",
|
||||
"keyframe", "keyframes", "keyframing", "keyframed",
|
||||
"metaball", "metaballs", "mball",
|
||||
|
@ -126,11 +126,11 @@ static void node_init(const struct bContext *C, bNodeTree *ntree, bNode *node)
|
||||
/* initialize the node name with the node label.
|
||||
* note: do this after the initfunc so nodes get their data set which may be used in naming
|
||||
* (node groups for example) */
|
||||
/* XXX Do not use nodeLabel() here, it returns translated content, which should *only* be used
|
||||
* in UI, *never* in data...
|
||||
/* XXX Do not use nodeLabel() here, it returns translated content for UI, which should *only* be used
|
||||
* in UI, *never* in data... Data have their own translation option!
|
||||
* This solution may be a bit rougher than nodeLabel()'s returned string, but it's simpler
|
||||
* than adding a "no translate" flag to this func (and labelfunc() as well). */
|
||||
BLI_strncpy(node->name, ntype->ui_name, NODE_MAXSTR);
|
||||
* than adding "do_translate" flags to this func (and labelfunc() as well). */
|
||||
BLI_strncpy(node->name, DATA_(ntype->ui_name), NODE_MAXSTR);
|
||||
nodeUniqueName(ntree, node);
|
||||
|
||||
node_add_sockets_from_type(ntree, node, ntype);
|
||||
@ -816,7 +816,7 @@ bNode *nodeAddStaticNode(const struct bContext *C, bNodeTree *ntree, int type)
|
||||
|
||||
NODE_TYPES_BEGIN(ntype)
|
||||
if (ntype->type == type) {
|
||||
idname = ntype->idname;
|
||||
idname = DATA_(ntype->idname);
|
||||
break;
|
||||
}
|
||||
NODE_TYPES_END
|
||||
|
@ -43,6 +43,8 @@
|
||||
#include "BLI_rand.h"
|
||||
#include "BLI_utildefines.h"
|
||||
|
||||
#include "BLF_translation.h"
|
||||
|
||||
#include "DNA_anim_types.h"
|
||||
#include "DNA_curve_types.h"
|
||||
#include "DNA_object_types.h"
|
||||
@ -229,7 +231,7 @@ static int gp_data_add_exec(bContext *C, wmOperator *op)
|
||||
bGPdata *gpd = (*gpd_ptr);
|
||||
|
||||
id_us_min(&gpd->id);
|
||||
*gpd_ptr = gpencil_data_addnew("GPencil");
|
||||
*gpd_ptr = gpencil_data_addnew(DATA_("GPencil"));
|
||||
}
|
||||
|
||||
/* notifiers */
|
||||
@ -312,10 +314,10 @@ static int gp_layer_add_exec(bContext *C, wmOperator *op)
|
||||
return OPERATOR_CANCELLED;
|
||||
}
|
||||
if (*gpd_ptr == NULL)
|
||||
*gpd_ptr = gpencil_data_addnew("GPencil");
|
||||
|
||||
*gpd_ptr = gpencil_data_addnew(DATA_("GPencil"));
|
||||
|
||||
/* add new layer now */
|
||||
gpencil_layer_addnew(*gpd_ptr, "GP_Layer", 1);
|
||||
gpencil_layer_addnew(*gpd_ptr, DATA_("GP_Layer"), 1);
|
||||
|
||||
/* notifiers */
|
||||
WM_event_add_notifier(C, NC_GPENCIL | ND_DATA | NA_EDITED, NULL);
|
||||
|
@ -68,4 +68,8 @@ if(WITH_HEADLESS)
|
||||
add_definitions(-DWITH_HEADLESS)
|
||||
endif()
|
||||
|
||||
if(WITH_INTERNATIONAL)
|
||||
add_definitions(-DWITH_INTERNATIONAL)
|
||||
endif()
|
||||
|
||||
blender_add_lib(bf_editor_render "${SRC}" "${INC}" "${INC_SYS}")
|
||||
|
@ -35,6 +35,8 @@ incs += ' ../../gpu'
|
||||
incs += ' ../../makesrna ../../render/extern/include #/intern/elbeem/extern'
|
||||
incs += ' ../../blenloader ../../bmesh ../../blenfont'
|
||||
|
||||
defs = []
|
||||
|
||||
if env['OURPLATFORM'] == 'linux':
|
||||
cflags='-pthread'
|
||||
incs += ' ../../../extern/binreloc/include'
|
||||
@ -54,4 +56,7 @@ if env['OURPLATFORM'] == 'darwin':
|
||||
if env['WITH_BF_OPENMP']:
|
||||
env.Append(CFLAGS=['-DPARALLEL=1'])
|
||||
|
||||
env.BlenderLib ( 'bf_editors_render', sources, Split(incs), [], libtype=['core'], priority=[45])
|
||||
if env['WITH_BF_INTERNATIONAL']:
|
||||
defs.append('WITH_INTERNATIONAL')
|
||||
|
||||
env.BlenderLib('bf_editors_render', sources, Split(incs), defs, libtype=['core'], priority=[45])
|
||||
|
@ -428,10 +428,12 @@ static int new_texture_exec(bContext *C, wmOperator *UNUSED(op))
|
||||
PropertyRNA *prop;
|
||||
|
||||
/* add or copy texture */
|
||||
if (tex)
|
||||
if (tex) {
|
||||
tex = BKE_texture_copy(tex);
|
||||
else
|
||||
}
|
||||
else {
|
||||
tex = add_texture(bmain, DATA_("Texture"));
|
||||
}
|
||||
|
||||
/* hook into UI */
|
||||
uiIDContextProperty(C, &ptr, &prop);
|
||||
@ -480,7 +482,7 @@ static int new_world_exec(bContext *C, wmOperator *UNUSED(op))
|
||||
wo = BKE_world_copy(wo);
|
||||
}
|
||||
else {
|
||||
wo = add_world(bmain, "World");
|
||||
wo = add_world(bmain, DATA_("World"));
|
||||
|
||||
if (BKE_scene_use_new_shading_nodes(scene)) {
|
||||
ED_node_shader_default(C, &wo->id);
|
||||
|
@ -1707,6 +1707,7 @@ void IMAGE_OT_reload(wmOperatorType *ot)
|
||||
}
|
||||
|
||||
/********************** new image operator *********************/
|
||||
#define IMA_DEF_NAME N_("Untitled")
|
||||
|
||||
static int image_new_exec(bContext *C, wmOperator *op)
|
||||
{
|
||||
@ -1717,7 +1718,8 @@ static int image_new_exec(bContext *C, wmOperator *op)
|
||||
Main *bmain;
|
||||
PointerRNA ptr, idptr;
|
||||
PropertyRNA *prop;
|
||||
char name[MAX_ID_NAME - 2];
|
||||
char _name[MAX_ID_NAME - 2];
|
||||
char *name = _name;
|
||||
float color[4];
|
||||
int width, height, floatbuf, gen_type, alpha;
|
||||
|
||||
@ -1727,7 +1729,12 @@ static int image_new_exec(bContext *C, wmOperator *op)
|
||||
obedit = CTX_data_edit_object(C);
|
||||
bmain = CTX_data_main(C);
|
||||
|
||||
RNA_string_get(op->ptr, "name", name);
|
||||
prop = RNA_struct_find_property(op->ptr, "name");
|
||||
RNA_property_string_get(op->ptr, prop, name);
|
||||
if (!RNA_property_is_set(op->ptr, prop)) {
|
||||
/* Default value, we can translate! */
|
||||
name = (char *)DATA_(name);
|
||||
}
|
||||
width = RNA_int_get(op->ptr, "width");
|
||||
height = RNA_int_get(op->ptr, "height");
|
||||
floatbuf = RNA_boolean_get(op->ptr, "float");
|
||||
@ -1775,8 +1782,9 @@ static int image_new_exec(bContext *C, wmOperator *op)
|
||||
/* XXX Note: the WM_operator_props_dialog_popup() doesn't work for uiIDContextProperty(), image is not being that way */
|
||||
static int image_new_invoke(bContext *C, wmOperator *op, const wmEvent *UNUSED(event))
|
||||
{
|
||||
/* Better for user feedback. */
|
||||
RNA_string_set(op->ptr, "name", DATA_(IMA_DEF_NAME));
|
||||
return WM_operator_props_dialog_popup(C, op, 15 * UI_UNIT_X, 5 * UI_UNIT_Y);
|
||||
|
||||
}
|
||||
|
||||
void IMAGE_OT_new(wmOperatorType *ot)
|
||||
@ -1797,7 +1805,7 @@ void IMAGE_OT_new(wmOperatorType *ot)
|
||||
ot->flag = OPTYPE_UNDO;
|
||||
|
||||
/* properties */
|
||||
RNA_def_string(ot->srna, "name", "untitled", MAX_ID_NAME - 2, "Name", "Image datablock name");
|
||||
RNA_def_string(ot->srna, "name", IMA_DEF_NAME, MAX_ID_NAME - 2, "Name", "Image datablock name");
|
||||
RNA_def_int(ot->srna, "width", 1024, 1, INT_MAX, "Width", "Image width", 1, 16384);
|
||||
RNA_def_int(ot->srna, "height", 1024, 1, INT_MAX, "Height", "Image height", 1, 16384);
|
||||
prop = RNA_def_float_color(ot->srna, "color", 4, NULL, 0.0f, FLT_MAX, "Color", "Default fill color", 0.0f, 1.0f);
|
||||
@ -1809,6 +1817,8 @@ void IMAGE_OT_new(wmOperatorType *ot)
|
||||
RNA_def_boolean(ot->srna, "float", 0, "32 bit Float", "Create image with 32 bit floating point bit depth");
|
||||
}
|
||||
|
||||
#undef IMA_DEF_NAME
|
||||
|
||||
/********************* invert operators *********************/
|
||||
|
||||
static int image_invert_poll(bContext *C)
|
||||
|
@ -83,7 +83,7 @@ bNode *node_add_node(const bContext *C, const char *idname, int type, float locx
|
||||
|
||||
/* generics */
|
||||
node->locx = locx;
|
||||
node->locy = locy + 60.0f; // arbitrary.. so its visible, (0,0) is top of node
|
||||
node->locy = locy + 60.0f; /* arbitrary... so its visible, (0,0) is top of node */
|
||||
nodeSetSelected(node, TRUE);
|
||||
|
||||
/* node location is mapped */
|
||||
@ -436,7 +436,8 @@ static int new_node_tree_exec(bContext *C, wmOperator *op)
|
||||
PointerRNA ptr, idptr;
|
||||
PropertyRNA *prop;
|
||||
const char *idname;
|
||||
char treename[MAX_ID_NAME - 2] = "NodeTree";
|
||||
char _treename[MAX_ID_NAME - 2];
|
||||
char *treename = _treename;
|
||||
|
||||
if (RNA_struct_property_is_set(op->ptr, "type")) {
|
||||
prop = RNA_struct_find_property(op->ptr, "type");
|
||||
@ -445,8 +446,12 @@ static int new_node_tree_exec(bContext *C, wmOperator *op)
|
||||
else if (snode)
|
||||
idname = snode->tree_idname;
|
||||
|
||||
if (RNA_struct_property_is_set(op->ptr, "name"))
|
||||
if (RNA_struct_property_is_set(op->ptr, "name")) {
|
||||
RNA_string_get(op->ptr, "name", treename);
|
||||
}
|
||||
else {
|
||||
treename = (char *)DATA_("NodeTree");
|
||||
}
|
||||
|
||||
if (!ntreeTypeFind(idname)) {
|
||||
BKE_reportf(op->reports, RPT_ERROR, "Node tree type %s undefined", idname);
|
||||
|
Loading…
Reference in New Issue
Block a user