diff --git a/CMakeLists.txt b/CMakeLists.txt index 825e846f2..561b91fce 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -440,7 +440,6 @@ set(SOURCES src/core/systemtrayicon.cpp src/core/localredirectserver.cpp src/core/mimedata.cpp - src/core/potranslator.cpp src/core/temporaryfile.cpp src/utilities/strutils.cpp src/utilities/envutils.cpp @@ -773,7 +772,6 @@ set(HEADERS src/core/urlhandler.h src/core/standarditemiconloader.h src/core/translations.h - src/core/potranslator.h src/core/mimedata.h src/core/stylesheetloader.h src/core/localredirectserver.h diff --git a/src/core/potranslator.cpp b/src/core/potranslator.cpp deleted file mode 100644 index decf8b271..000000000 --- a/src/core/potranslator.cpp +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Strawberry Music Player - * This file was part of Clementine. - * Copyright 2010, David Sansome - * Copyright 2018-2024, Jonas Kvinge - * - * Strawberry is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Strawberry is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with Strawberry. If not, see . - * - */ - -#include - -#include "potranslator.h" - -PoTranslator::PoTranslator(QObject *parent) : QTranslator(parent) {} - -QString PoTranslator::translate(const char *context, const char *source_text, const char *disambiguation, const int n) const { - - QString ret = QTranslator::translate(context, source_text, disambiguation, n); - if (!ret.isEmpty()) return ret; - return QTranslator::translate(nullptr, source_text, disambiguation, n); - -} diff --git a/src/core/potranslator.h b/src/core/potranslator.h deleted file mode 100644 index ac0fb4d70..000000000 --- a/src/core/potranslator.h +++ /dev/null @@ -1,39 +0,0 @@ -/* - * Strawberry Music Player - * This file was part of Clementine. - * Copyright 2010, David Sansome - * Copyright 2018-2024, Jonas Kvinge - * - * Strawberry is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Strawberry is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with Strawberry. If not, see . - * - */ - -#ifndef POTRANSLATOR_H -#define POTRANSLATOR_H - -#include -#include - -// We convert from .po files to .qm files, which loses context information. -// This translator tries loading strings with an empty context if it can't find any others. - -class PoTranslator : public QTranslator { - Q_OBJECT - - public: - explicit PoTranslator(QObject *parent = nullptr); - QString translate(const char *context, const char *source_text, const char *disambiguation = nullptr, int n = -1) const override; -}; - -#endif // POTRANSLATOR_H diff --git a/src/core/translations.cpp b/src/core/translations.cpp index cf7f48e01..8abe3b61c 100644 --- a/src/core/translations.cpp +++ b/src/core/translations.cpp @@ -27,7 +27,6 @@ #include "translations.h" #include "core/logging.h" -#include "core/potranslator.h" using namespace Qt::Literals::StringLiterals; @@ -45,7 +44,7 @@ Translations::~Translations() { void Translations::LoadTranslation(const QString &prefix, const QString &path, const QString &language) { const QString basefilename = prefix + u'_' + language; - QTranslator *t = new PoTranslator; + QTranslator *t = new QTranslator; if (t->load(basefilename, path)) { qLog(Debug) << "Tranlations loaded from" << basefilename; QCoreApplication::installTranslator(t);