summaryrefslogtreecommitdiff
path: root/src/being
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2017-04-05 19:03:59 +0300
committerAndrei Karas <akaras@inbox.ru>2017-04-05 19:03:59 +0300
commit3b4ffd7199d990d1cbd0e7cbe23fa41f04d38e74 (patch)
treefe7ab920632207462354714e12604e2064d059ea /src/being
parentd8a530e299b4dd04c020ca3e3eeda7b12f89b69b (diff)
downloadplus-3b4ffd7199d990d1cbd0e7cbe23fa41f04d38e74.tar.gz
plus-3b4ffd7199d990d1cbd0e7cbe23fa41f04d38e74.tar.bz2
plus-3b4ffd7199d990d1cbd0e7cbe23fa41f04d38e74.tar.xz
plus-3b4ffd7199d990d1cbd0e7cbe23fa41f04d38e74.zip
Add chat command for translate message from player language to english.
Also add po field into languages.xml.
Diffstat (limited to 'src/being')
-rw-r--r--src/being/being.h3
-rw-r--r--src/being/playerinfo.cpp17
-rw-r--r--src/being/playerinfo.h4
3 files changed, 24 insertions, 0 deletions
diff --git a/src/being/being.h b/src/being/being.h
index 0110f3141..79f9a4d83 100644
--- a/src/being/being.h
+++ b/src/being/being.h
@@ -1063,6 +1063,9 @@ class Being notfinal : public ActorSprite,
void setLanguageId(const int lang) restrict2 noexcept2;
+ int getLanguageId() restrict2 noexcept2 A_WARN_UNUSED
+ { return mLanguageId; }
+
uint16_t getTeamId() const restrict2 noexcept2 A_WARN_UNUSED
{ return mTeamId; }
diff --git a/src/being/playerinfo.cpp b/src/being/playerinfo.cpp
index 25620d5ba..8a9c55c5e 100644
--- a/src/being/playerinfo.cpp
+++ b/src/being/playerinfo.cpp
@@ -42,6 +42,8 @@
#include "utils/delete2.h"
+#include "utils/translation/translationmanager.h"
+
#include "debug.h"
namespace PlayerInfo
@@ -64,6 +66,7 @@ BeingId mElementalId = BeingId_zero;
Trading mTrading = Trading_false;
bool mVending = false;
int mLevelProgress = 0;
+int mServerLanguage = -1;
std::set<int> mProtectedItems;
// --- Triggers ---------------------------------------------------------------
@@ -639,4 +642,18 @@ bool isVending()
return mVending;
}
+void setServerLanguage(const int lang)
+{
+ if (lang != mServerLanguage)
+ {
+ mServerLanguage = lang;
+ TranslationManager::loadDictionaryLang();
+ }
+}
+
+int getServerLanguage()
+{
+ return mServerLanguage;
+}
+
} // namespace PlayerInfo
diff --git a/src/being/playerinfo.h b/src/being/playerinfo.h
index 0372bafc4..1c81d7761 100644
--- a/src/being/playerinfo.h
+++ b/src/being/playerinfo.h
@@ -297,6 +297,10 @@ namespace PlayerInfo
void enableVending(const bool b);
bool isVending() A_WARN_UNUSED;
+
+ void setServerLanguage(const int lang);
+
+ int getServerLanguage() A_WARN_UNUSED;
} // namespace PlayerInfo
#endif // BEING_PLAYERINFO_H