aboutsummaryrefslogtreecommitdiff
path: root/common/translation.h
diff options
context:
space:
mode:
Diffstat (limited to 'common/translation.h')
-rw-r--r--common/translation.h23
1 files changed, 12 insertions, 11 deletions
diff --git a/common/translation.h b/common/translation.h
index ff0a8a2acf..18f55d5696 100644
--- a/common/translation.h
+++ b/common/translation.h
@@ -27,11 +27,12 @@
#include "common/singleton.h"
#include "common/str-array.h"
-#include "common/file.h"
-#include "common/fs.h"
namespace Common {
+class File;
+class FSNode;
+
enum TranslationIDs {
kTranslationAutodetectId = 0,
kTranslationBuiltinId = 1000
@@ -73,7 +74,7 @@ public:
* @param id Id of the language
* @return the matching string description of the language
*/
- const char *getLangById(int id);
+ String getLangById(int id) const;
/**
* Sets the current translation language to the one specified in the
@@ -82,7 +83,7 @@ public:
*
* @param lang Language to setup.
*/
- void setLanguage(const char *lang);
+ void setLanguage(const String &lang);
/**
* Sets the current translation language to the one specified by the
@@ -101,21 +102,21 @@ public:
* @return id of the language or kTranslationBuiltinId in case the
* language could not be found.
*/
- int parseLanguage(const String lang);
+ int parseLanguage(const String &lang) const;
/**
* Returns the translation into the current language of the parameter
* message. In case the message isn't found in the translation catalog,
* it returns the original untranslated message.
*/
- const char *getTranslation(const char *message);
+ const char *getTranslation(const char *message) const;
/**
* Returns the translation into the current language of the parameter
* message. In case the message isn't found in the translation catalog,
* it returns the original untranslated message.
*/
- String getTranslation(const String &message);
+ String getTranslation(const String &message) const;
/**
* Returns the translation into the current language of the parameter
@@ -126,7 +127,7 @@ public:
* translation, otherwise it will look for a translation for the same
* massage without a context or with a different context.
*/
- const char *getTranslation(const char *message, const char *context);
+ const char *getTranslation(const char *message, const char *context) const;
/**
* Returns the translation into the current language of the parameter
@@ -137,7 +138,7 @@ public:
* translation, otherwise it will look for a translation for the same
* massage without a context or with a different context.
*/
- String getTranslation(const String &message, const String &context);
+ String getTranslation(const String &message, const String &context) const;
/**
* Returns a list of supported languages.
@@ -149,12 +150,12 @@ public:
/**
* Returns charset specified by selected translation language
*/
- const char *getCurrentCharset();
+ String getCurrentCharset() const;
/**
* Returns currently selected translation language
*/
- const char *getCurrentLanguage();
+ String getCurrentLanguage() const;
private:
#ifdef USE_TRANSLATION