Skip to content

Commit

Permalink
完成自定义刷入页面翻译
Browse files Browse the repository at this point in the history
  • Loading branch information
mujianwu committed Jul 22, 2024
1 parent ad7c61b commit 158f310
Show file tree
Hide file tree
Showing 4 changed files with 70 additions and 40 deletions.
18 changes: 18 additions & 0 deletions UotanToolbox/Assets/Resources.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions UotanToolbox/Assets/Resources.resx
Original file line number Diff line number Diff line change
Expand Up @@ -1146,6 +1146,12 @@
<data name="Common_EnterSideload" xml:space="preserve">
<value>Please enter Sideload mode!</value>
</data>
<data name="Customizedflash_Flashing" xml:space="preserve">
<value>Flashing...</value>
</data>
<data name="Customizedflash_SelectFile" xml:space="preserve">
<value>Please select a file!</value>
</data>
<data name="Wiredflash_FaildRestart" xml:space="preserve">
<value>Failed to restart to Fastboot mode! Unable to continue flashing!</value>
</data>
Expand Down
6 changes: 6 additions & 0 deletions UotanToolbox/Assets/Resources.zh-CN.resx
Original file line number Diff line number Diff line change
Expand Up @@ -1143,6 +1143,12 @@
<data name="Common_EnterSideload" xml:space="preserve">
<value>请进入Sideload模式!</value>
</data>
<data name="Customizedflash_Flashing" xml:space="preserve">
<value>正在刷入...</value>
</data>
<data name="Customizedflash_SelectFile" xml:space="preserve">
<value>请选择文件!</value>
</data>
<data name="Wiredflash_FaildRestart" xml:space="preserve">
<value>未能重启到Fastbootd模式!无法继续刷入!</value>
</data>
Expand Down
80 changes: 40 additions & 40 deletions UotanToolbox/Features/Customizedflash/CustomizedflashView.axaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -83,25 +83,25 @@ private async void FlashSystemFile(object sender, RoutedEventArgs args)
{
OpenSystemFileBut.IsEnabled = false;
FlashSystemFileBut.IsEnabled = false;
CustomizedflashLog.Text = "正在刷入...\n";
CustomizedflashLog.Text = GetTranslation("Customizedflash_Flashing") + "\n";
string shell = String.Format($"-s {Global.thisdevice} flash system \"{SystemFile.Text}\"");
await Fastboot(shell);
OpenSystemFileBut.IsEnabled = true;
FlashSystemFileBut.IsEnabled = true;
}
else
{
SukiHost.ShowDialog(new PureDialog("请将设备进入Fastboot模式后执行!"), allowBackgroundClose: true);
SukiHost.ShowDialog(new PureDialog(GetTranslation("Common_EnterFastboot")), allowBackgroundClose: true);
}
}
else
{
SukiHost.ShowDialog(new PureDialog("请选择文件!"), allowBackgroundClose: true);
SukiHost.ShowDialog(new PureDialog(GetTranslation("Customizedflash_SelectFile")), allowBackgroundClose: true);
}
}
else
{
SukiHost.ShowDialog(new PureDialog("设备未连接!"), allowBackgroundClose: true);
SukiHost.ShowDialog(new PureDialog(GetTranslation("Common_NotConnected")), allowBackgroundClose: true);
}
}

Expand Down Expand Up @@ -129,25 +129,25 @@ private async void FlashProductFile(object sender, RoutedEventArgs args)
{
OpenProductFileBut.IsEnabled = false;
FlashProductFileBut.IsEnabled = false;
CustomizedflashLog.Text = "正在刷入...\n";
CustomizedflashLog.Text = GetTranslation("Customizedflash_Flashing") + "\n";
string shell = String.Format($"-s {Global.thisdevice} flash product \"{ProductFile.Text}\"");
await Fastboot(shell);
OpenProductFileBut.IsEnabled = true;
FlashProductFileBut.IsEnabled = true;
}
else
{
SukiHost.ShowDialog(new PureDialog("请将设备进入Fastboot模式后执行!"), allowBackgroundClose: true);
SukiHost.ShowDialog(new PureDialog(GetTranslation("Common_EnterFastboot")), allowBackgroundClose: true);
}
}
else
{
SukiHost.ShowDialog(new PureDialog("请选择文件!"), allowBackgroundClose: true);
SukiHost.ShowDialog(new PureDialog(GetTranslation("Customizedflash_SelectFile")), allowBackgroundClose: true);
}
}
else
{
SukiHost.ShowDialog(new PureDialog("设备未连接!"), allowBackgroundClose: true);
SukiHost.ShowDialog(new PureDialog(GetTranslation("Common_NotConnected")), allowBackgroundClose: true);
}
}
private async void OpenVenderFile(object sender, RoutedEventArgs args)
Expand All @@ -174,25 +174,25 @@ private async void FlashVenderFile(object sender, RoutedEventArgs args)
{
OpenVenderFileBut.IsEnabled = false;
FlashVenderFileBut.IsEnabled = false;
CustomizedflashLog.Text = "正在刷入...\n";
CustomizedflashLog.Text = GetTranslation("Customizedflash_Flashing") + "\n";
string shell = String.Format($"-s {Global.thisdevice} flash vendor \"{VenderFile.Text}\"");
await Fastboot(shell);
OpenVenderFileBut.IsEnabled = true;
FlashVenderFileBut.IsEnabled = true;
}
else
{
SukiHost.ShowDialog(new PureDialog("请将设备进入Fastboot模式后执行!"), allowBackgroundClose: true);
SukiHost.ShowDialog(new PureDialog(GetTranslation("Common_EnterFastboot")), allowBackgroundClose: true);
}
}
else
{
SukiHost.ShowDialog(new PureDialog("请选择文件!"), allowBackgroundClose: true);
SukiHost.ShowDialog(new PureDialog(GetTranslation("Customizedflash_SelectFile")), allowBackgroundClose: true);
}
}
else
{
SukiHost.ShowDialog(new PureDialog("设备未连接!"), allowBackgroundClose: true);
SukiHost.ShowDialog(new PureDialog(GetTranslation("Common_NotConnected")), allowBackgroundClose: true);
}
}
private async void OpenBootFile(object sender, RoutedEventArgs args)
Expand All @@ -219,25 +219,25 @@ private async void FlashBootFile(object sender, RoutedEventArgs args)
{
OpenBootFileBut.IsEnabled = false;
FlashBootFileBut.IsEnabled = false;
CustomizedflashLog.Text = "正在刷入...\n";
CustomizedflashLog.Text = GetTranslation("Customizedflash_Flashing") + "\n";
string shell = String.Format($"-s {Global.thisdevice} flash boot \"{BootFile.Text}\"");
await Fastboot(shell);
OpenBootFileBut.IsEnabled = true;
FlashBootFileBut.IsEnabled = true;
}
else
{
SukiHost.ShowDialog(new PureDialog("请将设备进入Fastboot模式后执行!"), allowBackgroundClose: true);
SukiHost.ShowDialog(new PureDialog(GetTranslation("Common_EnterFastboot")), allowBackgroundClose: true);
}
}
else
{
SukiHost.ShowDialog(new PureDialog("请选择文件!"), allowBackgroundClose: true);
SukiHost.ShowDialog(new PureDialog(GetTranslation("Customizedflash_SelectFile")), allowBackgroundClose: true);
}
}
else
{
SukiHost.ShowDialog(new PureDialog("设备未连接!"), allowBackgroundClose: true);
SukiHost.ShowDialog(new PureDialog(GetTranslation("Common_NotConnected")), allowBackgroundClose: true);
}
}
private async void OpenSystemextFile(object sender, RoutedEventArgs args)
Expand All @@ -264,25 +264,25 @@ private async void FlashSystemextFile(object sender, RoutedEventArgs args)
{
OpenSystemextFileBut.IsEnabled = false;
FlashSystemextFileBut.IsEnabled = false;
CustomizedflashLog.Text = "正在刷入...\n";
CustomizedflashLog.Text = GetTranslation("Customizedflash_Flashing") + "\n";
string shell = String.Format($"-s {Global.thisdevice} flash system_ext \"{SystemextFile.Text}\"");
await Fastboot(shell);
OpenSystemextFileBut.IsEnabled = true;
FlashSystemextFileBut.IsEnabled = true;
}
else
{
SukiHost.ShowDialog(new PureDialog("请将设备进入Fastboot模式后执行!"), allowBackgroundClose: true);
SukiHost.ShowDialog(new PureDialog(GetTranslation("Common_EnterFastboot")), allowBackgroundClose: true);
}
}
else
{
SukiHost.ShowDialog(new PureDialog("请选择文件!"), allowBackgroundClose: true);
SukiHost.ShowDialog(new PureDialog(GetTranslation("Customizedflash_SelectFile")), allowBackgroundClose: true);
}
}
else
{
SukiHost.ShowDialog(new PureDialog("设备未连接!"), allowBackgroundClose: true);
SukiHost.ShowDialog(new PureDialog(GetTranslation("Common_NotConnected")), allowBackgroundClose: true);
}
}
private async void OpenOdmFile(object sender, RoutedEventArgs args)
Expand All @@ -309,25 +309,25 @@ private async void FlashOdmFile(object sender, RoutedEventArgs args)
{
OpenOdmFileBut.IsEnabled = false;
FlashOdmFileBut.IsEnabled = false;
CustomizedflashLog.Text = "正在刷入...\n";
CustomizedflashLog.Text = GetTranslation("Customizedflash_Flashing") + "\n";
string shell = String.Format($"-s {Global.thisdevice} flash odm \"{OdmFile.Text}\"");
await Fastboot(shell);
OpenOdmFileBut.IsEnabled = true;
FlashOdmFileBut.IsEnabled = true;
}
else
{
SukiHost.ShowDialog(new PureDialog("请将设备进入Fastboot模式后执行!"), allowBackgroundClose: true);
SukiHost.ShowDialog(new PureDialog(GetTranslation("Common_EnterFastboot")), allowBackgroundClose: true);
}
}
else
{
SukiHost.ShowDialog(new PureDialog("请选择文件!"), allowBackgroundClose: true);
SukiHost.ShowDialog(new PureDialog(GetTranslation("Customizedflash_SelectFile")), allowBackgroundClose: true);
}
}
else
{
SukiHost.ShowDialog(new PureDialog("设备未连接!"), allowBackgroundClose: true);
SukiHost.ShowDialog(new PureDialog(GetTranslation("Common_NotConnected")), allowBackgroundClose: true);
}
}
private async void OpenVenderbootFile(object sender, RoutedEventArgs args)
Expand All @@ -354,25 +354,25 @@ private async void FlashVenderbootFile(object sender, RoutedEventArgs args)
{
OpenVenderbootFileBut.IsEnabled = false;
FlashVenderbootFileBut.IsEnabled = false;
CustomizedflashLog.Text = "正在刷入...\n";
CustomizedflashLog.Text = GetTranslation("Customizedflash_Flashing") + "\n";
string shell = String.Format($"-s {Global.thisdevice} flash vendor_boot \"{VenderbootFile.Text}\"");
await Fastboot(shell);
OpenVenderbootFileBut.IsEnabled = true;
FlashVenderbootFileBut.IsEnabled = true;
}
else
{
SukiHost.ShowDialog(new PureDialog("请将设备进入Fastboot模式后执行!"), allowBackgroundClose: true);
SukiHost.ShowDialog(new PureDialog(GetTranslation("Common_EnterFastboot")), allowBackgroundClose: true);
}
}
else
{
SukiHost.ShowDialog(new PureDialog("请选择文件!"), allowBackgroundClose: true);
SukiHost.ShowDialog(new PureDialog(GetTranslation("Customizedflash_SelectFile")), allowBackgroundClose: true);
}
}
else
{
SukiHost.ShowDialog(new PureDialog("设备未连接!"), allowBackgroundClose: true);
SukiHost.ShowDialog(new PureDialog(GetTranslation("Common_NotConnected")), allowBackgroundClose: true);
}
}
private async void OpenInitbootFile(object sender, RoutedEventArgs args)
Expand All @@ -399,25 +399,25 @@ private async void FlashInitbootFile(object sender, RoutedEventArgs args)
{
OpenInitbootFileBut.IsEnabled = false;
FlashInitbootFileBut.IsEnabled = false;
CustomizedflashLog.Text = "正在刷入...\n";
CustomizedflashLog.Text = GetTranslation("Customizedflash_Flashing") + "\n";
string shell = String.Format($"-s {Global.thisdevice} flash init_boot \"{InitbootFile.Text}\"");
await Fastboot(shell);
OpenInitbootFileBut.IsEnabled = true;
FlashInitbootFileBut.IsEnabled = true;
}
else
{
SukiHost.ShowDialog(new PureDialog("请将设备进入Fastboot模式后执行!"), allowBackgroundClose: true);
SukiHost.ShowDialog(new PureDialog(GetTranslation("Common_EnterFastboot")), allowBackgroundClose: true);
}
}
else
{
SukiHost.ShowDialog(new PureDialog("请选择文件!"), allowBackgroundClose: true);
SukiHost.ShowDialog(new PureDialog(GetTranslation("Customizedflash_SelectFile")), allowBackgroundClose: true);
}
}
else
{
SukiHost.ShowDialog(new PureDialog("设备未连接!"), allowBackgroundClose: true);
SukiHost.ShowDialog(new PureDialog(GetTranslation("Common_NotConnected")), allowBackgroundClose: true);
}
}
private async void OpenImageFile(object sender, RoutedEventArgs args)
Expand All @@ -444,25 +444,25 @@ private async void FlashImageFile(object sender, RoutedEventArgs args)
{
OpenImageFileBut.IsEnabled = false;
FlashImageFileBut.IsEnabled = false;
CustomizedflashLog.Text = "正在刷入...\n";
CustomizedflashLog.Text = GetTranslation("Customizedflash_Flashing") + "\n";
string shell = String.Format($"-s {Global.thisdevice} flash {Part.Text} \"{ImageFile.Text}\"");
await Fastboot(shell);
OpenImageFileBut.IsEnabled = true;
FlashImageFileBut.IsEnabled = true;
}
else
{
SukiHost.ShowDialog(new PureDialog("请将设备进入Fastboot模式后执行!"), allowBackgroundClose: true);
SukiHost.ShowDialog(new PureDialog(GetTranslation("Common_EnterFastboot")), allowBackgroundClose: true);
}
}
else
{
SukiHost.ShowDialog(new PureDialog("请选择文件!"), allowBackgroundClose: true);
SukiHost.ShowDialog(new PureDialog(GetTranslation("Customizedflash_SelectFile")), allowBackgroundClose: true);
}
}
else
{
SukiHost.ShowDialog(new PureDialog("设备未连接!"), allowBackgroundClose: true);
SukiHost.ShowDialog(new PureDialog(GetTranslation("Common_NotConnected")), allowBackgroundClose: true);
}
}
private async void DisableVbmeta(object sender, RoutedEventArgs args)
Expand All @@ -478,12 +478,12 @@ private async void DisableVbmeta(object sender, RoutedEventArgs args)
}
else
{
SukiHost.ShowDialog(new PureDialog("请将设备进入Fastboot模式后执行!"), allowBackgroundClose: true);
SukiHost.ShowDialog(new PureDialog(GetTranslation("Common_EnterFastboot")), allowBackgroundClose: true);
}
}
else
{
SukiHost.ShowDialog(new PureDialog("设备未连接!"), allowBackgroundClose: true);
SukiHost.ShowDialog(new PureDialog(GetTranslation("Common_NotConnected")), allowBackgroundClose: true);
}
}
private async void SetOther(object sender, RoutedEventArgs args)
Expand All @@ -499,12 +499,12 @@ private async void SetOther(object sender, RoutedEventArgs args)
}
else
{
SukiHost.ShowDialog(new PureDialog("请将设备进入Fastboot模式后执行!"), allowBackgroundClose: true);
SukiHost.ShowDialog(new PureDialog(GetTranslation("Common_EnterFastboot")), allowBackgroundClose: true);
}
}
else
{
SukiHost.ShowDialog(new PureDialog("设备未连接!"), allowBackgroundClose: true);
SukiHost.ShowDialog(new PureDialog(GetTranslation("Common_NotConnected")), allowBackgroundClose: true);
}
}
}

0 comments on commit 158f310

Please sign in to comment.