diff options
Diffstat (limited to 'source/blender/editors/space_image/image_ops.c')
-rw-r--r-- | source/blender/editors/space_image/image_ops.c | 114 |
1 files changed, 58 insertions, 56 deletions
diff --git a/source/blender/editors/space_image/image_ops.c b/source/blender/editors/space_image/image_ops.c index 68f9e4d033e..f4427e55a7d 100644 --- a/source/blender/editors/space_image/image_ops.c +++ b/source/blender/editors/space_image/image_ops.c @@ -41,6 +41,8 @@ #include "BLI_blenlib.h" #include "BLI_utildefines.h" +#include "BLF_api.h" + #include "DNA_object_types.h" #include "DNA_node_types.h" #include "DNA_packedFile_types.h" @@ -288,7 +290,7 @@ static int view_pan_cancel(bContext *C, wmOperator *op) void IMAGE_OT_view_pan(wmOperatorType *ot) { /* identifiers */ - ot->name= "View Pan"; + ot->name= _("View Pan"); ot->idname= "IMAGE_OT_view_pan"; /* api callbacks */ @@ -303,7 +305,7 @@ void IMAGE_OT_view_pan(wmOperatorType *ot) /* properties */ RNA_def_float_vector(ot->srna, "offset", 2, NULL, -FLT_MAX, FLT_MAX, - "Offset", "Offset in floating point units, 1.0 is the width and height of the image.", -FLT_MAX, FLT_MAX); + _("Offset"), _("Offset in floating point units, 1.0 is the width and height of the image."), -FLT_MAX, FLT_MAX); } /********************** view zoom operator *********************/ @@ -419,7 +421,7 @@ static int view_zoom_cancel(bContext *C, wmOperator *op) void IMAGE_OT_view_zoom(wmOperatorType *ot) { /* identifiers */ - ot->name= "View Zoom"; + ot->name= _("View Zoom"); ot->idname= "IMAGE_OT_view_zoom"; /* api callbacks */ @@ -434,7 +436,7 @@ void IMAGE_OT_view_zoom(wmOperatorType *ot) /* properties */ RNA_def_float(ot->srna, "factor", 0.0f, 0.0f, FLT_MAX, - "Factor", "Zoom factor, values higher than 1.0 zoom in, lower values zoom out.", -FLT_MAX, FLT_MAX); + _("Factor"), _("Zoom factor, values higher than 1.0 zoom in, lower values zoom out."), -FLT_MAX, FLT_MAX); } /********************** NDOF operator *********************/ @@ -540,7 +542,7 @@ static int view_all_exec(bContext *C, wmOperator *UNUSED(op)) void IMAGE_OT_view_all(wmOperatorType *ot) { /* identifiers */ - ot->name= "View All"; + ot->name= _("View All"); ot->idname= "IMAGE_OT_view_all"; /* api callbacks */ @@ -601,7 +603,7 @@ static int view_selected_poll(bContext *C) void IMAGE_OT_view_selected(wmOperatorType *ot) { /* identifiers */ - ot->name= "View Center"; + ot->name= _("View Center"); ot->idname= "IMAGE_OT_view_selected"; /* api callbacks */ @@ -626,7 +628,7 @@ static int view_zoom_in_exec(bContext *C, wmOperator *UNUSED(op)) void IMAGE_OT_view_zoom_in(wmOperatorType *ot) { /* identifiers */ - ot->name= "View Zoom In"; + ot->name= _("View Zoom In"); ot->idname= "IMAGE_OT_view_zoom_in"; /* api callbacks */ @@ -649,7 +651,7 @@ static int view_zoom_out_exec(bContext *C, wmOperator *UNUSED(op)) void IMAGE_OT_view_zoom_out(wmOperatorType *ot) { /* identifiers */ - ot->name= "View Zoom Out"; + ot->name= _("View Zoom Out"); ot->idname= "IMAGE_OT_view_zoom_out"; /* api callbacks */ @@ -687,7 +689,7 @@ static int view_zoom_ratio_exec(bContext *C, wmOperator *op) void IMAGE_OT_view_zoom_ratio(wmOperatorType *ot) { /* identifiers */ - ot->name= "View Zoom Ratio"; + ot->name= _("View Zoom Ratio"); ot->idname= "IMAGE_OT_view_zoom_ratio"; /* api callbacks */ @@ -696,18 +698,18 @@ void IMAGE_OT_view_zoom_ratio(wmOperatorType *ot) /* properties */ RNA_def_float(ot->srna, "ratio", 0.0f, 0.0f, FLT_MAX, - "Ratio", "Zoom ratio, 1.0 is 1:1, higher is zoomed in, lower is zoomed out.", -FLT_MAX, FLT_MAX); + _("Ratio"), _("Zoom ratio, 1.0 is 1:1, higher is zoomed in, lower is zoomed out."), -FLT_MAX, FLT_MAX); } /**************** load/replace/save callbacks ******************/ /* XXX make dynamic */ static const EnumPropertyItem image_file_type_items[] = { - {R_TARGA, "TARGA", 0, "Targa", ""}, - {R_RAWTGA, "TARGA RAW", 0, "Targa Raw", ""}, + {R_TARGA, "TARGA", 0, N_("Targa"), ""}, + {R_RAWTGA, "TARGA RAW", 0, N_("Targa Raw"), ""}, {R_PNG, "PNG", 0, "PNG", ""}, #ifdef WITH_DDS - {R_DDS, "DDS", 0, "DirectDraw Surface", ""}, + {R_DDS, "DDS", 0, N_("DirectDraw Surface"), ""}, #endif {R_BMP, "BMP", 0, "BMP", ""}, {R_JPEG90, "JPEG", 0, "Jpeg", ""}, @@ -719,10 +721,10 @@ static const EnumPropertyItem image_file_type_items[] = { {R_TIFF, "TIFF", 0, "Tiff", ""}, #endif #ifdef WITH_DDS - {R_RADHDR, "RADIANCE_HDR", 0, "Radiance HDR", ""}, + {R_RADHDR, "RADIANCE_HDR", 0, N_("Radiance HDR"), ""}, #endif #ifdef WITH_CINEON - {R_CINEON, "CINEON", 0, "Cineon", ""}, + {R_CINEON, "CINEON", 0, N_("Cineon"), ""}, {R_DPX, "DPX", 0, "DPX", ""}, #endif #ifdef WITH_OPENEXR @@ -862,8 +864,8 @@ static int open_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(event)) void IMAGE_OT_open(wmOperatorType *ot) { /* identifiers */ - ot->name= "Open Image"; - ot->description= "Open image"; + ot->name= _("Open Image"); + ot->description= _("Open image"); ot->idname= "IMAGE_OT_open"; /* api callbacks */ @@ -921,7 +923,7 @@ static int replace_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(event)) void IMAGE_OT_replace(wmOperatorType *ot) { /* identifiers */ - ot->name= "Replace Image"; + ot->name= _("Replace Image"); ot->idname= "IMAGE_OT_replace"; /* api callbacks */ @@ -1193,7 +1195,7 @@ void IMAGE_OT_save_as(wmOperatorType *ot) PropertyRNA *prop; /* identifiers */ - ot->name= "Save As Image"; + ot->name= _("Save As Image"); ot->idname= "IMAGE_OT_save_as"; /* api callbacks */ @@ -1208,14 +1210,14 @@ void IMAGE_OT_save_as(wmOperatorType *ot) /* properties */ /* format options */ - RNA_def_enum(ot->srna, "file_format", image_file_type_items, R_PNG, "File Type", "File type to save image as."); - RNA_def_enum(ot->srna, "color_mode", image_color_mode_items, R_PLANES24, "Channels", "Image channels to save"); - prop= RNA_def_int(ot->srna, "file_quality", 90, 0, 100, "Quality", "", 0, 100); + RNA_def_enum(ot->srna, "file_format", image_file_type_items, R_PNG, _("File Type"), _("File type to save image as.")); + RNA_def_enum(ot->srna, "color_mode", image_color_mode_items, R_PLANES24, _("Channels"), _("Image channels to save")); + prop= RNA_def_int(ot->srna, "file_quality", 90, 0, 100, _("Quality"), "", 0, 100); RNA_def_property_subtype(prop, PROP_PERCENTAGE); WM_operator_properties_filesel(ot, FOLDERFILE|IMAGEFILE|MOVIEFILE, FILE_SPECIAL, FILE_SAVE, WM_FILESEL_FILEPATH|WM_FILESEL_RELPATH); - RNA_def_boolean(ot->srna, "copy", 0, "Copy", "Create a new image file without modifying the current image in blender"); + RNA_def_boolean(ot->srna, "copy", 0, _("Copy"), _("Create a new image file without modifying the current image in blender")); } /******************** save image operator ********************/ @@ -1244,7 +1246,7 @@ static int save_exec(bContext *C, wmOperator *op) void IMAGE_OT_save(wmOperatorType *ot) { /* identifiers */ - ot->name= "Save Image"; + ot->name= _("Save Image"); ot->idname= "IMAGE_OT_save"; /* api callbacks */ @@ -1321,7 +1323,7 @@ static int save_sequence_exec(bContext *C, wmOperator *op) void IMAGE_OT_save_sequence(wmOperatorType *ot) { /* identifiers */ - ot->name= "Save Sequence"; + ot->name= _("Save Sequence"); ot->idname= "IMAGE_OT_save_sequence"; /* api callbacks */ @@ -1356,7 +1358,7 @@ static int reload_exec(bContext *C, wmOperator *UNUSED(op)) void IMAGE_OT_reload(wmOperatorType *ot) { /* identifiers */ - ot->name= "Reload Image"; + ot->name= _("Reload Image"); ot->idname= "IMAGE_OT_reload"; /* api callbacks */ @@ -1438,8 +1440,8 @@ void IMAGE_OT_new(wmOperatorType *ot) static float default_color[4]= {0.0f, 0.0f, 0.0f, 1.0f}; /* identifiers */ - ot->name= "New Image"; - ot->description= "Create a new image"; + ot->name= _("New Image"); + ot->description= _("Create a new image"); ot->idname= "IMAGE_OT_new"; /* api callbacks */ @@ -1450,14 +1452,14 @@ 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_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); + RNA_def_string(ot->srna, "name", "untitled", 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); RNA_def_property_float_array_default(prop, default_color); - RNA_def_boolean(ot->srna, "alpha", 1, "Alpha", "Create an image with an alpha channel."); - RNA_def_boolean(ot->srna, "uv_test_grid", 0, "UV Test Grid", "Fill the image with a grid for UV map testing."); - RNA_def_boolean(ot->srna, "float", 0, "32 bit Float", "Create image with 32 bit floating point bit depth."); + RNA_def_boolean(ot->srna, "alpha", 1, _("Alpha"), _("Create an image with an alpha channel.")); + RNA_def_boolean(ot->srna, "uv_test_grid", 0, _("UV Test Grid"), _("Fill the image with a grid for UV map testing.")); + RNA_def_boolean(ot->srna, "float", 0, _("32 bit Float"), _("Create image with 32 bit floating point bit depth.")); } /********************* invert operators *********************/ @@ -1528,7 +1530,7 @@ static int image_invert_exec(bContext *C, wmOperator *op) void IMAGE_OT_invert(wmOperatorType *ot) { /* identifiers */ - ot->name= "Invert Channels"; + ot->name= _("Invert Channels"); ot->idname= "IMAGE_OT_invert"; /* api callbacks */ @@ -1536,10 +1538,10 @@ void IMAGE_OT_invert(wmOperatorType *ot) ot->poll= image_invert_poll; /* properties */ - RNA_def_boolean(ot->srna, "invert_r", 0, "Red", "Invert Red Channel"); - RNA_def_boolean(ot->srna, "invert_g", 0, "Green", "Invert Green Channel"); - RNA_def_boolean(ot->srna, "invert_b", 0, "Blue", "Invert Blue Channel"); - RNA_def_boolean(ot->srna, "invert_a", 0, "Alpha", "Invert Alpha Channel"); + RNA_def_boolean(ot->srna, "invert_r", 0, _("Red"), _("Invert Red Channel")); + RNA_def_boolean(ot->srna, "invert_g", 0, _("Green"), _("Invert Green Channel")); + RNA_def_boolean(ot->srna, "invert_b", 0, _("Blue"), _("Invert Blue Channel")); + RNA_def_boolean(ot->srna, "invert_a", 0, _("Alpha"), _("Invert Alpha Channel")); /* flags */ ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; @@ -1615,8 +1617,8 @@ static int pack_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(event)) void IMAGE_OT_pack(wmOperatorType *ot) { /* identifiers */ - ot->name= "Pack Image"; - ot->description= "Pack an image as embedded data into the .blend file"; + ot->name= _("Pack Image"); + ot->description= _("Pack an image as embedded data into the .blend file"); ot->idname= "IMAGE_OT_pack"; /* api callbacks */ @@ -1627,7 +1629,7 @@ void IMAGE_OT_pack(wmOperatorType *ot) ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; /* properties */ - RNA_def_boolean(ot->srna, "as_png", 0, "Pack As PNG", "Pack image as lossless PNG."); + RNA_def_boolean(ot->srna, "as_png", 0, _("Pack As PNG"), _("Pack image as lossless PNG.")); } /********************* unpack operator *********************/ @@ -1692,8 +1694,8 @@ static int image_unpack_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(even void IMAGE_OT_unpack(wmOperatorType *ot) { /* identifiers */ - ot->name= "Unpack Image"; - ot->description= "Save an image packed in the .blend file to disk"; + ot->name= _("Unpack Image"); + ot->description= _("Save an image packed in the .blend file to disk"); ot->idname= "IMAGE_OT_unpack"; /* api callbacks */ @@ -1704,8 +1706,8 @@ void IMAGE_OT_unpack(wmOperatorType *ot) ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; /* properties */ - RNA_def_enum(ot->srna, "method", unpack_method_items, PF_USE_LOCAL, "Method", "How to unpack."); - RNA_def_string(ot->srna, "id", "", MAX_ID_NAME-2, "Image Name", "Image datablock name to unpack."); /* XXX, weark!, will fail with library, name collisions */ + RNA_def_enum(ot->srna, "method", unpack_method_items, PF_USE_LOCAL, _("Method"), _("How to unpack.")); + RNA_def_string(ot->srna, "id", "", MAX_ID_NAME-2, _("Image Name"), _("Image datablock name to unpack.")); /* XXX, weark!, will fail with library, name collisions */ } /******************** sample image operator ********************/ @@ -1902,7 +1904,7 @@ static int sample_cancel(bContext *C, wmOperator *op) void IMAGE_OT_sample(wmOperatorType *ot) { /* identifiers */ - ot->name= "Sample Color"; + ot->name= _("Sample Color"); ot->idname= "IMAGE_OT_sample"; /* api callbacks */ @@ -2010,7 +2012,7 @@ static int sample_line_invoke(bContext *C, wmOperator *op, wmEvent *event) void IMAGE_OT_sample_line(wmOperatorType *ot) { /* identifiers */ - ot->name= "Sample Line"; + ot->name= _("Sample Line"); ot->idname= "IMAGE_OT_sample_line"; /* api callbacks */ @@ -2031,12 +2033,12 @@ void IMAGE_OT_sample_line(wmOperatorType *ot) void IMAGE_OT_curves_point_set(wmOperatorType *ot) { static EnumPropertyItem point_items[]= { - {0, "BLACK_POINT", 0, "Black Point", ""}, - {1, "WHITE_POINT", 0, "White Point", ""}, + {0, "BLACK_POINT", 0, N_("Black Point"), ""}, + {1, "WHITE_POINT", 0, N_("White Point"), ""}, {0, NULL, 0, NULL, NULL}}; /* identifiers */ - ot->name= "Set Curves Point"; + ot->name= _("Set Curves Point"); ot->idname= "IMAGE_OT_curves_point_set"; /* flags */ @@ -2049,7 +2051,7 @@ void IMAGE_OT_curves_point_set(wmOperatorType *ot) ot->poll= space_image_main_area_poll; /* properties */ - RNA_def_enum(ot->srna, "point", point_items, 0, "Point", "Set black point or white point for curves."); + RNA_def_enum(ot->srna, "point", RNA_enum_items_gettexted(point_items), 0, _("Point"), _("Set black point or white point for curves.")); } /******************** record composite operator *********************/ @@ -2190,7 +2192,7 @@ static int record_composite_cancel(bContext *C, wmOperator *op) void IMAGE_OT_record_composite(wmOperatorType *ot) { /* identifiers */ - ot->name= "Record Composite"; + ot->name= _("Record Composite"); ot->idname= "IMAGE_OT_record_composite"; /* api callbacks */ @@ -2245,7 +2247,7 @@ static int cycle_render_slot_exec(bContext *C, wmOperator *op) void IMAGE_OT_cycle_render_slot(wmOperatorType *ot) { /* identifiers */ - ot->name= "Cycle Render Slot"; + ot->name= _("Cycle Render Slot"); ot->idname= "IMAGE_OT_cycle_render_slot"; /* api callbacks */ @@ -2255,7 +2257,7 @@ void IMAGE_OT_cycle_render_slot(wmOperatorType *ot) /* flags */ ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; - RNA_def_boolean(ot->srna, "reverse", 0, "Cycle in Reverse", ""); + RNA_def_boolean(ot->srna, "reverse", 0, _("Cycle in Reverse"), ""); } /******************** TODO ********************/ |