MyGUI gettext compatibility problem?

siondream

03-07-2011 16:58:12

I'm trying to use gettext (i18n tool) to provide translations to my Ogre - MyGUI game. The first thing I do is:


#include <libintl.h>
#include <locale.h>

...

// Gettext
bind_textdomain_codeset ("siontower", "UTF-8");
setlocale(LC_ALL, "");
bindtextdomain("siontower", "lang" );
textdomain("siontower");


Then I continue the startup. Before anything starts rendering I get the following assertion error:


mygui: /home/david/programacion/ogre_src_v1-7-2/OgreMain/include/OgreAxisAlignedBox.h:252: void Ogre::AxisAlignedBox::setExtents(const Ogre::Vector3&, const Ogre::Vector3&): La declaraciĆ³n `(min.x <= max.x && min.y <= max.y && min.z <= max.z) && "The minimum corner of the box must be less than or equal to maximum corner"' failed.


When debugging with GDB I get this stacktrace:


Program received signal SIGABRT, Aborted.
0xb7fe1424 in __kernel_vsyscall ()
(gdb) where
#0 0xb7fe1424 in __kernel_vsyscall ()
#1 0xb73cf941 in raise (sig=6) at ../nptl/sysdeps/unix/sysv/linux/raise.c:64
#2 0xb73d2e42 in abort () at abort.c:92
#3 0xb73c88e8 in __assert_fail (assertion=0xb7e92ab0 "(min.x <= max.x && min.y <= max.y && min.z <= max.z) && \"The minimum corner of the box must be less than or equal to maximum corner\"",
file=0xb7e92a60 "/home/david/programacion/ogre_src_v1-7-2/OgreMain/include/OgreAxisAlignedBox.h", line=252, function=0xb7ebe1a0 "void Ogre::AxisAlignedBox::setExtents(const Ogre::Vector3&, const Ogre::Vector3&)") at assert.c:81
#4 0xb7cba37f in setExtents (this=0xb6957740, derive=true) at /home/david/programacion/ogre_src_v1-7-2/OgreMain/include/OgreAxisAlignedBox.h:252
#5 transformAffine (this=0xb6957740, derive=true) at /home/david/programacion/ogre_src_v1-7-2/OgreMain/include/OgreAxisAlignedBox.h:525
#6 Ogre::MovableObject::getWorldBoundingBox (this=0xb6957740, derive=true) at /home/david/programacion/ogre_src_v1-7-2/OgreMain/src/OgreMovableObject.cpp:321
#7 0xb7bc637c in Ogre::Entity::getWorldBoundingBox (this=0xb6957740, derive=<value optimised out>) at /home/david/programacion/ogre_src_v1-7-2/OgreMain/src/OgreEntity.cpp:526
#8 0xb7dadaf0 in Ogre::SceneNode::_updateBounds (this=0xb68f26b8) at /home/david/programacion/ogre_src_v1-7-2/OgreMain/src/OgreSceneNode.cpp:267
#9 0xb7dada7d in Ogre::SceneNode::_update (this=0xb68f26b8, updateChildren=<value optimised out>, parentHasChanged=<value optimised out>) at /home/david/programacion/ogre_src_v1-7-2/OgreMain/src/OgreSceneNode.cpp:89
#10 0xb7cbd9d2 in Ogre::Node::_update (this=0xb68c00c8, updateChildren=true, parentHasChanged=false) at /home/david/programacion/ogre_src_v1-7-2/OgreMain/src/OgreNode.cpp:206
#11 0xb7dada72 in Ogre::SceneNode::_update (this=0xb68c00c8, updateChildren=false, parentHasChanged=<value optimised out>) at /home/david/programacion/ogre_src_v1-7-2/OgreMain/src/OgreSceneNode.cpp:88
#12 0xb7d7ffc5 in Ogre::SceneManager::_updateSceneGraph (this=0xb687ecb0, cam=0xb6888060) at /home/david/programacion/ogre_src_v1-7-2/OgreMain/src/OgreSceneManager.cpp:2170
#13 0xb7d9677b in Ogre::SceneManager::_renderScene (this=0xb687ecb0, camera=0xb6888060, vp=0xb0fb52e8, includeOverlays=true) at /home/david/programacion/ogre_src_v1-7-2/OgreMain/src/OgreSceneManager.cpp:1380
#14 0xb7b807bd in Ogre::Camera::_renderScene (this=0xb6888060, vp=0xb0fb52e8, includeOverlays=<value optimised out>) at /home/david/programacion/ogre_src_v1-7-2/OgreMain/src/OgreCamera.cpp:412
#15 0xb7e738e0 in Ogre::Viewport::update (this=0x0) at /home/david/programacion/ogre_src_v1-7-2/OgreMain/src/OgreViewport.cpp:203
#16 0xb7d41f0a in Ogre::RenderTarget::_updateViewport (this=0xb6472680, viewport=0xb0fb52e8, updateStatistics=true) at /home/david/programacion/ogre_src_v1-7-2/OgreMain/src/OgreRenderTarget.cpp:146
#17 0xb7d41fea in Ogre::RenderTarget::_updateAutoUpdatedViewports (this=0xb6472680, updateStatistics=true) at /home/david/programacion/ogre_src_v1-7-2/OgreMain/src/OgreRenderTarget.cpp:124
#18 0xb7d413e8 in Ogre::RenderTarget::updateImpl (this=0xb6472680) at /home/david/programacion/ogre_src_v1-7-2/OgreMain/src/OgreRenderTarget.cpp:101
#19 0xb7d4177c in Ogre::RenderTarget::update (this=0xb6472680, swap=false) at /home/david/programacion/ogre_src_v1-7-2/OgreMain/src/OgreRenderTarget.cpp:541
#20 0xb7d2ac51 in Ogre::RenderSystem::_updateAllRenderTargets (this=0xb687ae78, swapBuffers=false) at /home/david/programacion/ogre_src_v1-7-2/OgreMain/src/OgreRenderSystem.cpp:112
#21 0xb7d6e9bd in Ogre::Root::_updateAllRenderTargets (this=0xb6873680) at /home/david/programacion/ogre_src_v1-7-2/OgreMain/src/OgreRoot.cpp:1374
#22 0xb7d6eb20 in Ogre::Root::renderOneFrame (this=0xb6873680) at /home/david/programacion/ogre_src_v1-7-2/OgreMain/src/OgreRoot.cpp:966
#23 0xb7d6eb8d in Ogre::Root::startRendering (this=0xb6873680) at /home/david/programacion/ogre_src_v1-7-2/OgreMain/src/OgreRoot.cpp:956
#24 0x0807f2db in StateManager::start (this=0x853dd50) at src/stateManager.cpp:116
#25 0x08054901 in Game::start (this=0x81388e0) at src/game.cpp:141
#26 0x0805d7fa in main (argc=1, argv=0xbffff3d4) at src/main.cpp:42
(gdb) quit


Everything seems correct, is there any know problem in using MyGUI with gettext?

Thanks.


EDIT: Ok, a friend of mine solved it. In the gettext initialization code I have to change LC_ALL for LC_MESSAGES:


bind_textdomain_codeset("siontower", "UTF-8");
setlocale(LC_MESSAGES, "");
bindtextdomain("siontower", "lang" );
textdomain("siontower");