Commit Graph

24 Commits

Author SHA1 Message Date
Campbell Barton
177a0ca131 Cleanup: comments (long lines) in various intern/ libs 2019-05-01 21:00:56 +10:00
Campbell Barton
e12c08e8d1 ClangFormat: apply to source, most of intern
Apply clang format as proposed in T53211.

For details on usage and instructions for migrating branches
without conflicts, see:

https://wiki.blender.org/wiki/Tools/ClangFormat
2019-04-17 06:21:24 +02:00
Campbell Barton
65ec7ec524 Cleanup: remove redundant, invalid info from headers
BF-admins agree to remove header information that isn't useful,
to reduce noise.

- BEGIN/END license blocks

  Developers should add non license comments as separate comment blocks.
  No need for separator text.

- Contributors

  This is often invalid, outdated or misleading
  especially when splitting files.

  It's more useful to git-blame to find out who has developed the code.

See P901 for script to perform these edits.
2019-02-02 01:36:28 +11:00
fa0fcbe4d6 Fix T56374, T57066, T58037: crash on startup on macOS when using translation. 2018-11-24 20:04:53 +01:00
Bastien Montagne
f22385f28e I18n: tweak/fix exception catching code of pgettex() wrapper.
Related to T57066, rather unlikely to fix core of the issue, but may
solve crash itself.
2018-10-23 14:36:05 +02:00
Campbell Barton
32be51dc66 Cleanup: warnings (msvc)
Part of patch D1670 by @LazyDodo
2015-12-21 13:02:38 +11:00
Jason Wilkins
8d084e8c8f Ghost Context Refactor
https://developer.blender.org/D643
Separates graphics context creation from window code in Ghost so that they can vary separately.
2014-10-07 15:47:32 -05:00
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