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 1
1
using System ;
2
2
using System . Collections . Generic ;
3
3
using System . Diagnostics ;
4
+ using System . Globalization ;
4
5
using System . IO ;
5
6
using System . Net . Http ;
6
7
using System . Reflection ;
@@ -194,6 +195,17 @@ app.Resources[localeKey] is not ResourceDictionary targetLocale ||
194
195
if ( app . _activeLocale != null )
195
196
app . Resources . MergedDictionaries . Remove ( app . _activeLocale ) ;
196
197
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
+
197
209
app . Resources . MergedDictionaries . Add ( targetLocale ) ;
198
210
app . _activeLocale = targetLocale ;
199
211
}
Original file line number Diff line number Diff line change @@ -7,15 +7,15 @@ public static class LongConverters
7
7
public static readonly FuncValueConverter < long , string > ToFileSize = new ( bytes =>
8
8
{
9
9
if ( bytes < KB )
10
- return $ "{ bytes } B";
10
+ return $ "{ bytes : N0 } B";
11
11
12
12
if ( bytes < MB )
13
- return $ "{ ( bytes / KB ) : F3 } KB ({ bytes } B )";
13
+ return $ "{ ( bytes / KB ) : N3 } KB ({ bytes : N0 } )";
14
14
15
15
if ( bytes < GB )
16
- return $ "{ ( bytes / MB ) : F3 } MB ({ bytes } B )";
16
+ return $ "{ ( bytes / MB ) : N3 } MB ({ bytes : N0 } )";
17
17
18
- return $ "{ ( bytes / GB ) : F3 } GB ({ bytes } B )";
18
+ return $ "{ ( bytes / GB ) : N3 } GB ({ bytes : N0 } )";
19
19
} ) ;
20
20
21
21
private const double KB = 1024 ;
You can’t perform that action at this time.
0 commit comments