2012-12-23 19:23:24 +00:00
|
|
|
#ifndef COMPONENTS_TRANSLATION_DATA_H
|
|
|
|
#define COMPONENTS_TRANSLATION_DATA_H
|
|
|
|
|
|
|
|
#include <components/to_utf8/to_utf8.hpp>
|
|
|
|
#include <components/files/collections.hpp>
|
|
|
|
|
2012-12-26 16:06:33 +00:00
|
|
|
namespace Translation
|
2012-12-23 19:23:24 +00:00
|
|
|
{
|
|
|
|
class Storage
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
|
|
|
|
void loadTranslationData(const Files::Collections& dataFileCollections,
|
|
|
|
const std::string& esmFileName);
|
|
|
|
|
|
|
|
std::string translateCellName(const std::string& cellName) const;
|
|
|
|
std::string topicID(const std::string& phrase) const;
|
|
|
|
|
2012-12-31 00:15:47 +00:00
|
|
|
// Standard form usually means nominative case
|
|
|
|
std::string topicStandardForm(const std::string& phrase) const;
|
|
|
|
|
2012-12-26 16:03:37 +00:00
|
|
|
void setEncoding (const ToUTF8::FromType& encoding);
|
|
|
|
|
2012-12-31 00:15:47 +00:00
|
|
|
bool hasTranslation() const;
|
|
|
|
|
2012-12-23 19:23:24 +00:00
|
|
|
private:
|
|
|
|
typedef std::map<std::string, std::string> ContainerType;
|
|
|
|
|
|
|
|
void loadData(ContainerType& container,
|
|
|
|
const std::string& fileNameNoExtension,
|
|
|
|
const std::string& extension,
|
|
|
|
const Files::Collections& dataFileCollections);
|
|
|
|
|
|
|
|
void loadDataFromStream(ContainerType& container, std::istream& stream);
|
|
|
|
|
|
|
|
|
|
|
|
ToUTF8::FromType mEncoding;
|
2013-01-03 14:01:08 +00:00
|
|
|
ToUTF8::Utf8Encoder mEncoder;
|
2012-12-31 00:15:47 +00:00
|
|
|
ContainerType mCellNamesTranslations, mTopicIDs, mPhraseForms;
|
2012-12-23 19:23:24 +00:00
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|