Skip to content

Commit ba0a113

Browse files
committed
Add translations & Use ShowMsgError
1 parent aed134f commit ba0a113

File tree

15 files changed

+39
-35
lines changed

15 files changed

+39
-35
lines changed

Flow.Launcher.Core/Plugin/PluginManager.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -719,7 +719,7 @@ internal static async Task<bool> UninstallPluginAsync(PluginMetadata plugin, boo
719719
catch (Exception e)
720720
{
721721
API.LogException(ClassName, $"Failed to delete plugin settings folder for {plugin.Name}", e);
722-
API.ShowMsg(API.GetTranslation("failedToRemovePluginSettingsTitle"),
722+
API.ShowMsgError(API.GetTranslation("failedToRemovePluginSettingsTitle"),
723723
string.Format(API.GetTranslation("failedToRemovePluginSettingsMessage"), plugin.Name));
724724
}
725725
}
@@ -735,7 +735,7 @@ internal static async Task<bool> UninstallPluginAsync(PluginMetadata plugin, boo
735735
catch (Exception e)
736736
{
737737
API.LogException(ClassName, $"Failed to delete plugin cache folder for {plugin.Name}", e);
738-
API.ShowMsg(API.GetTranslation("failedToRemovePluginCacheTitle"),
738+
API.ShowMsgError(API.GetTranslation("failedToRemovePluginCacheTitle"),
739739
string.Format(API.GetTranslation("failedToRemovePluginCacheMessage"), plugin.Name));
740740
}
741741
Settings.RemovePluginSettings(plugin.ID);

Flow.Launcher.Core/Updater.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ public async Task UpdateAppAsync(bool silentUpdate = true)
111111
}
112112

113113
if (!silentUpdate)
114-
_api.ShowMsg(_api.GetTranslation("update_flowlauncher_fail"),
114+
_api.ShowMsgError(_api.GetTranslation("update_flowlauncher_fail"),
115115
_api.GetTranslation("update_flowlauncher_check_connection"));
116116
}
117117
finally

Flow.Launcher.Infrastructure/Http/Http.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ var userName when string.IsNullOrEmpty(userName) =>
8282
}
8383
catch (UriFormatException e)
8484
{
85-
API.ShowMsg(API.GetTranslation("pleaseTryAgain"), API.GetTranslation("parseProxyFailed"));
85+
API.ShowMsgError(API.GetTranslation("pleaseTryAgain"), API.GetTranslation("parseProxyFailed"));
8686
Log.Exception(ClassName, "Unable to parse Uri", e);
8787
}
8888
}

Flow.Launcher/App.xaml.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -267,7 +267,7 @@ private static void AutoStartup()
267267
// but if it fails (permissions, etc) then don't keep retrying
268268
// this also gives the user a visual indication in the Settings widget
269269
_settings.StartFlowLauncherOnSystemStartup = false;
270-
API.ShowMsg(API.GetTranslation("setAutoStartFailed"), e.Message);
270+
API.ShowMsgError(API.GetTranslation("setAutoStartFailed"), e.Message);
271271
}
272272
}
273273
}

Flow.Launcher/Resources/Pages/WelcomePage5.xaml.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ private void ChangeAutoStartup(bool value)
5959
}
6060
catch (Exception e)
6161
{
62-
App.API.ShowMsg(App.API.GetTranslation("setAutoStartFailed"), e.Message);
62+
App.API.ShowMsgError(App.API.GetTranslation("setAutoStartFailed"), e.Message);
6363
}
6464
}
6565

Flow.Launcher/SettingPages/ViewModels/SettingsPaneGeneralViewModel.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ public bool StartFlowLauncherOnSystemStartup
6464
}
6565
catch (Exception e)
6666
{
67-
App.API.ShowMsg(App.API.GetTranslation("setAutoStartFailed"), e.Message);
67+
App.API.ShowMsgError(App.API.GetTranslation("setAutoStartFailed"), e.Message);
6868
}
6969
}
7070
}
@@ -91,7 +91,7 @@ public bool UseLogonTaskForStartup
9191
}
9292
catch (Exception e)
9393
{
94-
App.API.ShowMsg(App.API.GetTranslation("setAutoStartFailed"), e.Message);
94+
App.API.ShowMsgError(App.API.GetTranslation("setAutoStartFailed"), e.Message);
9595
}
9696
}
9797
}
@@ -217,7 +217,7 @@ public bool LegacyKoreanIMEEnabled
217217
else
218218
{
219219
// Since this is rarely seen text, language support is not provided.
220-
App.API.ShowMsg(App.API.GetTranslation("KoreanImeSettingChangeFailTitle"), App.API.GetTranslation("KoreanImeSettingChangeFailSubTitle"));
220+
App.API.ShowMsgError(App.API.GetTranslation("KoreanImeSettingChangeFailTitle"), App.API.GetTranslation("KoreanImeSettingChangeFailSubTitle"));
221221
}
222222
}
223223
}

Plugins/Flow.Launcher.Plugin.BrowserBookmark/Languages/en.xaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@
77
<system:String x:Key="flowlauncher_plugin_browserbookmark_plugin_name">Browser Bookmarks</system:String>
88
<system:String x:Key="flowlauncher_plugin_browserbookmark_plugin_description">Search your browser bookmarks</system:String>
99

10+
<!-- Main -->
11+
<system:String x:Key="flowlauncher_plugin_browserbookmark_copy_failed">Failed to set url in clipboard</system:String>
12+
"
1013
<!-- Settings -->
1114
<system:String x:Key="flowlauncher_plugin_browserbookmark_bookmarkDataSetting">Bookmark Data</system:String>
1215
<system:String x:Key="flowlauncher_plugin_browserbookmark_settings_openBookmarks">Open bookmarks in:</system:String>

Plugins/Flow.Launcher.Plugin.BrowserBookmark/Main.cs

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -223,11 +223,8 @@ public List<Result> LoadContextMenus(Result selectedResult)
223223
}
224224
catch (Exception e)
225225
{
226-
var message = "Failed to set url in clipboard";
227-
_context.API.LogException(ClassName, message, e);
228-
229-
_context.API.ShowMsg(message);
230-
226+
_context.API.LogException(ClassName, "Failed to set url in clipboard", e);
227+
_context.API.ShowMsgError(_context.API.GetTranslation("flowlauncher_plugin_browserbookmark_copy_failed"));
231228
return false;
232229
}
233230
},

Plugins/Flow.Launcher.Plugin.Explorer/ContextMenu.cs

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -132,9 +132,8 @@ public List<Result> LoadContextMenus(Result selectedResult)
132132
}
133133
catch (Exception e)
134134
{
135-
var message = "Fail to set text in clipboard";
136-
LogException(message, e);
137-
Context.API.ShowMsg(message);
135+
LogException("Fail to set text in clipboard", e);
136+
Context.API.ShowMsgError(Context.API.GetTranslation("plugin_explorer_fail_to_set_text"));
138137
return false;
139138
}
140139
},
@@ -155,9 +154,8 @@ public List<Result> LoadContextMenus(Result selectedResult)
155154
}
156155
catch (Exception e)
157156
{
158-
var message = "Fail to set text in clipboard";
159-
LogException(message, e);
160-
Context.API.ShowMsg(message);
157+
LogException("Fail to set text in clipboard", e);
158+
Context.API.ShowMsgError(Context.API.GetTranslation("plugin_explorer_fail_to_set_text"));
161159
return false;
162160
}
163161
},
@@ -178,9 +176,8 @@ public List<Result> LoadContextMenus(Result selectedResult)
178176
}
179177
catch (Exception e)
180178
{
181-
var message = $"Fail to set file/folder in clipboard";
182-
LogException(message, e);
183-
Context.API.ShowMsg(message);
179+
LogException($"Fail to set file/folder in clipboard", e);
180+
Context.API.ShowMsgError(Context.API.GetTranslation("plugin_explorer_fail_to_set_files"));
184181
return false;
185182
}
186183

Plugins/Flow.Launcher.Plugin.Explorer/Languages/en.xaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,8 @@
135135
<system:String x:Key="plugin_explorer_fail_to_delete">Fail to delete {0}</system:String>
136136
<system:String x:Key="plugin_explorer_file_not_found">File not found: {0}</system:String>
137137
<system:String x:Key="plugin_explorer_fail_to_open">Fail to open {0}</system:String>
138+
<system:String x:Key="plugin_explorer_fail_to_set_text">Fail to set text in clipboard</system:String>
139+
<system:String x:Key="plugin_explorer_fail_to_set_files">Fail to set files/folders in clipboard</system:String>
138140

139141
<!-- Special Results -->
140142
<system:String x:Key="plugin_explorer_diskfreespace">{0} free of {1}</system:String>

0 commit comments

Comments
 (0)