diff options
author | Tadao Tanikawa <tanikawa.tadao@jp.panasonic.com> | 2017-12-20 00:20:38 +0900 |
---|---|---|
committer | Tadao Tanikawa <tanikawa.tadao@jp.panasonic.com> | 2017-12-20 00:20:38 +0900 |
commit | 673e806f312b1fda4bee4af30e59699bb1f3547c (patch) | |
tree | 9754ee55da016c6b73080ec858e0fec200aa1a97 /app/translator.cpp | |
parent | 8651e32f3897c10cb2a71464fc8122b288091472 (diff) |
Revert "I18N: add basic functionality and a few translations"
NOTE: I18N features isn't supported in EEL/CES2018 yet.
This reverts commit e26dac76bc82ba7888726cc0b2eb5103b50ef17e.
Signed-off-by: Tadao Tanikawa <tanikawa.tadao@jp.panasonic.com>
Diffstat (limited to 'app/translator.cpp')
-rw-r--r-- | app/translator.cpp | 52 |
1 files changed, 0 insertions, 52 deletions
diff --git a/app/translator.cpp b/app/translator.cpp deleted file mode 100644 index 9b67f13..0000000 --- a/app/translator.cpp +++ /dev/null @@ -1,52 +0,0 @@ -#include "translator.h" - -#include <QtCore/QCoreApplication> -#include <QtCore/QLocale> -#include <QtCore/QTranslator> -#include <QtCore/QDir> -#include <QtCore/QDebug> - -Translator::Translator(QObject *parent) - : QObject(parent) - , m_language(QStringLiteral("C")) - , m_translator(nullptr) -{ -} - -QString Translator::translate(const QString &string, const QString &language) const -{ - Q_UNUSED(language) - return string; -} - -QString Translator::language() const -{ - return m_language; -} - -void Translator::setLanguage(const QString &language) -{ - if (m_language == language) return; - m_language = language; - setTranslator(language); - emit languageChanged(language); -} - -void Translator::setTranslator(const QString &language) -{ - if (m_translator) { - QCoreApplication::removeTranslator(m_translator); - } else { - m_translator = new QTranslator(this); - } - QLocale locale(language); - QString fileName = QCoreApplication::instance()->applicationName().toLower(); - qDebug() << "####" << QDir::currentPath() << QCoreApplication::applicationDirPath(); - if (m_translator->load(locale, fileName, QStringLiteral("_"), QStringLiteral("%1/../translations").arg(QCoreApplication::applicationDirPath()))) { - QCoreApplication::installTranslator(m_translator); - } else { - delete m_translator; - m_translator = nullptr; - } -} - |