From ca47896204482bf4a6979e3838bf7f09f61cebeb Mon Sep 17 00:00:00 2001
From: giy <giy@omp-system.ru>
Date: Fri, 02 Sep 2022 14:16:56 +0300
Subject: [PATCH] Обновление до версии 2.9.0

---
 QtVsTools.Core/SR.cs |   29 +++++------------------------
 1 files changed, 5 insertions(+), 24 deletions(-)

diff --git a/QtVsTools.Core/SR.cs b/QtVsTools.Core/SR.cs
index ef66800..d5ed78b 100644
--- a/QtVsTools.Core/SR.cs
+++ b/QtVsTools.Core/SR.cs
@@ -1,6 +1,6 @@
 /****************************************************************************
 **
-** Copyright (C) 2016 The Qt Company Ltd.
+** Copyright (C) 2022 The Qt Company Ltd.
 ** Contact: https://www.qt.io/licensing/
 **
 ** This file is part of the Qt VS Tools.
@@ -26,10 +26,7 @@
 **
 ****************************************************************************/
 
-using System;
-using System.Globalization;
 using System.Resources;
-using System.Threading;
 
 namespace QtVsTools.Core
 {
@@ -37,7 +34,7 @@
     {
         static SR loader;
         readonly ResourceManager resources;
-        static readonly Object obj = new Object();
+        static readonly object obj = new object();
 
         internal SR()
         {
@@ -52,20 +49,7 @@
                         loader = new SR();
                 }
             }
-
             return loader;
-        }
-
-        private static CultureInfo Culture
-        {
-            get { return null/*use ResourceManager default, CultureInfo.CurrentUICulture*/; }
-            //get { return new CultureInfo("de-DE"); }
-        }
-
-        public static string LanguageName
-        {
-            get { return Thread.CurrentThread.CurrentUICulture.TwoLetterISOLanguageName; }
-            //get { return Culture.TwoLetterISOLanguageName; }
         }
 
         public static string GetString(string name, params object[] args)
@@ -73,19 +57,16 @@
             var sys = GetLoader();
             if (sys == null)
                 return null;
-            var res = sys.resources.GetString(name, Culture);
 
-            if (args != null && args.Length > 0)
+            var res = sys.resources.GetString(name, null);
+            if (args != null && args.Length > 0 && !string.IsNullOrEmpty(res))
                 return string.Format(res, args);
             return res;
         }
 
         public static string GetString(string name)
         {
-            var sys = GetLoader();
-            if (sys == null)
-                return null;
-            return sys.resources.GetString(name, Culture);
+            return GetString(name, null);
         }
     }
 }

--
Gitblit v1.9.1