This repository was archived by the owner on Sep 11, 2023. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +7
-6
lines changed
Expand file tree Collapse file tree 1 file changed +7
-6
lines changed Original file line number Diff line number Diff line change @@ -45,13 +45,14 @@ public TranslationProvider()
4545 /// <returns></returns>
4646 public static string Translate ( string phrase )
4747 {
48- if ( _langDictionary . ContainsKey ( phrase ) )
48+
49+ if ( _langDictionary . TryGetValue ( phrase , out var result ) )
4950 {
50- return _langDictionary [ phrase ] ;
51+ return result ;
5152 }
52- else if ( _defaultDictionary . ContainsKey ( phrase ) )
53+ else if ( _defaultDictionary . TryGetValue ( phrase , out result ) )
5354 {
54- return _defaultDictionary [ phrase ] ;
55+ return result ;
5556 }
5657 else
5758 {
@@ -170,7 +171,7 @@ public void UpdateTranslations()
170171 try
171172 {
172173 // Clear temp folder before beggining
173- DirUtils . ClearTempFolder ( ) ;
174+ DirUtils . ClearSPCodeTempFolder ( ) ;
174175
175176 // Download latest release zip file
176177 var wc = new WebClient ( ) ;
@@ -196,7 +197,7 @@ public void UpdateTranslations()
196197 }
197198
198199 // Delete all temp folder contents
199- DirUtils . ClearTempFolder ( ) ;
200+ DirUtils . ClearSPCodeTempFolder ( ) ;
200201
201202 // Update version to options object
202203 Program . OptionsObject . TranslationsVersion = int . Parse ( _latestVersion . Name ) ;
You can’t perform that action at this time.
0 commit comments