[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [51051] trunk/blender/source/blender: Fix for commit r51049: no need to create two contexts when one if enough.
Bastien Montagne
montagne29 at wanadoo.fr
Thu Oct 4 20:53:18 CEST 2012
Revision: 51051
http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=51051
Author: mont29
Date: 2012-10-04 18:53:17 +0000 (Thu, 04 Oct 2012)
Log Message:
-----------
Fix for commit r51049: no need to create two contexts when one if enough.
Also please define and use constants in BLF_translation.h rather than directly typing contexts' names, it's safer (typo would break at compile time, instead of generating more contexts!).
Revision Links:
--------------
http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=51049
Modified Paths:
--------------
trunk/blender/source/blender/blenfont/BLF_translation.h
trunk/blender/source/blender/makesrna/intern/rna_actuator.c
trunk/blender/source/blender/makesrna/intern/rna_boid.c
trunk/blender/source/blender/makesrna/intern/rna_scene.c
trunk/blender/source/blender/makesrna/intern/rna_sequencer.c
trunk/blender/source/blender/makesrna/intern/rna_speaker.c
Modified: trunk/blender/source/blender/blenfont/BLF_translation.h
===================================================================
--- trunk/blender/source/blender/blenfont/BLF_translation.h 2012-10-04 18:30:28 UTC (rev 51050)
+++ trunk/blender/source/blender/blenfont/BLF_translation.h 2012-10-04 18:53:17 UTC (rev 51051)
@@ -97,6 +97,8 @@
/* Default context for operator names/labels. */
#define BLF_I18NCONTEXT_OPERATOR_DEFAULT "Operator"
+/* Audio disambiguation context. */
+#define BLF_I18NCONTEXT_AUDIO "Audio"
#endif /* __BLF_TRANSLATION_H__ */
Modified: trunk/blender/source/blender/makesrna/intern/rna_actuator.c
===================================================================
--- trunk/blender/source/blender/makesrna/intern/rna_actuator.c 2012-10-04 18:30:28 UTC (rev 51050)
+++ trunk/blender/source/blender/makesrna/intern/rna_actuator.c 2012-10-04 18:53:17 UTC (rev 51051)
@@ -41,6 +41,8 @@
#include "BLI_utildefines.h"
+#include "BLF_translation.h"
+
/* Always keep in alphabetical order */
EnumPropertyItem actuator_type_items[] = {
{ACT_ACTION, "ACTION", 0, "Action", ""},
@@ -971,12 +973,13 @@
RNA_def_property_ui_range(prop, 0.0, 1.0, 1, 2);
RNA_def_property_range(prop, 0.0, 2.0);
RNA_def_property_ui_text(prop, "Volume", "Initial volume of the sound");
- RNA_def_property_translation_context(prop, "Audio");
+ RNA_def_property_translation_context(prop, BLF_I18NCONTEXT_AUDIO);
RNA_def_property_update(prop, NC_LOGIC, NULL);
prop = RNA_def_property(srna, "pitch", PROP_FLOAT, PROP_NONE);
RNA_def_property_ui_range(prop, -12.0, 12.0, 1, 2);
RNA_def_property_ui_text(prop, "Pitch", "Pitch of the sound");
+ RNA_def_property_translation_context(prop, BLF_I18NCONTEXT_AUDIO);
RNA_def_property_update(prop, NC_LOGIC, NULL);
/* floats - 3D Parameters */
Modified: trunk/blender/source/blender/makesrna/intern/rna_boid.c
===================================================================
--- trunk/blender/source/blender/makesrna/intern/rna_boid.c 2012-10-04 18:30:28 UTC (rev 51050)
+++ trunk/blender/source/blender/makesrna/intern/rna_boid.c 2012-10-04 18:53:17 UTC (rev 51051)
@@ -521,7 +521,6 @@
RNA_def_property_float_sdna(prop, NULL, "pitch");
RNA_def_property_range(prop, 0.0, 2.0);
RNA_def_property_ui_text(prop, "Pitch", "Amount of rotation around side vector");
- RNA_def_property_translation_context(prop, "Rotation");
RNA_def_property_update(prop, 0, "rna_Boids_reset");
prop = RNA_def_property(srna, "height", PROP_FLOAT, PROP_NONE);
Modified: trunk/blender/source/blender/makesrna/intern/rna_scene.c
===================================================================
--- trunk/blender/source/blender/makesrna/intern/rna_scene.c 2012-10-04 18:30:28 UTC (rev 51050)
+++ trunk/blender/source/blender/makesrna/intern/rna_scene.c 2012-10-04 18:53:17 UTC (rev 51051)
@@ -4518,7 +4518,7 @@
RNA_def_property_float_sdna(prop, NULL, "audio.volume");
RNA_def_property_range(prop, 0.0f, 1.0f);
RNA_def_property_ui_text(prop, "Volume", "Audio volume");
- RNA_def_property_translation_context(prop, "Audio");
+ RNA_def_property_translation_context(prop, BLF_I18NCONTEXT_AUDIO);
RNA_def_property_update(prop, NC_SCENE, NULL);
RNA_def_property_float_funcs(prop, NULL, "rna_Scene_volume_set", NULL);
Modified: trunk/blender/source/blender/makesrna/intern/rna_sequencer.c
===================================================================
--- trunk/blender/source/blender/makesrna/intern/rna_sequencer.c 2012-10-04 18:30:28 UTC (rev 51050)
+++ trunk/blender/source/blender/makesrna/intern/rna_sequencer.c 2012-10-04 18:53:17 UTC (rev 51051)
@@ -50,6 +50,8 @@
#include "WM_types.h"
#include "BLI_math.h"
+#include "BLF_translation.h"
+
typedef struct EffectInfo {
const char *struct_name;
const char *ui_name;
@@ -1858,7 +1860,7 @@
RNA_def_property_float_sdna(prop, NULL, "volume");
RNA_def_property_range(prop, 0.0f, 100.0f);
RNA_def_property_ui_text(prop, "Volume", "Playback volume of the sound");
- RNA_def_property_translation_context(prop, "Audio");
+ RNA_def_property_translation_context(prop, BLF_I18NCONTEXT_AUDIO);
RNA_def_property_float_funcs(prop, NULL, "rna_Sequence_volume_set", NULL);
RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_update");
@@ -1866,6 +1868,7 @@
RNA_def_property_float_sdna(prop, NULL, "pitch");
RNA_def_property_range(prop, 0.1f, 10.0f);
RNA_def_property_ui_text(prop, "Pitch", "Playback pitch of the sound");
+ RNA_def_property_translation_context(prop, BLF_I18NCONTEXT_AUDIO);
RNA_def_property_float_funcs(prop, NULL, "rna_Sequence_pitch_set", NULL);
RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_update");
Modified: trunk/blender/source/blender/makesrna/intern/rna_speaker.c
===================================================================
--- trunk/blender/source/blender/makesrna/intern/rna_speaker.c 2012-10-04 18:30:28 UTC (rev 51050)
+++ trunk/blender/source/blender/makesrna/intern/rna_speaker.c 2012-10-04 18:53:17 UTC (rev 51051)
@@ -35,6 +35,8 @@
#include "DNA_speaker_types.h"
#include "DNA_sound_types.h"
+#include "BLF_translation.h"
+
#ifdef RNA_RUNTIME
#include "MEM_guardedalloc.h"
@@ -45,7 +47,6 @@
#include "WM_api.h"
#include "WM_types.h"
-
#else
static void rna_def_speaker(BlenderRNA *brna)
@@ -151,7 +152,7 @@
RNA_def_property_float_sdna(prop, NULL, "volume");
RNA_def_property_range(prop, 0.0f, 1.0f);
RNA_def_property_ui_text(prop, "Volume", "How loud the sound is");
- RNA_def_property_translation_context(prop, "Audio");
+ RNA_def_property_translation_context(prop, BLF_I18NCONTEXT_AUDIO);
/* RNA_def_property_float_funcs(prop, NULL, "rna_Speaker_volume_set", NULL); */
/* RNA_def_property_update(prop, 0, "rna_Speaker_update"); */
@@ -159,6 +160,7 @@
RNA_def_property_float_sdna(prop, NULL, "pitch");
RNA_def_property_range(prop, 0.1f, 10.0f);
RNA_def_property_ui_text(prop, "Pitch", "Playback pitch of the sound");
+ RNA_def_property_translation_context(prop, BLF_I18NCONTEXT_AUDIO);
/* RNA_def_property_float_funcs(prop, NULL, "rna_Speaker_pitch_set", NULL); */
/* RNA_def_property_update(prop, 0, "rna_Speaker_update"); */
More information about the Bf-blender-cvs
mailing list