|
|
|
@ -24,22 +24,18 @@ namespace Translation
|
|
|
|
|
const std::string& extension,
|
|
|
|
|
const Files::Collections& dataFileCollections)
|
|
|
|
|
{
|
|
|
|
|
std::string path;
|
|
|
|
|
try
|
|
|
|
|
{
|
|
|
|
|
path = dataFileCollections.getCollection(extension).getPath(fileNameNoExtension + extension).string();
|
|
|
|
|
}
|
|
|
|
|
catch(...)
|
|
|
|
|
std::string fileName = fileNameNoExtension + extension;
|
|
|
|
|
|
|
|
|
|
if (dataFileCollections.getCollection (extension).doesExist (fileName))
|
|
|
|
|
{
|
|
|
|
|
//no file
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
std::string path = dataFileCollections.getCollection (extension).getPath (fileName).string();
|
|
|
|
|
|
|
|
|
|
std::ifstream stream (path);
|
|
|
|
|
if (stream.is_open())
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
if (!stream.is_open())
|
|
|
|
|
throw std::runtime_error ("failed to open translation file: " + fileName);
|
|
|
|
|
|
|
|
|
|
loadDataFromStream(container, stream);
|
|
|
|
|
stream.close();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|