|
This adds three new features:
* The ability to specify contexts in string property that are marked as PROP_PY_TRANSLATE, i.e. that are stored translated in RNA properties (used only by UI api funcs currently), using a simple 'context::message' format. Also done some cleanup in this area.
* A new bpy.app.i18n module giving some info about locales/translation stuff (current active locale, all locales currently known by blender, all translation contexts currently defined, etc.).
* The ability for addons to feature translations.
Addon translations work with py dictionaries: each addon features a dict {lang: {(context, message): translation, ...}, ...}, which is registered when the addon is enabled (and unregistered when disabled).
Then, when a key (context, message) is not found in regular mo catalog, if enabled, a cache dict for current locale is built from all registered addon translations, and key is searched in it.
Note: currently addons writers have to do all the work by hand, will add something (probably extend "edit translation" addon) to automate messages extraction from addons as well!
Total comments: 7
Total comments: 18
|
Unified diffs |
Side-by-side diffs |
Delta from patch set |
Stats (+879 lines, -47 lines) |
Patch |
|
|
intern/locale/boost_locale_wrapper.h
|
View
|
1
2
|
1 chunk |
+2 lines, -1 line |
0 comments
|
Download
|
|
|
intern/locale/boost_locale_wrapper.cpp
|
View
|
1
2
|
6 chunks |
+25 lines, -5 lines |
0 comments
|
Download
|
|
|
release/scripts/startup/bl_ui/space_userpref.py
|
View
|
1
2
|
1 chunk |
+1 line, -0 lines |
0 comments
|
Download
|
|
|
source/blender/blenfont/BLF_translation.h
|
View
|
1
2
|
2 chunks |
+58 lines, -1 line |
0 comments
|
Download
|
|
|
source/blender/blenfont/CMakeLists.txt
|
View
|
1
2
|
1 chunk |
+1 line, -0 lines |
0 comments
|
Download
|
|
|
source/blender/blenfont/SConscript
|
View
|
1
2
|
1 chunk |
+1 line, -1 line |
0 comments
|
Download
|
|
|
source/blender/blenfont/intern/blf_lang.c
|
View
|
1
2
|
5 chunks |
+67 lines, -4 lines |
0 comments
|
Download
|
|
|
source/blender/blenfont/intern/blf_translation.c
|
View
|
1
2
|
2 chunks |
+11 lines, -1 line |
0 comments
|
Download
|
|
|
source/blender/makesdna/DNA_userdef_types.h
|
View
|
1
2
|
1 chunk |
+5 lines, -4 lines |
0 comments
|
Download
|
|
|
source/blender/makesrna/RNA_types.h
|
View
|
1
2
|
1 chunk |
+3 lines, -4 lines |
0 comments
|
Download
|
|
|
source/blender/makesrna/intern/makesrna.c
|
View
|
1
2
|
1 chunk |
+1 line, -1 line |
0 comments
|
Download
|
|
|
source/blender/makesrna/intern/rna_define.c
|
View
|
1
2
|
1 chunk |
+1 line, -1 line |
0 comments
|
Download
|
|
|
source/blender/makesrna/intern/rna_rna.c
|
View
|
1
2
|
2 chunks |
+7 lines, -1 line |
2 comments
|
Download
|
|
|
source/blender/makesrna/intern/rna_ui.c
|
View
|
1
2
|
2 chunks |
+0 lines, -6 lines |
0 comments
|
Download
|
|
|
source/blender/makesrna/intern/rna_userdef.c
|
View
|
1
2
|
1 chunk |
+6 lines, -0 lines |
2 comments
|
Download
|
|
|
source/blender/makesrna/intern/rna_wm.c
|
View
|
1
2
|
2 chunks |
+0 lines, -6 lines |
0 comments
|
Download
|
|
|
source/blender/python/BPY_extern.h
|
View
|
1
2
|
1 chunk |
+5 lines, -0 lines |
0 comments
|
Download
|
|
|
source/blender/python/intern/CMakeLists.txt
|
View
|
1
2
|
2 chunks |
+2 lines, -0 lines |
0 comments
|
Download
|
|
|
source/blender/python/intern/bpy_app.c
|
View
|
1
2
|
3 chunks |
+11 lines, -1 line |
2 comments
|
Download
|
|
|
source/blender/python/intern/bpy_app_build_options.c
|
View
|
1
2
|
2 chunks |
+2 lines, -2 lines |
0 comments
|
Download
|
|
|
source/blender/python/intern/bpy_app_i18n.h
|
View
|
|
1 chunk |
+32 lines, -0 lines |
0 comments
|
Download
|
|
|
source/blender/python/intern/bpy_app_i18n.c
|
View
|
1
2
|
1 chunk |
+625 lines, -0 lines |
12 comments
|
Download
|
|
|
source/blender/python/intern/bpy_props.c
|
View
|
1
2
|
1 chunk |
+7 lines, -2 lines |
0 comments
|
Download
|
|
|
source/blender/python/intern/bpy_rna.c
|
View
|
1
2
|
1 chunk |
+6 lines, -6 lines |
0 comments
|
Download
|
Total messages: 8
|