Commit Graph

17 Commits

Author SHA1 Message Date
Campbell Barton
dc5fe5d25f Fix bpy.so linking on Mac OS X
D345 from Aleksandr Derbenev
2014-04-02 09:03:01 +11:00
Jens Verwiebe
3ca606ffc3 Locale_wrapper: make the bad_cast catch more clear and fix the std::exception message 2014-02-26 17:33:44 +01:00
Jens Verwiebe
04ecf4d0db OSX: add debug mesg to bl_locale_pgettext for later indeep investigation 2014-02-24 11:18:17 +01:00
Jens Verwiebe
8be628cf7f Fix an uncaught exception on OSX, perhaps general with popups 2014-02-23 20:38:29 +01:00
Campbell Barton
aa8488421f style cleanup: whitespace & odd indentation 2013-09-21 10:46:58 +00:00
Brecht Van Lommel
b466a5c9a9 Fix #35890: memory leak in OS X ghost locale detection. 2013-06-27 13:24:55 +00:00
Brecht Van Lommel
2df82a2a2b Code cleanup: fix some vs2012 compiler warnings 2013-06-21 12:33:19 +00:00
Bastien Montagne
30556d4cd5 Some minor cleanup/polish... 2013-05-01 17:49:19 +00:00
Bastien Montagne
fd6ab0564d This should at least prevent crash in [#35172]... 2013-05-01 17:11:07 +00:00
Jens Verwiebe
4cfa28b5ed OSX/locale: a further cleanup 2013-03-04 10:31:01 +00:00
Jens Verwiebe
1c5f18f42b OSX: Get the current locale in objC-style 2013-03-02 22:50:46 +00:00
Bastien Montagne
cef730d969 Python i18n API. Many thanks to Campbell and Brecht for the reviews and suggestions!
This commit adds:
* A new bpy.app.translations 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, using the (un)register functions of above module.

* Also cleans up "translate py string when storing into RNA prop" by removing "PROP_TRANSLATE" string's subtype, and adding a PROP_STRING_PY_TRANSLATE flag instead (this way it is no more exposed to python...).

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, 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 soon(ish)! To get a look to expected behavior from addons, have a look at render_copy_settings/__init__.py and render_copy_settings/translations.py (rather stupid example currently, but...). Once we have a complete process, I'll also update relevant wiki pages.
2013-01-20 17:29:07 +00:00
Bastien Montagne
c0a697807a Add try/catch around i18n locale setter code, just in case... 2012-12-31 12:12:50 +00:00
Brecht Van Lommel
6094011c90 Fixes for OS X default locale: use pclose and do error checking for file read. 2012-11-21 15:14:19 +00:00
Jens Verwiebe
d314eef7a7 OSX/locale: moved command up, so errorchecking also happens 2012-11-21 14:29:34 +00:00
Jens Verwiebe
d0b7b0d228 OSX/locale: workaround to get osx system locale from user defaults 2012-11-21 13:54:54 +00:00
Bastien Montagne
5ff3017900 Replacing gettext i18n backend by boost::locale one.
This commit adds a small and simplistic C wrapper around boost's locale library as intern/locale, and heavily simplifies/reduces Blender's own i18n code (under blenfont/ dir). And it adds back UI translation on windows' official builds (with msvc)!

Note to platform maintainers: iconv and gettext (libintl) can now be removed from precompiled libs (not gettext binaries, under windows, of course ;) ).

Note to MinGW32/64 users: boost_locale lib has not yet been uploaded for those build env, please disable WITH_INTERNATIONAL for now (hopefully will be fixed very soon, have contacted psy-fy).
2012-11-11 16:54:26 +00:00