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

ideasman42 at gmail.com ideasman42 at gmail.com
Sun Jan 20 16:03:46 CET 2013


LGTM - noted some minor issues.


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"},
picky but perhaps
'bpy.app.translations'
is nicer?

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)) {
In this case I'd suggest to manually get each string from the tuple ...
PyTuple_GETITEM, str = _PyUnicode_AsString() for each.

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"
you can just leave this out.

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;
Shouldn't this return NULL? (which would raise a python exception)

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;
same as above.

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"
you can just leave this out.

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;
again, return NULL for error cases

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


More information about the Bf-codereview mailing list