[Bf-codereview] Blender i18n enhancements (issue 7102054)

montagne29 at wanadoo.fr montagne29 at wanadoo.fr
Sun Jan 20 18:34:49 CET 2013


Applied suggested changes and committed. Thanks both of you for the
reviews :)


https://codereview.appspot.com/7102054/diff/31/source/blender/makesrna/intern/rna_rna.c
File source/blender/makesrna/intern/rna_rna.c (right):

https://codereview.appspot.com/7102054/diff/31/source/blender/makesrna/intern/rna_rna.c#newcode59
source/blender/makesrna/intern/rna_rna.c:59: {PROP_PY_TRANSLATE,
"TRANSLATE", 0, "Translate",
On 2013/01/20 15:26:31, brechtvl wrote:
> I don't think this should be a subtype but a flag instead? That way it
doesn't
> get unnecessarily exposed to python, and it can work even if we ever
add useful
> string subtypes here.

Done.

https://codereview.appspot.com/7102054/diff/31/source/blender/makesrna/intern/rna_userdef.c
File source/blender/makesrna/intern/rna_userdef.c (right):

https://codereview.appspot.com/7102054/diff/31/source/blender/makesrna/intern/rna_userdef.c#newcode3317
source/blender/makesrna/intern/rna_userdef.c:3317: prop =
RNA_def_property(srna, "dpi", PROP_INT, PROP_NONE);
On 2013/01/20 15:26:31, brechtvl wrote:
> I don't think this should be an option, just enable it always, don't
think
> addons should work different than builtin code here.

Done.

https://codereview.appspot.com/7102054/diff/31/source/blender/python/intern/bpy_app.c
File source/blender/python/intern/bpy_app.c (right):

https://codereview.appspot.com/7102054/diff/31/source/blender/python/intern/bpy_app.c#newcode94
source/blender/python/intern/bpy_app.c:94: {(char *)"i18n", (char
*)"Application and addons internationalization API"},
On 2013/01/20 15:03:46, ideasman42 wrote:
> picky but perhaps
> 'bpy.app.translations'
> is nicer?

Done.

https://codereview.appspot.com/7102054/diff/31/source/blender/python/intern/bpy_app_i18n.c
File source/blender/python/intern/bpy_app_i18n.c (right):

https://codereview.appspot.com/7102054/diff/31/source/blender/python/intern/bpy_app_i18n.c#newcode179
source/blender/python/intern/bpy_app_i18n.c:179: if
(!PyArg_ParseTuple(pykey, "ss", &msgctxt, &msgid)) {
On 2013/01/20 15:03:46, ideasman42 wrote:
> In this case I'd suggest to manually get each string from the tuple
...
> PyTuple_GETITEM, str = _PyUnicode_AsString() for each.

Done.

https://codereview.appspot.com/7102054/diff/31/source/blender/python/intern/bpy_app_i18n.c#newcode255
source/blender/python/intern/bpy_app_i18n.c:255: "   :return: None.\n"
On 2013/01/20 15:03:46, ideasman42 wrote:
> you can just leave this out.

Done.

https://codereview.appspot.com/7102054/diff/31/source/blender/python/intern/bpy_app_i18n.c#newcode266
source/blender/python/intern/bpy_app_i18n.c:266: Py_RETURN_NONE;
On 2013/01/20 15:03:46, ideasman42 wrote:
> Shouldn't this return NULL? (which would raise a python exception)

Done.

https://codereview.appspot.com/7102054/diff/31/source/blender/python/intern/bpy_app_i18n.c#newcode273
source/blender/python/intern/bpy_app_i18n.c:273: Py_RETURN_NONE;
On 2013/01/20 15:03:46, ideasman42 wrote:
> same as above.

Done.

https://codereview.appspot.com/7102054/diff/31/source/blender/python/intern/bpy_app_i18n.c#newcode292
source/blender/python/intern/bpy_app_i18n.c:292: "   :return: None.\n"
On 2013/01/20 15:03:46, ideasman42 wrote:
> you can just leave this out.

Done.

https://codereview.appspot.com/7102054/diff/31/source/blender/python/intern/bpy_app_i18n.c#newcode303
source/blender/python/intern/bpy_app_i18n.c:303: Py_RETURN_NONE;
On 2013/01/20 15:03:46, ideasman42 wrote:
> again, return NULL for error cases

Done.

https://codereview.appspot.com/7102054/


More information about the Bf-codereview mailing list