mirror of
https://github.com/JustArchiNET/ArchiSteamFarm.git
synced 2026-01-01 06:00:46 +00:00
Fix crash on machines that do not support qps-Ploc culture
E.g. mono
This commit is contained in:
@@ -249,7 +249,20 @@ namespace ArchiSteamFarm.IPC {
|
||||
#endif
|
||||
static options => {
|
||||
// We do not set the DefaultRequestCulture here, because it will default to Thread.CurrentThread.CurrentCulture in this case, which is set when loading GlobalConfig
|
||||
options.SupportedCultures = options.SupportedUICultures = CultureInfo.GetCultures(CultureTypes.AllCultures).Append(CultureInfo.CreateSpecificCulture(SharedInfo.LolcatCultureName)).ToList();
|
||||
|
||||
CultureInfo? lolcatCulture = null;
|
||||
|
||||
try {
|
||||
lolcatCulture = CultureInfo.CreateSpecificCulture(SharedInfo.LolcatCultureName);
|
||||
} catch (Exception e) {
|
||||
ASF.ArchiLogger.LogGenericDebuggingException(e);
|
||||
}
|
||||
|
||||
if (lolcatCulture == null) {
|
||||
options.SupportedCultures = options.SupportedUICultures = CultureInfo.GetCultures(CultureTypes.AllCultures);
|
||||
} else {
|
||||
options.SupportedCultures = options.SupportedUICultures = CultureInfo.GetCultures(CultureTypes.AllCultures).Append(lolcatCulture).ToList();
|
||||
}
|
||||
|
||||
// The default checks the URI and cookies and only then for headers; ASFs IPC does not use either of the higher priority mechanisms anywhere else and we don't want to start here.
|
||||
options.RequestCultureProviders = new List<IRequestCultureProvider>(1) { new AcceptLanguageHeaderRequestCultureProvider() };
|
||||
|
||||
Reference in New Issue
Block a user