Skip to content

Commit 06b3219

Browse files
committed
Add translations
1 parent 85ffd60 commit 06b3219

File tree

3 files changed

+23
-16
lines changed

3 files changed

+23
-16
lines changed

Flow.Launcher.Core/Configuration/Portable.cs

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,7 @@ public void DisablePortableMode()
4545
#endif
4646
IndicateDeletion(DataLocation.PortableDataPath);
4747

48-
API.ShowMsgBox("Flow Launcher needs to restart to finish disabling portable mode, " +
49-
"after the restart your portable data profile will be deleted and roaming data profile kept");
48+
API.ShowMsgBox(API.GetTranslation("restartToDisablePortableMode"));
5049

5150
UpdateManager.RestartApp(Constant.ApplicationFileName);
5251
}
@@ -69,8 +68,7 @@ public void EnablePortableMode()
6968
#endif
7069
IndicateDeletion(DataLocation.RoamingDataPath);
7170

72-
API.ShowMsgBox("Flow Launcher needs to restart to finish enabling portable mode, " +
73-
"after the restart your roaming data profile will be deleted and portable data profile kept");
71+
API.ShowMsgBox(API.GetTranslation("restartToEnablePortableMode"));
7472

7573
UpdateManager.RestartApp(Constant.ApplicationFileName);
7674
}
@@ -154,9 +152,8 @@ public void PreStartCleanUpAfterPortabilityUpdate()
154152
{
155153
FilesFolders.RemoveFolderIfExists(roamingDataDir, (s) => API.ShowMsgBox(s));
156154

157-
if (API.ShowMsgBox("Flow Launcher has detected you enabled portable mode, " +
158-
"would you like to move it to a different location?", string.Empty,
159-
MessageBoxButton.YesNo) == MessageBoxResult.Yes)
155+
if (API.ShowMsgBox(API.GetTranslation("moveToDifferentLocation"),
156+
string.Empty, MessageBoxButton.YesNo) == MessageBoxResult.Yes)
160157
{
161158
FilesFolders.OpenPath(Constant.RootDirectory, (s) => API.ShowMsgBox(s));
162159

@@ -169,8 +166,7 @@ public void PreStartCleanUpAfterPortabilityUpdate()
169166
{
170167
FilesFolders.RemoveFolderIfExists(portableDataDir, (s) => API.ShowMsgBox(s));
171168

172-
API.ShowMsgBox("Flow Launcher has detected you disabled portable mode, " +
173-
"the relevant shortcuts and uninstaller entry have been created");
169+
API.ShowMsgBox(API.GetTranslation("shortcutsUninstallerCreated"));
174170
}
175171
}
176172

@@ -181,9 +177,8 @@ public bool CanUpdatePortability()
181177

182178
if (roamingLocationExists && portableLocationExists)
183179
{
184-
API.ShowMsgBox(string.Format("Flow Launcher detected your user data exists both in {0} and " +
185-
"{1}. {2}{2}Please delete {1} in order to proceed. No changes have occurred.",
186-
DataLocation.PortableDataPath, DataLocation.RoamingDataPath, Environment.NewLine));
180+
API.ShowMsgBox(string.Format(API.GetTranslation("userDataDuplicated"),
181+
DataLocation.PortableDataPath, DataLocation.RoamingDataPath, Environment.NewLine));
187182

188183
return false;
189184
}

Flow.Launcher.Core/Plugin/PluginsLoader.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -120,15 +120,15 @@ private static IEnumerable<PluginPair> DotNetPlugins(List<PluginMetadata> source
120120
{
121121
var errorPluginString = string.Join(Environment.NewLine, erroredPlugins);
122122

123-
var errorMessage = "The following "
124-
+ (erroredPlugins.Count > 1 ? "plugins have " : "plugin has ")
125-
+ "errored and cannot be loaded:";
123+
var errorMessage = erroredPlugins.Count > 1 ?
124+
API.GetTranslation("pluginsHaveErrored") :
125+
API.GetTranslation("pluginHasErrored");
126126

127127
_ = Task.Run(() =>
128128
{
129129
API.ShowMsgBox($"{errorMessage}{Environment.NewLine}{Environment.NewLine}" +
130130
$"{errorPluginString}{Environment.NewLine}{Environment.NewLine}" +
131-
$"Please refer to the logs for more information", "",
131+
API.GetTranslation("referToLogs"), string.Empty,
132132
MessageBoxButton.OK, MessageBoxImage.Warning);
133133
});
134134
}

Flow.Launcher/Languages/en.xaml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,18 @@
1818
<system:String x:Key="failedToInitializePluginsTitle">Fail to Init Plugins</system:String>
1919
<system:String x:Key="failedToInitializePluginsMessage">Plugins: {0} - fail to load and would be disabled, please contact plugin creator for help</system:String>
2020

21+
<!-- Portable -->
22+
<system:String x:Key="restartToDisablePortableMode">Flow Launcher needs to restart to finish disabling portable mode, after the restart your portable data profile will be deleted and roaming data profile kept</system:String>
23+
<system:String x:Key="restartToEnablePortableMode">Flow Launcher needs to restart to finish enabling portable mode, after the restart your roaming data profile will be deleted and portable data profile kept</system:String>
24+
<system:String x:Key="moveToDifferentLocation">Flow Launcher has detected you enabled portable mode, would you like to move it to a different location?</system:String>
25+
<system:String x:Key="shortcutsUninstallerCreated">Flow Launcher has detected you disabled portable mode, the relevant shortcuts and uninstaller entry have been created</system:String>
26+
<system:String x:Key="userDataDuplicated">Flow Launcher detected your user data exists both in {0} and {1}. {2}{2}Please delete {1} in order to proceed. No changes have occurred.</system:String>
27+
28+
<!-- Plugin Loader -->
29+
<system:String x:Key="pluginHasErrored">The following plugin has errored and cannot be loaded:</system:String>
30+
<system:String x:Key="pluginsHaveErrored">The following plugins have errored and cannot be loaded:</system:String>
31+
<system:String x:Key="referToLogs">Please refer to the logs for more information</system:String>
32+
2133
<!-- MainWindow -->
2234
<system:String x:Key="registerHotkeyFailed">Failed to register hotkey "{0}". The hotkey may be in use by another program. Change to a different hotkey, or exit another program.</system:String>
2335
<system:String x:Key="unregisterHotkeyFailed">Failed to unregister hotkey "{0}". Please try again or see log for details</system:String>

0 commit comments

Comments
 (0)