Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/owncloud/client.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFabian Müller <fmueller@owncloud.com>2021-07-23 15:40:33 +0300
committerHannah von Reth <vonreth@kde.org>2021-07-28 16:47:20 +0300
commit2b5b9efa8b2b0495765451794857a5f7936e1127 (patch)
tree532181aa1a5dc032d2bea3ab7ec7b1526490f548 /src/gui/translations.cpp
parent2bcdfdc0d88c7fd0cb83ca805bea2a0fdd373079 (diff)
Load translations using Qt resources system
Diffstat (limited to 'src/gui/translations.cpp')
-rw-r--r--src/gui/translations.cpp17
1 files changed, 3 insertions, 14 deletions
diff --git a/src/gui/translations.cpp b/src/gui/translations.cpp
index a33a3e1fb..5f0bbaa8d 100644
--- a/src/gui/translations.cpp
+++ b/src/gui/translations.cpp
@@ -42,20 +42,9 @@ namespace Translations {
return QStringLiteral(".qm");
}
- QString applicationTrPath()
+ QString translationsDirectoryPath()
{
- const auto devTrPath = QDir(qApp->applicationDirPath() + QStringLiteral("/../src/gui/"));
- if (devTrPath.exists()) {
- // might miss Qt, QtKeyChain, etc.
- qCWarning(lcTranslations) << "Running from build location! Translations may be incomplete!";
- return devTrPath.absolutePath();
- }
-#ifdef Q_OS_MAC
- const auto translationDir = QStringLiteral("Translations");
-#else
- const auto translationDir = QStringLiteral("i18n");
-#endif
- return QStandardPaths::locate(QStandardPaths::AppDataLocation, translationDir, QStandardPaths::LocateDirectory);
+ return QStringLiteral(":/client/translations/");
}
QSet<QString> listAvailableTranslations()
@@ -65,7 +54,7 @@ namespace Translations {
// calculate a glob pattern which can be used in the iterator below to match only translations files
QString pattern = translationsFilePrefix() + "*" + translationsFileSuffix();
- QDirIterator it(Translations::applicationTrPath(), QStringList() << pattern);
+ QDirIterator it(Translations::translationsDirectoryPath(), QStringList() << pattern);
while (it.hasNext()) {
// extract locale part from filename