Step 1 of X in getting translations working on the mac.
git-svn-id: https://warzone2100.svn.sourceforge.net/svnroot/warzone2100/trunk@9835 4a71c877-e1ca-e34f-864e-861f7616d084master
parent
e943eb0ff7
commit
a3f8200327
|
@ -23,6 +23,10 @@
|
||||||
|
|
||||||
#include "string_ext.h"
|
#include "string_ext.h"
|
||||||
|
|
||||||
|
#ifdef WZ_OS_MAC
|
||||||
|
# include <CoreFoundation/CoreFoundation.h>
|
||||||
|
# include <CoreFoundation/CFURL.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
/* Always use fallbacks on Windows */
|
/* Always use fallbacks on Windows */
|
||||||
#if defined(WZ_OS_WIN)
|
#if defined(WZ_OS_WIN)
|
||||||
|
@ -348,7 +352,25 @@ void initI18n(void)
|
||||||
textdomainDirectory = bindtextdomain(PACKAGE, localeDir);
|
textdomainDirectory = bindtextdomain(PACKAGE, localeDir);
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
|
#ifdef WZ_OS_MAC
|
||||||
|
{
|
||||||
|
char resourcePath[PATH_MAX];
|
||||||
|
CFURLRef resourceURL = CFBundleCopyResourcesDirectoryURL(CFBundleGetMainBundle());
|
||||||
|
if( CFURLGetFileSystemRepresentation( resourceURL, true, (UInt8 *) resourcePath, PATH_MAX) )
|
||||||
|
{
|
||||||
|
sstrcat(resourcePath, "/locale");
|
||||||
|
textdomainDirectory = bindtextdomain(PACKAGE, resourcePath);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
debug( LOG_ERROR, "Could not change to resources directory." );
|
||||||
|
}
|
||||||
|
|
||||||
|
debug(LOG_INFO, "resourcePath is %s", resourcePath);
|
||||||
|
}
|
||||||
|
#else
|
||||||
textdomainDirectory = bindtextdomain(PACKAGE, LOCALEDIR);
|
textdomainDirectory = bindtextdomain(PACKAGE, LOCALEDIR);
|
||||||
|
#endif
|
||||||
#endif
|
#endif
|
||||||
if (!textdomainDirectory)
|
if (!textdomainDirectory)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue