From 073d4833814576ec13831417ef663d5150cb7b72 Mon Sep 17 00:00:00 2001 From: peri4 Date: Fri, 29 Mar 2024 21:31:39 +0300 Subject: [PATCH] add QAD::loadedLanguage variable --- libs/utils/qad_locations.cpp | 3 +++ libs/utils/qad_locations.h | 1 + 2 files changed, 4 insertions(+) diff --git a/libs/utils/qad_locations.cpp b/libs/utils/qad_locations.cpp index 440f7f2..0bf250c 100644 --- a/libs/utils/qad_locations.cpp +++ b/libs/utils/qad_locations.cpp @@ -16,6 +16,8 @@ # define MOBILE_VIEW #endif +QString QAD::loadedLanguage; + class __QADTranslators__ { public: @@ -74,6 +76,7 @@ void QAD::loadTranslations(QString lang) { unloadTranslations(); if (lang.isEmpty()) lang = QLocale().bcp47Name(); QString short_lang = lang.left(2); + loadedLanguage = short_lang; QStringList dirs = resourcePaths("lang"); QString std_dir = QDir::cleanPath(QLibraryInfo::location(QLibraryInfo::TranslationsPath)); bool has_std = false; diff --git a/libs/utils/qad_locations.h b/libs/utils/qad_locations.h index 8ff22eb..2793426 100644 --- a/libs/utils/qad_locations.h +++ b/libs/utils/qad_locations.h @@ -54,6 +54,7 @@ QAD_UTILS_EXPORT void unloadTranslations(); QAD_UTILS_EXPORT QStringList availableTranslations(); +extern QAD_UTILS_EXPORT QString loadedLanguage; } // namespace QAD