Skip to content

Commit fdf19e4

Browse files
authored
Merge pull request doxygen#12105 from albert-github/feature/issue_12104
2 parents 1403c05 + a2e2af9 commit fdf19e4

2 files changed

Lines changed: 9 additions & 49 deletions

File tree

addon/doxywizard/translationmanager.cpp

Lines changed: 9 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -62,39 +62,35 @@ void TranslationManager::loadAvailableLanguages()
6262
struct LanguageData {
6363
const char *code;
6464
const char *nativeName;
65-
const char *englishName;
6665
};
6766

6867
static const std::array languageTable = {
69-
LanguageData { "en", "English", "English" },
70-
LanguageData { "zh_CN", "简体中文", "Simplified Chinese" },
71-
LanguageData { "zh_TW", "繁體中文", "Traditional Chinese" },
72-
LanguageData { "de", "Deutsch", "German" },
73-
LanguageData { "fr", "Français", "French" },
74-
LanguageData { "ja", "日本語", "Japanese" },
75-
LanguageData { "ko", "한국어", "Korean" },
76-
LanguageData { "es", "Español", "Spanish" },
77-
LanguageData { "ru", "Русский", "Russian" }
68+
LanguageData { "en", "English" },
69+
LanguageData { "zh_CN", "简体中文" },
70+
LanguageData { "zh_TW", "繁體中文" },
71+
LanguageData { "de", "Deutsch" },
72+
LanguageData { "fr", "Français" },
73+
LanguageData { "ja", "日本語" },
74+
LanguageData { "ko", "한국어" },
75+
LanguageData { "es", "Español" },
76+
LanguageData { "ru", "Русский" }
7877
};
7978

8079
for (const auto &lang : languageTable)
8180
{
8281
LanguageInfo info;
8382
info.code = QString::fromLatin1(lang.code);
8483
info.nativeName = QString::fromUtf8(lang.nativeName);
85-
info.englishName = QString::fromLatin1(lang.englishName);
8684

8785
if (info.code == QLatin1String("en"))
8886
{
8987
info.tsFile = QString();
9088
info.qmFile = QString();
91-
info.optionsQmFile = QString();
9289
}
9390
else
9491
{
9592
info.tsFile = QString::fromLatin1("doxywizard_%1.ts").arg(info.code);
9693
info.qmFile = QString::fromLatin1("doxywizard_%1.qm").arg(info.code);
97-
info.optionsQmFile = QString::fromLatin1("doxywizard_options_%1.qm").arg(info.code);
9894
}
9995

10096
m_languages.insert(info.code, info);
@@ -213,9 +209,6 @@ bool TranslationManager::switchLanguage(const QString &langCode)
213209
}
214210
qApp->installTranslator(m_translator);
215211

216-
// Note: Options translations are now handled via localized config_xx.xml files
217-
// The doxywizard_options_xx.qm files are no longer loaded here
218-
219212
m_qtTranslator = new QTranslator(this);
220213
#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
221214
QString qtQmPath = QLibraryInfo::path(QLibraryInfo::TranslationsPath) +
@@ -330,33 +323,3 @@ QString TranslationManager::tsFilePath(const QString &langCode) const
330323

331324
return m_languages[langCode].tsFile;
332325
}
333-
334-
QString TranslationManager::qmOptionsFilePath(const QString &langCode) const
335-
{
336-
if (!m_languages.contains(langCode))
337-
{
338-
return QString();
339-
}
340-
341-
const LanguageInfo &info = m_languages[langCode];
342-
if (info.optionsQmFile.isEmpty())
343-
{
344-
return QString();
345-
}
346-
347-
QString resourcePath = QString::fromLatin1(":/translations/") + info.optionsQmFile;
348-
if (QFileInfo::exists(resourcePath))
349-
{
350-
return resourcePath;
351-
}
352-
353-
QString appDir = QCoreApplication::applicationDirPath();
354-
QString qmPath = appDir + QDir::separator() + info.optionsQmFile;
355-
356-
if (QFileInfo::exists(qmPath))
357-
{
358-
return qmPath;
359-
}
360-
361-
return QString();
362-
}

addon/doxywizard/translationmanager.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,8 @@ class TranslationManager : public QObject
2727
{
2828
QString code;
2929
QString nativeName;
30-
QString englishName;
3130
QString tsFile;
3231
QString qmFile;
33-
QString optionsQmFile;
3432
};
3533

3634
TranslationManager();
@@ -62,7 +60,6 @@ class TranslationManager : public QObject
6260
bool loadTranslation(const QString &qmFilePath);
6361
void unloadTranslation();
6462
QString qmFilePath(const QString &langCode) const;
65-
QString qmOptionsFilePath(const QString &langCode) const;
6663
QString tsFilePath(const QString &langCode) const;
6764

6865
QTranslator *m_translator;

0 commit comments

Comments
 (0)