On MacOSX, define the LangPath as being i18n in the Resources path of the bundle
parent
b32f87bac7
commit
aeefdbd1be
|
@ -76,22 +76,25 @@ void CSystemUtilsMacOSX::Init()
|
||||||
|
|
||||||
// Make sure the directory exists
|
// Make sure the directory exists
|
||||||
boost::filesystem::create_directories(m_ASPath.c_str());
|
boost::filesystem::create_directories(m_ASPath.c_str());
|
||||||
}
|
|
||||||
|
|
||||||
std::string CSystemUtilsMacOSX::GetDataPath()
|
|
||||||
{
|
|
||||||
std::string dataPath;
|
|
||||||
// Get the Resources bundle URL
|
// Get the Resources bundle URL
|
||||||
CFBundleRef mainBundle = CFBundleGetMainBundle();
|
CFBundleRef mainBundle = CFBundleGetMainBundle();
|
||||||
CFURLRef resourcesURL = CFBundleCopyBundleURL(mainBundle);
|
CFURLRef resourcesURL = CFBundleCopyBundleURL(mainBundle);
|
||||||
CFStringRef str = CFURLCopyFileSystemPath( resourcesURL, kCFURLPOSIXPathStyle );
|
CFStringRef str = CFURLCopyFileSystemPath( resourcesURL, kCFURLPOSIXPathStyle );
|
||||||
CFRelease(resourcesURL);
|
CFRelease(resourcesURL);
|
||||||
|
|
||||||
dataPath = CFStringRefToStdString(str);
|
m_dataPath = CFStringRefToStdString(str);
|
||||||
dataPath += "/Contents/Resources";
|
m_dataPath += "/Contents/Resources";
|
||||||
GetLogger()->Trace("dataPath is %s\n", dataPath.c_str());
|
}
|
||||||
|
|
||||||
return dataPath;
|
std::string CSystemUtilsMacOSX::GetDataPath()
|
||||||
|
{
|
||||||
|
return m_dataPath;
|
||||||
|
}
|
||||||
|
|
||||||
|
std::string CSystemUtilsMacOSX::GetLangPath()
|
||||||
|
{
|
||||||
|
return m_dataPath + "/i18n";
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string CSystemUtilsMacOSX::GetProfileFileLocation()
|
std::string CSystemUtilsMacOSX::GetProfileFileLocation()
|
||||||
|
|
|
@ -29,9 +29,11 @@ public:
|
||||||
virtual void Init() override;
|
virtual void Init() override;
|
||||||
|
|
||||||
virtual std::string GetDataPath() override;
|
virtual std::string GetDataPath() override;
|
||||||
|
virtual std::string GetLangPath() override;
|
||||||
virtual std::string GetProfileFileLocation() override;
|
virtual std::string GetProfileFileLocation() override;
|
||||||
virtual std::string GetSavegameDirectoryLocation() override;
|
virtual std::string GetSavegameDirectoryLocation() override;
|
||||||
private:
|
private:
|
||||||
std::string m_ASPath;
|
std::string m_ASPath;
|
||||||
|
std::string m_dataPath;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue