This repository was archived by the owner on Sep 11, 2023. It is now read-only.
File tree 1 file changed +7
-6
lines changed
1 file changed +7
-6
lines changed Original file line number Diff line number Diff line change @@ -45,13 +45,14 @@ public TranslationProvider()
45
45
/// <returns></returns>
46
46
public static string Translate ( string phrase )
47
47
{
48
- if ( _langDictionary . ContainsKey ( phrase ) )
48
+
49
+ if ( _langDictionary . TryGetValue ( phrase , out var result ) )
49
50
{
50
- return _langDictionary [ phrase ] ;
51
+ return result ;
51
52
}
52
- else if ( _defaultDictionary . ContainsKey ( phrase ) )
53
+ else if ( _defaultDictionary . TryGetValue ( phrase , out result ) )
53
54
{
54
- return _defaultDictionary [ phrase ] ;
55
+ return result ;
55
56
}
56
57
else
57
58
{
@@ -170,7 +171,7 @@ public void UpdateTranslations()
170
171
try
171
172
{
172
173
// Clear temp folder before beggining
173
- DirUtils . ClearTempFolder ( ) ;
174
+ DirUtils . ClearSPCodeTempFolder ( ) ;
174
175
175
176
// Download latest release zip file
176
177
var wc = new WebClient ( ) ;
@@ -196,7 +197,7 @@ public void UpdateTranslations()
196
197
}
197
198
198
199
// Delete all temp folder contents
199
- DirUtils . ClearTempFolder ( ) ;
200
+ DirUtils . ClearSPCodeTempFolder ( ) ;
200
201
201
202
// Update version to options object
202
203
Program . OptionsObject . TranslationsVersion = int . Parse ( _latestVersion . Name ) ;
You can’t perform that action at this time.
0 commit comments