diff --git a/ArchiSteamFarm/ASF.cs b/ArchiSteamFarm/ASF.cs index ecc74e0f0..7b5eb9805 100644 --- a/ArchiSteamFarm/ASF.cs +++ b/ArchiSteamFarm/ASF.cs @@ -36,6 +36,7 @@ using ArchiSteamFarm.Localization; namespace ArchiSteamFarm { internal static class ASF { private const byte AutoUpdatePeriodInHours = 24; + private static readonly ConcurrentDictionary LastWriteTimes = new ConcurrentDictionary(); private static Timer AutoUpdatesTimer; diff --git a/ArchiSteamFarm/Localization/Strings.Designer.cs b/ArchiSteamFarm/Localization/Strings.Designer.cs index 7ea88f345..ad5880450 100644 --- a/ArchiSteamFarm/Localization/Strings.Designer.cs +++ b/ArchiSteamFarm/Localization/Strings.Designer.cs @@ -1233,6 +1233,15 @@ namespace ArchiSteamFarm.Localization { } } + /// + /// Looks up a localized string similar to ASF will attempt to use your preferred {0} culture, but translation in that language was completed only in {1}. Perhaps you could help us improve ASF translation for your language?. + /// + internal static string TranslationIncomplete { + get { + return ResourceManager.GetString("TranslationIncomplete", resourceCulture); + } + } + /// /// Looks up a localized string similar to Unknown command!. /// diff --git a/ArchiSteamFarm/Localization/Strings.resx b/ArchiSteamFarm/Localization/Strings.resx index 2c1975394..8878048f7 100644 --- a/ArchiSteamFarm/Localization/Strings.resx +++ b/ArchiSteamFarm/Localization/Strings.resx @@ -693,4 +693,8 @@ StackTrace: Your provided CurrentCulture is invalid, ASF will keep running with default one! + + ASF will attempt to use your preferred {0} culture, but translation in that language was completed only in {1}. Perhaps you could help us improve ASF translation for your language? + {0} will be replaced by 4-letter culture code, such as "en-US", {1} will be replaced by completeness percentage, such as "78.5%" + \ No newline at end of file diff --git a/ArchiSteamFarm/Program.cs b/ArchiSteamFarm/Program.cs index 4ade7edb7..2657e49cf 100644 --- a/ArchiSteamFarm/Program.cs +++ b/ArchiSteamFarm/Program.cs @@ -29,6 +29,7 @@ using System.Globalization; using System.IO; using System.Linq; using System.Reflection; +using System.Resources; using System.ServiceProcess; using System.Threading; using System.Threading.Tasks; @@ -221,6 +222,24 @@ namespace ArchiSteamFarm { } } + int defaultResourceSetCount = 0; + int currentResourceSetCount = 0; + + ResourceSet defaultResourceSet = Strings.ResourceManager.GetResourceSet(CultureInfo.CreateSpecificCulture("en-US"), true, true); + if (defaultResourceSet != null) { + defaultResourceSetCount = defaultResourceSet.Cast().Count(); + } + + ResourceSet currentResourceSet = Strings.ResourceManager.GetResourceSet(CultureInfo.CurrentCulture, true, false); + if (currentResourceSet != null) { + currentResourceSetCount = currentResourceSet.Cast().Count(); + } + + if ((currentResourceSetCount < defaultResourceSetCount) && (defaultResourceSetCount > 0)) { + float translationCompleteness = currentResourceSetCount / (float) defaultResourceSetCount; + ArchiLogger.LogGenericInfo(string.Format(Strings.TranslationIncomplete, CultureInfo.CurrentCulture.Name, translationCompleteness.ToString("P1"))); + } + string globalDatabaseFile = Path.Combine(SharedInfo.ConfigDirectory, SharedInfo.GlobalDatabaseFileName); if (!File.Exists(globalDatabaseFile)) {