diff options
author | Ken Moore <moorekou@gmail.com> | 2015-12-01 16:44:32 -0500 |
---|---|---|
committer | Ken Moore <moorekou@gmail.com> | 2015-12-01 16:44:32 -0500 |
commit | 2f521da9aa36926f5dc451a82ab68fd98d04aefd (patch) | |
tree | 77ded8c753cf87708d341880e8e38325a622b8c9 /libLumina/LuminaUtils.cpp | |
parent | Add a link to the Lumina IRC channel in the lumina-info utility, and also cre... (diff) | |
download | lumina-2f521da9aa36926f5dc451a82ab68fd98d04aefd.tar.gz lumina-2f521da9aa36926f5dc451a82ab68fd98d04aefd.tar.bz2 lumina-2f521da9aa36926f5dc451a82ab68fd98d04aefd.zip |
Fix up the loading of locales through the StartMenu/Session. Now it will properly make the locale changes *if* it could properly load the locale (ensuring consistency between system/session).
Diffstat (limited to 'libLumina/LuminaUtils.cpp')
-rw-r--r-- | libLumina/LuminaUtils.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/libLumina/LuminaUtils.cpp b/libLumina/LuminaUtils.cpp index 0e836748..cad7f817 100644 --- a/libLumina/LuminaUtils.cpp +++ b/libLumina/LuminaUtils.cpp @@ -326,6 +326,14 @@ void LUtils::setLocaleEnv(QString lang, QString msg, QString time, QString num,Q } } +QString LUtils::currentLocale(){ + QString curr = getenv("LC_ALL");// = QLocale::system(); + if(curr.isEmpty()){ curr = getenv("LANG"); } + if(curr.isEmpty()){ curr = "en_US"; } + curr = curr.section(".",0,0); //remove any encodings off the end + return curr; +} + double LUtils::DisplaySizeToBytes(QString num){ //qDebug() << "Convert Num to Bytes:" << num; num = num.toLower().simplified(); |