Skip to content

Commit

Permalink
Feature: Add Russian translation to Rebound Run (#111)
Browse files Browse the repository at this point in the history
Co-authored-by: Lamparter <[email protected]>
  • Loading branch information
ke46138 and Lamparter authored Nov 29, 2024
1 parent 93b084b commit 2d14f04
Show file tree
Hide file tree
Showing 7 changed files with 126 additions and 49 deletions.
2 changes: 1 addition & 1 deletion Helpers/Display.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using WinUIEx;
using WinUIEx;

namespace Rebound.Helpers;

Expand Down
2 changes: 1 addition & 1 deletion Helpers/SettingsHelper.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace Rebound.Helpers;
namespace Rebound.Helpers;

public static class SettingsHelper
{
Expand Down
2 changes: 1 addition & 1 deletion Helpers/TitleBarService.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using System;
using System;
using System.Threading.Tasks;
using Microsoft.UI;
using Microsoft.UI.Windowing;
Expand Down
2 changes: 1 addition & 1 deletion Rebound/Package.appxmanifest
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8"?>

<Package
xmlns="http://schemas.microsoft.com/appx/manifest/foundation/windows10"
Expand Down
126 changes: 101 additions & 25 deletions Run/Languages/StringTable.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,20 @@ public class StringTable
public static string Arguments;
public static string Cancel;
public static string Browse;
public static string Hover;
public static string RunAsAdminLegacy;
public static string RunLegacy;
public static string RunAsAdminLegacyTooltip;
public static string RunAsAdminTooltip;
public static string RunLegacyTooltip;
public static string RunTooltip;
public static string SelectFileToRun;
public static string ErrorMessage;
public static string Error;
public static string Warning;
public static string WarningMessage;
public static string ErrorMessage2;
public static string Win3UIBoxAlreadyOpened;

public StringTable()
{
Expand All @@ -22,32 +36,94 @@ public static void ReadLanguage()
{
// Get the current culture (language) of the system
var currentCulture = CultureInfo.CurrentUICulture;
if (currentCulture.Name.ToLower() == "en-us")
switch (currentCulture.Name.ToLower())
{
AppTitle = "Rebound Run";
Run = "Run";
RunAsAdmin = "Run as Administrator";
Description = "Type the name of a program, folder, document, or Internet resource, and Windows will open it for you.";
Open = "Open";
Arguments = "Arguments";
Cancel = "Cancel";
Browse = "Browse";
}
if (currentCulture.Name.ToLower() == "ro-ro")
{
AppTitle = "Executare Rebound";
Run = "Execută";
}
if (currentCulture.Name.ToLower() == "de-de")
{
AppTitle = "Rebound Ausführen";
Run = "Ausführen";
RunAsAdmin = "Als Administrator ausführen";
Description = "Geben Sie den Namen eines Programms, Ordners, Dokuments oder einer Internetressource an.";
Open = "Öffnen";
Arguments = "Argumente";
Cancel = "Abbrechen";
Browse = "Druchsuchen";
case "en-us":
AppTitle = "Rebound Run";
Run = "Run";
RunAsAdmin = "Run as Administrator";
Description = "Type the name of a program, folder, document, or Internet resource, and Windows will open it for you.";
Open = "Open";
Arguments = "Arguments";
Cancel = "Cancel";
Browse = "Browse";
Hover = "Hover for information";
RunAsAdminLegacy = "Run as Administrator (legacy)";
RunLegacy = "Run legacy";
RunAsAdminLegacyTooltip = "Rebound 11 replaces run entries of classic Windows applets with Rebound apps. To launch the legacy applets as administrator, use this option instead. (Also launches Task Manager without WinUI 3.)";
RunAsAdminTooltip = "Run the selected process as administrator. This option will attempt to launch the corresponding Rebound 11 counterpart of the chosen task.";
RunLegacyTooltip = "Rebound 11 replaces run entries of classic Windows applets with Rebound apps. To launch the legacy applets, use this option instead. (Also launches Task Manager without WinUI 3.)";
RunTooltip = "This option will attempt to launch the corresponding Rebound 11 counterpart of the chosen task.";
SelectFileToRun = "Select file to run";
ErrorMessage = "The system cannot find the file specified or the command line arguments are invalid.";
Error = "Error";
Warning = "Important";
WarningMessage = "You will have to open this app again to bring back the Windows + R invoke command for Rebound Run.";
ErrorMessage2 = "The system cannot find the file specified.";
Win3UIBoxAlreadyOpened = "The WinUI 3 run box is already opened.";
break;
case "ro-ro":
AppTitle = "Executare Rebound";
Run = "Execută";
break;
case "de-de":
AppTitle = "Rebound Ausführen";
Run = "Ausführen";
RunAsAdmin = "Als Administrator ausführen";
Description = "Geben Sie den Namen eines Programms, Ordners, Dokuments oder einer Internetressource an.";
Open = "Öffnen";
Arguments = "Argumente";
Cancel = "Abbrechen";
Browse = "Druchsuchen";
break;
case "ru-ru":
AppTitle = "Rebound Выполнить";
Run = "Запустить";
RunAsAdmin = "Запуск от Администрартора";
Description = "Ведите имя программы, папки, документа или ресурса Интернета, которые требуется открыть.";
Open = "Открыть";
Arguments = "Аргументы";
Cancel = "Отмена";
Browse = "Обзор...";
Hover = "Наведите курсор на элемент для информации";
RunAsAdminLegacy = "Запуск от Администрартора (устаревший)";
RunLegacy = "Запустить устаревшую версию";
RunAsAdminLegacyTooltip = "Rebound 11 заменяет классические приложения Windows на Rebound. Чтобы запустить устаревшие приложения от имени администратора, используйте эту опцию. (Также запускает диспетчер задач из Windows 10).";
RunAsAdminTooltip = "Запускает приложение от имени Администратора. При использовании этой опции будут использоваться приложения от Rebound.";
RunLegacyTooltip = "Rebound 11 заменяет классические приложения Windows на Rebound. Чтобы запустить устаревшие приложения, используйте эту опцию. (Также запускает диспетчер задач из Windows 10).";
RunTooltip = "При использовании этой опции будут использоваться приложения от Rebound.";
SelectFileToRun = "Выберите файл для запуска";
ErrorMessage = "Не удаётся найти указанный файл. Проверьте, правильно ли указано имя и повторите попытку.";
Error = "Ошибка";
Warning = "Внимание";
WarningMessage = "Вам нужно будет снова открыть это приложение, чтобы вернуть команду Windows + R Выполнить для Rebound Выполнить.";
ErrorMessage2 = "Не удаётся найти указанный файл.";
Win3UIBoxAlreadyOpened = "Окно выполнить WinUI 3 уже открыто.";
break;
default:
AppTitle = "Rebound Run";
Run = "Run";
RunAsAdmin = "Run as Administrator";
Description = "Type the name of a program, folder, document, or Internet resource, and Windows will open it for you.";
Open = "Open";
Arguments = "Arguments";
Cancel = "Cancel";
Browse = "Browse";
Hover = "Hover for information";
RunAsAdminLegacy = "Run as Administrator (legacy)";
RunLegacy = "Run legacy";
RunAsAdminLegacyTooltip = "Rebound 11 replaces run entries of classic Windows applets with Rebound apps. To launch the legacy applets as administrator, use this option instead. (Also launches Task Manager without WinUI 3.)";
RunAsAdminTooltip = "Run the selected process as administrator. This option will attempt to launch the corresponding Rebound 11 counterpart of the chosen task.";
RunLegacyTooltip = "Rebound 11 replaces run entries of classic Windows applets with Rebound apps. To launch the legacy applets, use this option instead. (Also launches Task Manager without WinUI 3.)";
RunTooltip = "This option will attempt to launch the corresponding Rebound 11 counterpart of the chosen task.";
SelectFileToRun = "Select file to run";
ErrorMessage = "The system cannot find the file specified or the command line arguments are invalid.";
Error = "Error";
Warning = "Important";
WarningMessage = "You will have to open this app again to bring back the Windows + R invoke command for Rebound Run.";
ErrorMessage2 = "The system cannot find the file specified.";
Win3UIBoxAlreadyOpened = "The WinUI 3 run box is already opened.";
break;
}
}
}
31 changes: 16 additions & 15 deletions Run/MainWindow.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
xmlns:local="using:Rebound.Run"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:winuiex="using:WinUIEx"
xmlns:languages="using:Rebound.Run.Languages"
Activated="WindowEx_Activated"
mc:Ignorable="d">

Expand Down Expand Up @@ -371,7 +372,7 @@
</Grid.Resources>
<TextBlock
Margin="125,25,25,25"
Text="Type the name of a program, folder, document, or Internet resource, and Windows will open it for you."
Text="{x:Bind StringTable:StringTable.Description}"
TextWrapping="WrapWholeWords" />
<ComboBox
x:Name="RunBox"
Expand All @@ -395,11 +396,11 @@
<TextBlock
Margin="30,90,0,0"
HorizontalAlignment="Left"
Text="Open:" />
Text="{x:Bind StringTable:StringTable.Open}" />
<TextBlock
Margin="30,135,0,0"
HorizontalAlignment="Left"
Text="Arguments:" />
Text="{x:Bind StringTable:StringTable.Arguments}" />
<Border
Grid.ColumnSpan="2"
Height="75"
Expand All @@ -421,20 +422,20 @@
HorizontalAlignment="Stretch"
VerticalAlignment="Bottom"
Click="SplitButton_Click"
Content="{x:Bind Path=StringTable:StringTable.Run}"
Content="{x:Bind StringTable:StringTable.Run}"
Style="{StaticResource AccentSplitButtonStyle}">
<SplitButton.Flyout>
<MenuFlyout>
<MenuFlyoutItem IsEnabled="False" Text="Hover for information">
<MenuFlyoutItem IsEnabled="False" Text="{x:Bind StringTable:StringTable.Hover}">
<MenuFlyoutItem.Icon>
<FontIcon Glyph="" />
</MenuFlyoutItem.Icon>
</MenuFlyoutItem>
<MenuFlyoutSeparator />
<MenuFlyoutItem
Click="MenuFlyoutItem_Click_2"
Text="Run as Administrator"
ToolTipService.ToolTip="Run the selected process as administrator. This option will attempt to launch the corresponding Rebound 11 counterpart of the chosen task.">
Text="{x:Bind StringTable:StringTable.RunAsAdmin}"
ToolTipService.ToolTip="{x:Bind StringTable:StringTable.RunAsAdminTooltip}">
<MenuFlyoutItem.Icon>
<ImageIcon Source="/Assets/Administrator.ico" />
</MenuFlyoutItem.Icon>
Expand All @@ -447,8 +448,8 @@
</MenuFlyoutItem>
<MenuFlyoutItem
Click="MenuFlyoutItem_Click_3"
Text="Run as Administrator (Legacy)"
ToolTipService.ToolTip="Rebound 11 replaces run entries of classic Windows applets with Rebound apps. To launch the legacy applets as administrator, use this option instead. (Also launches Task Manager without WinUI 3.)">
Text="{x:Bind StringTable:StringTable.RunAsAdminLegacy}"
ToolTipService.ToolTip="{x:Bind StringTable:StringTable.RunAsAdminLegacyTooltip}">
<MenuFlyoutItem.Icon>
<ImageIcon Source="/Assets/Administrator.ico" />
</MenuFlyoutItem.Icon>
Expand All @@ -458,8 +459,8 @@
</MenuFlyoutItem>
<MenuFlyoutItem
Click="MenuFlyoutItem_Click_1"
Text="Run"
ToolTipService.ToolTip="This option will attempt to launch the corresponding Rebound 11 counterpart of the chosen task.">
Text="{x:Bind StringTable:StringTable.Run}"
ToolTipService.ToolTip="{x:Bind StringTable:StringTable.RunTooltip}">
<MenuFlyoutItem.Icon>
<FontIcon Glyph="" />
</MenuFlyoutItem.Icon>
Expand All @@ -469,8 +470,8 @@
</MenuFlyoutItem>
<MenuFlyoutItem
Click="MenuFlyoutItem_Click"
Text="Run Legacy"
ToolTipService.ToolTip="Rebound 11 replaces run entries of classic Windows applets with Rebound apps. To launch the legacy applets, use this option instead. (Also launches Task Manager without WinUI 3.)">
Text="{x:Bind StringTable:StringTable.RunLegacy}"
ToolTipService.ToolTip="{x:Bind StringTable:StringTable.RunLegacyTooltip}">
<MenuFlyoutItem.Icon>
<FontIcon Glyph="" />
</MenuFlyoutItem.Icon>
Expand All @@ -487,7 +488,7 @@
HorizontalAlignment="Stretch"
VerticalAlignment="Bottom"
Click="Button_Click"
Content="Cancel">
Content="{x:Bind StringTable:StringTable.Cancel}">
<Button.KeyboardAccelerators>
<KeyboardAccelerator Key="Escape" />
</Button.KeyboardAccelerators>
Expand All @@ -498,7 +499,7 @@
HorizontalAlignment="Stretch"
VerticalAlignment="Bottom"
Click="Button_Click_1"
Content="Browse" />
Content="{x:Bind StringTable:StringTable.Browse}" />
</Grid>
</Grid>
</winuiex:WindowEx>
10 changes: 5 additions & 5 deletions Run/MainWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,7 @@ public async Task Run(bool runLegacy = false, bool admin = false)
}
catch (Exception)
{
await ShowMessageDialogAsync($"The system cannot find the file specified.");
await ShowMessageDialogAsync(StringTable.ErrorMessage2);
}
}
else
Expand Down Expand Up @@ -296,19 +296,19 @@ public async Task Run(bool runLegacy = false, bool admin = false)

try
{
await ShowMessageDialogAsync($"You will have to open this app again to bring back the Windows + R invoke command for Rebound Run.", "Important");
await ShowMessageDialogAsync(StringTable.WarningMessage, StringTable.Warning);
var res = Process.Start(startInfo);
Close();
Process.GetCurrentProcess().Kill();
}
catch (Exception)
{
await ShowMessageDialogAsync($"The system cannot find the file specified.");
await ShowMessageDialogAsync(StringTable.ErrorMessage2);
}
}
else
{
await ShowMessageDialogAsync($"The WinUI 3 run box is already opened.", "Error");
await ShowMessageDialogAsync(StringTable.Win3UIBoxAlreadyOpened, StringTable.Error);
return;
}
Close();
Expand Down Expand Up @@ -515,7 +515,7 @@ private async void Button_Click_1(object sender, RoutedEventArgs e)
// Set options for your file picker
openPicker.ViewMode = PickerViewMode.Thumbnail;
openPicker.SuggestedStartLocation = PickerLocationId.Desktop;
openPicker.CommitButtonText = "Select file to run";
openPicker.CommitButtonText = StringTable.SelectFileToRun;
openPicker.FileTypeFilter.Add(".exe");
openPicker.FileTypeFilter.Add(".pif");
openPicker.FileTypeFilter.Add(".com");
Expand Down

0 comments on commit 2d14f04

Please sign in to comment.