UI translation from inside Blender UI: first part.
authorBastien Montagne <montagne29@wanadoo.fr>
Mon, 9 Jul 2012 14:25:35 +0000 (14:25 +0000)
committerBastien Montagne <montagne29@wanadoo.fr>
Mon, 9 Jul 2012 14:25:35 +0000 (14:25 +0000)
commit0dafa97ea3f6d9662299579e5be1875cd28baaae
tree149bb7181a73dabc619d546a4f153ad6ed3050ad
parentfacb1512c097189e50808f6aca7c9f0b0280d2dc
UI translation from inside Blender UI: first part.

This commit reshapes a bit runtime button info getter, by adding a new uiButGetStrInfo() which accepts a variable number of uiStringInfo parameters, and tries to fill them with the requested strings, for the given button (label, tip, context, RNA identifier, keymap, etc.). Currently used mostly by existing ui_tooltip_create(), and new UI_OT_edittranslation_init operator.

It also adds a few getters (to get RNA i18n context, and current language iso code).

Finally, it adds to C operators needed for the py ui_translation addon:
*UI_OT_edittranslation_init, which gathers requested data and launch the py operator.
*UI_OT_reloadtranslation, which forces a full reload of the whole UI translation (including rechecking the directory containing mo files).

For the first operator to work, it also adds a new user preferences path: i18n_branches_directory, to point to the /branch part of a bf-translation checkout.
12 files changed:
release/scripts/startup/bl_ui/space_userpref.py
source/blender/blenfont/BLF_translation.h
source/blender/blenfont/intern/blf_lang.c
source/blender/editors/include/UI_interface.h
source/blender/editors/interface/interface.c
source/blender/editors/interface/interface_handlers.c
source/blender/editors/interface/interface_ops.c
source/blender/editors/interface/interface_regions.c
source/blender/makesdna/DNA_userdef_types.h
source/blender/makesrna/RNA_access.h
source/blender/makesrna/intern/rna_access.c
source/blender/makesrna/intern/rna_userdef.c