24 #include "../Savegame/Soldier.h" 28 enum TextDirection { DIRECTION_LTR, DIRECTION_RTL };
29 enum TextWrapping { WRAP_WORDS, WRAP_LETTERS };
33 class LanguagePlurality;
43 std::map<std::string, LocalizedText> _strings;
45 TextDirection _direction;
48 static std::map<std::string, std::string> _names;
49 static std::vector<std::string> _rtl, _cjk;
52 std::string loadString(
const std::string &s)
const;
54 void load(
const std::string &filename);
61 static void getList(std::vector<std::string> &files, std::vector<std::string> &names);
63 void loadFile(
const std::string &filename);
65 void loadRule(
const std::map<std::string, ExtraStrings*> &extraStrings,
const std::string &
id);
67 std::string
getId()
const;
71 void toHtml(
const std::string &filename)
const;
void toHtml(const std::string &filename) const
Outputs the language to a HTML file.
Definition: Language.cpp:381
std::string getId() const
Gets the language's ID.
Definition: Language.cpp:255
This class is the interface used to find plural forms for the different languages.
Definition: LanguagePlurality.h:30
TextDirection getTextDirection() const
Gets the direction of text in this language.
Definition: Language.cpp:412
A string that is already translated.
Definition: LocalizedText.h:43
Language()
Creates a blank language.
Definition: Language.cpp:42
static void getList(std::vector< std::string > &files, std::vector< std::string > &names)
Gets list of languages in the data directory.
Definition: Language.cpp:111
Contains strings used throughout the game for localization.
Definition: Language.h:39
const LocalizedText & getString(const std::string &id) const
Get a localized text.
Definition: Language.cpp:275
std::string getName() const
Gets the language's name.
Definition: Language.cpp:264
TextWrapping getTextWrapping() const
Gets the wrapping of text in this language.
Definition: Language.cpp:422
void loadRule(const std::map< std::string, ExtraStrings *> &extraStrings, const std::string &id)
Loads the language from a ruleset file.
Definition: Language.cpp:224
void loadFile(const std::string &filename)
Loads the language from an external file.
Definition: Language.cpp:204
~Language()
Cleans up the language.
Definition: Language.cpp:100
Definition: BaseInfoState.cpp:40