From ee530bd3418e26d36aface40851f493da111e5dd Mon Sep 17 00:00:00 2001 From: lpradel Date: Sat, 5 Jul 2014 18:24:46 +0200 Subject: [PATCH] Added German language. --- src/api/api.cpp | 1 + src/api/api.h | 1 + src/backend/helpers.cpp | 6 ++++++ src/backend/helpers.h | 2 ++ src/gui/main.cpp | 2 ++ 5 files changed, 12 insertions(+) diff --git a/src/api/api.cpp b/src/api/api.cpp index d3867559..192cb183 100644 --- a/src/api/api.cpp +++ b/src/api/api.cpp @@ -81,6 +81,7 @@ const unsigned int loot_lang_chinese = loot::Language::chinese; const unsigned int loot_lang_polish = loot::Language::polish; const unsigned int loot_lang_brazilian_portuguese = loot::Language::brazilian_portuguese; const unsigned int loot_lang_finnish = loot::Language::finnish; +const unsigned int loot_lang_german = loot::Language::german; // LOOT cleanliness codes. const unsigned int loot_needs_cleaning_no = 0; diff --git a/src/api/api.h b/src/api/api.h index a447e374..0749fadb 100644 --- a/src/api/api.h +++ b/src/api/api.h @@ -179,6 +179,7 @@ LOOT_API extern const unsigned int loot_lang_chinese; ///< Tells the API to pre LOOT_API extern const unsigned int loot_lang_polish; ///< Tells the API to preferentially select Polish messages. LOOT_API extern const unsigned int loot_lang_brazilian_portuguese; ///< Tells the API to preferentially select Brazilian Portuguese messages. LOOT_API extern const unsigned int loot_lang_finnish; ///< Tells the API to preferentially select Finnish messages. +LOOT_API extern const unsigned int loot_lang_german; ///< Tells the API to preferentially select German messages. ///@} /*********************************//** diff --git a/src/backend/helpers.cpp b/src/backend/helpers.cpp index 9104ee05..99c551f4 100644 --- a/src/backend/helpers.cpp +++ b/src/backend/helpers.cpp @@ -242,6 +242,8 @@ namespace loot { Construct(Language::brazilian_portuguese); else if (nameOrCode == Language(Language::finnish).Name() || nameOrCode == Language(Language::finnish).Locale()) Construct(Language::finnish); + else if (nameOrCode == Language(Language::german).Name() || nameOrCode == Language(Language::german).Locale()) + Construct(Language::german); else Construct(Language::english); } @@ -276,6 +278,10 @@ namespace loot { _name = "suomi"; _locale = "fi"; } + else if (_code == Language::german) { + _name = "Deutsch"; + _locale = "de"; + } else { _name = "English"; _locale = "en"; diff --git a/src/backend/helpers.h b/src/backend/helpers.h index 7fcf55f9..6ed628c5 100644 --- a/src/backend/helpers.h +++ b/src/backend/helpers.h @@ -79,6 +79,7 @@ namespace loot { static const unsigned int polish = 6; static const unsigned int brazilian_portuguese = 7; static const unsigned int finnish = 8; + static const unsigned int german = 9; static std::vector Names() { std::vector vec; @@ -90,6 +91,7 @@ namespace loot { vec.push_back(Language(Language::polish).Name()); vec.push_back(Language(Language::brazilian_portuguese).Name()); vec.push_back(Language(Language::finnish).Name()); + vec.push_back(Language(Language::german).Name()); return vec; } private: diff --git a/src/gui/main.cpp b/src/gui/main.cpp index 06c5d395..9df77c8a 100644 --- a/src/gui/main.cpp +++ b/src/gui/main.cpp @@ -302,6 +302,8 @@ bool LOOT::OnInit() { wxLang = wxLANGUAGE_PORTUGUESE_BRAZILIAN; else if (lang.Code() == loot::Language::finnish) wxLang = wxLANGUAGE_FINNISH; + else if (lang.Code() == loot::Language::german) + wxLang = wxLANGUAGE_GERMAN; } //Boost.Locale initialisation: Specify location of language dictionaries.