diff options
author | Campbell Barton <ideasman42@gmail.com> | 2011-09-21 21:52:51 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2011-09-21 21:52:51 +0400 |
commit | f1a227cf432d6b95bc7cef67a68aaf1c62caafc7 (patch) | |
tree | 387be2ba3af3460a55cfc02816988f944ec7629a /source/blender/makesrna/intern/rna_define.c | |
parent | 49f87edf4eec0f2e1dd165eab52ce63b4b2af864 (diff) |
check that descriptions dont end with a '.', for non release builds.
this is annoying for translators so rather then correct along the way which gives merge conflicts for branches - print a complaint message.
Diffstat (limited to 'source/blender/makesrna/intern/rna_define.c')
-rw-r--r-- | source/blender/makesrna/intern/rna_define.c | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/source/blender/makesrna/intern/rna_define.c b/source/blender/makesrna/intern/rna_define.c index 8af65b97ffc..63b3aed4a3b 100644 --- a/source/blender/makesrna/intern/rna_define.c +++ b/source/blender/makesrna/intern/rna_define.c @@ -58,6 +58,21 @@ BlenderDefRNA DefRNA = {NULL, {NULL, NULL}, {NULL, NULL}, NULL, 0, 0, 0, 1}; #define MAX2(x,y) ((x)>(y)? (x): (y)) #endif +/* pedantic check for '.', do this since its a hassle for translators */ +#ifndef NDEBUG +# define DESCR_CHECK(description, id1, id2) \ + if(description && (description)[0]) { \ + int i = strlen(description); \ + if((description)[i - 1] == '.') { \ + fprintf(stderr, "%s: '%s' '%s' description ends with a '.' !\n", \ + __func__, id1 ? id1 : "", id2 ? id2 : ""); \ + } \ + } \ + +#else +# define DESCR_CHECK(description, id1, id2) +#endif + void rna_addtail(ListBase *listbase, void *vlink) { Link *link= vlink; @@ -847,6 +862,8 @@ void RNA_def_struct_identifier(StructRNA *srna, const char *identifier) void RNA_def_struct_ui_text(StructRNA *srna, const char *name, const char *description) { + DESCR_CHECK(description, srna->identifier, NULL); + srna->name= name; srna->description= description; } @@ -1109,6 +1126,8 @@ void RNA_def_property_multi_array(PropertyRNA *prop, int dimension, const int le void RNA_def_property_ui_text(PropertyRNA *prop, const char *name, const char *description) { + DESCR_CHECK(description, prop->identifier, NULL); + prop->name= name; prop->description= description; } |