1
0
Fork 1
mirror of https://github.com/TES3MP/openmw-tes3mp.git synced 2025-01-15 15:19:55 +00:00
openmw-tes3mp/components/translation/translation.hpp

53 lines
1.5 KiB
C++

#ifndef COMPONENTS_TRANSLATION_DATA_H
#define COMPONENTS_TRANSLATION_DATA_H
#include <components/to_utf8/to_utf8.hpp>
#include <components/files/collections.hpp>
namespace Translation
{
class Storage
{
public:
Storage();
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;
// Standard form usually means nominative case
std::string topicStandardForm(const std::string& phrase) const;
void setEncoder(ToUTF8::Utf8Encoder* encoder);
bool hasTranslation() const;
/*
Start of tes3mp addition
Get the localized version of an English topic ID
*/
std::string getLocalizedTopicId(const std::string& englishTopicId) const;
/*
End of tes3mp addition
*/
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::Utf8Encoder* mEncoder;
ContainerType mCellNamesTranslations, mTopicIDs, mPhraseForms;
};
}
#endif