File tree Expand file tree Collapse file tree 5 files changed +24
-13
lines changed
Assets/PatchKit Patcher/Scripts Expand file tree Collapse file tree 5 files changed +24
-13
lines changed Original file line number Diff line number Diff line change @@ -8,6 +8,6 @@ public struct Changelog
88 /// Structure Versions.
99 /// </summary>
1010 [ JsonProperty ( "versions" ) ]
11- public Versions [ ] versions ;
11+ public ChangelogEntry [ ] versions ;
1212 }
1313}
Original file line number Diff line number Diff line change 22
33namespace PatchKit . Api . Models . Main
44{
5- public struct Versions
5+ public struct ChangelogEntry
66 {
77 /// <summary>
88 /// Version id.
File renamed without changes.
Original file line number Diff line number Diff line change @@ -62,7 +62,7 @@ private void LoadChangelogFromCache(string appSecret)
6262 }
6363 }
6464
65- private void CreateAndCacheChangelog ( string appSecret , Versions [ ] versions )
65+ private void CreateAndCacheChangelog ( string appSecret , ChangelogEntry [ ] versions )
6666 {
6767 try
6868 {
@@ -87,20 +87,20 @@ private void DestroyOldChangelog()
8787
8888 }
8989
90- private void CreateChangelog ( Versions [ ] versions )
90+ private void CreateChangelog ( ChangelogEntry [ ] versions )
9191 {
9292 DestroyOldChangelog ( ) ;
9393
94- foreach ( Versions version in versions )
94+ foreach ( ChangelogEntry version in versions )
9595 {
9696 CreateVersionChangelog ( version ) ;
9797 }
9898 }
9999
100- private void CreateVersionChangelog ( Versions version )
100+ private void CreateVersionChangelog ( ChangelogEntry changelogEntry )
101101 {
102- CreateVersionTitleWithPublishData ( version . VersionLabel , version . PublishTime ) ;
103- CreateVersionChangeList ( version . Changes ) ;
102+ CreateVersionTitleWithPublishData ( changelogEntry . VersionLabel , changelogEntry . PublishTime ) ;
103+ CreateVersionChangeList ( changelogEntry . Changes ) ;
104104 }
105105
106106 private void CreateVersionTitleWithPublishData ( string label , long publishTime )
Original file line number Diff line number Diff line change 1- using System . Globalization ;
1+ using System ;
2+ using System . Globalization ;
23using System . Linq ;
4+ using PatchKit . Unity . Patcher . Debug ;
35using UnityEngine ;
46
57namespace PatchKit . Unity . Utilities
68{
79 public static class CurrentCultureInfo
810 {
11+ private static readonly DebugLogger DebugLogger = new DebugLogger ( typeof ( CurrentCultureInfo ) ) ;
12+
913 public static CultureInfo GetCurrentCultureInfo ( )
1014 {
11- SystemLanguage currentLanguage = Application . systemLanguage ;
12- CultureInfo correspondingCultureInfo = CultureInfo . GetCultures ( CultureTypes . AllCultures )
13- . FirstOrDefault ( x => x . EnglishName . Equals ( currentLanguage . ToString ( ) ) ) ;
14- return CultureInfo . CreateSpecificCulture ( correspondingCultureInfo . TwoLetterISOLanguageName ) ;
15+ try
16+ {
17+ SystemLanguage currentLanguage = Application . systemLanguage ;
18+ CultureInfo correspondingCultureInfo = CultureInfo . GetCultures ( CultureTypes . AllCultures )
19+ . FirstOrDefault ( x => x . EnglishName . Equals ( currentLanguage . ToString ( ) ) ) ;
20+ return CultureInfo . CreateSpecificCulture ( correspondingCultureInfo . TwoLetterISOLanguageName ) ;
21+ } catch ( Exception e )
22+ {
23+ DebugLogger . LogWarning ( "Unable to get current culture info - " + e ) ;
24+ return CultureInfo . CurrentCulture ;
25+ }
1526 }
1627 }
1728}
You can’t perform that action at this time.
0 commit comments