File tree Expand file tree Collapse file tree 2 files changed +16
-4
lines changed
Expand file tree Collapse file tree 2 files changed +16
-4
lines changed Original file line number Diff line number Diff line change 11using System ;
22using System . Collections . Generic ;
33using System . Diagnostics ;
4+ using System . Globalization ;
45using System . IO ;
56using System . Net . Http ;
67using System . Reflection ;
@@ -194,6 +195,17 @@ app.Resources[localeKey] is not ResourceDictionary targetLocale ||
194195 if ( app . _activeLocale != null )
195196 app . Resources . MergedDictionaries . Remove ( app . _activeLocale ) ;
196197
198+ try
199+ {
200+ var culture = CultureInfo . GetCultureInfo ( localeKey . Replace ( "_" , "-" ) ) ;
201+ Thread . CurrentThread . CurrentUICulture = culture ;
202+ Thread . CurrentThread . CurrentCulture = culture ;
203+ }
204+ catch
205+ {
206+ // Just ignore
207+ }
208+
197209 app . Resources . MergedDictionaries . Add ( targetLocale ) ;
198210 app . _activeLocale = targetLocale ;
199211 }
Original file line number Diff line number Diff line change @@ -7,15 +7,15 @@ public static class LongConverters
77 public static readonly FuncValueConverter < long , string > ToFileSize = new ( bytes =>
88 {
99 if ( bytes < KB )
10- return $ "{ bytes } B";
10+ return $ "{ bytes : N0 } B";
1111
1212 if ( bytes < MB )
13- return $ "{ ( bytes / KB ) : F3 } KB ({ bytes } B )";
13+ return $ "{ ( bytes / KB ) : N3 } KB ({ bytes : N0 } )";
1414
1515 if ( bytes < GB )
16- return $ "{ ( bytes / MB ) : F3 } MB ({ bytes } B )";
16+ return $ "{ ( bytes / MB ) : N3 } MB ({ bytes : N0 } )";
1717
18- return $ "{ ( bytes / GB ) : F3 } GB ({ bytes } B )";
18+ return $ "{ ( bytes / GB ) : N3 } GB ({ bytes : N0 } )";
1919 } ) ;
2020
2121 private const double KB = 1024 ;
You can’t perform that action at this time.
0 commit comments