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 7339bef commit 57a934b
Show file tree
Hide file tree
Showing 4 changed files with 48 additions and 13 deletions.
11 changes: 10 additions & 1 deletion UotanToolbox/Assets/Resources.Designer.cs

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

5 changes: 4 additions & 1 deletion UotanToolbox/Assets/Resources.resx
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,7 @@
<data name="Home_Disconnected" xml:space="preserve">
<value>The device has been disconnected</value>
</data>
<data name="Common_OpenADB" xml:space="preserve">
<data name="Common_EnterRecOrOpenADB" xml:space="preserve">
<value>Please enter Recovery mode or enable USB debugging!</value>
</data>
<data name="Common_NotConnected" xml:space="preserve">
Expand Down Expand Up @@ -1173,4 +1173,7 @@
<data name="Wiredflash_SelectFlashFile" xml:space="preserve">
<value>Please select the flashing file!</value>
</data>
<data name="Common_OpenADB" xml:space="preserve">
<value>Please enable USB debugging!</value>
</data>
</root>
5 changes: 4 additions & 1 deletion UotanToolbox/Assets/Resources.zh-CN.resx
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,7 @@
<data name="Home_Disconnected" xml:space="preserve">
<value>设备已断开连接</value>
</data>
<data name="Common_OpenADB" xml:space="preserve">
<data name="Common_EnterRecOrOpenADB" xml:space="preserve">
<value>请进入Recovery模式或开启USB调试!</value>
</data>
<data name="Common_NotConnected" xml:space="preserve">
Expand Down Expand Up @@ -1170,4 +1170,7 @@
<data name="Wiredflash_SelectFlashFile" xml:space="preserve">
<value>请选择刷机文件!</value>
</data>
<data name="Common_OpenADB" xml:space="preserve">
<value>请开启USB调试!</value>
</data>
</root>
40 changes: 30 additions & 10 deletions UotanToolbox/Features/Home/HomeViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,26 @@ public async Task FreshDeviceList()
}
}

private async Task SystemControl(string shell)
{
if (await GetDevicesInfo.SetDevicesInfoLittle())
{
MainViewModel sukiViewModel = GlobalData.MainViewModelInstance;
if (sukiViewModel.Status == GetTranslation("Home_System"))
{
await CallExternalProgram.ADB($"-s {Global.thisdevice} {shell}");
}
else
{
SukiHost.ShowDialog(new PureDialog(GetTranslation("Common_OpenADB")), allowBackgroundClose: true);
}
}
else
{
SukiHost.ShowDialog(new PureDialog(GetTranslation("Common_NotConnected")), allowBackgroundClose: true);
}
}

private async Task ADBControl(string shell)
{
if (await GetDevicesInfo.SetDevicesInfoLittle())
Expand All @@ -211,7 +231,7 @@ private async Task ADBControl(string shell)
}
else
{
SukiHost.ShowDialog(new PureDialog(GetTranslation("Common_OpenADB")), allowBackgroundClose: true);
SukiHost.ShowDialog(new PureDialog(GetTranslation("Common_EnterRecOrOpenADB")), allowBackgroundClose: true);
}
}
else
Expand Down Expand Up @@ -242,31 +262,31 @@ private async Task FastbootControl(string shell)


[RelayCommand]
public async Task Back() => await ADBControl("shell input keyevent 4");
public async Task Back() => await SystemControl("shell input keyevent 4");

[RelayCommand]
public async Task Home() => await ADBControl("shell input keyevent 3");
public async Task Home() => await SystemControl("shell input keyevent 3");

[RelayCommand]
public async Task Mul() => await ADBControl("shell input keyevent 187");
public async Task Mul() => await SystemControl("shell input keyevent 187");

[RelayCommand]
public async Task Lock() => await ADBControl("shell input keyevent 26");
public async Task Lock() => await SystemControl("shell input keyevent 26");

[RelayCommand]
public async Task VolU() => await ADBControl("shell input keyevent 24");
public async Task VolU() => await SystemControl("shell input keyevent 24");

[RelayCommand]
public async Task VolD() => await ADBControl("shell input keyevent 25");
public async Task VolD() => await SystemControl("shell input keyevent 25");

[RelayCommand]
public async Task Mute() => await ADBControl("shell input keyevent 164");
public async Task Mute() => await SystemControl("shell input keyevent 164");

[RelayCommand]
public async Task SC()
{
string pngname = String.Format($"{DateAndTime.Now:yyyy-MM-dd_HH-mm-ss}");
await ADBControl($"shell /system/bin/screencap -p /sdcard/{pngname}.png");
await SystemControl($"shell /system/bin/screencap -p /sdcard/{pngname}.png");
await SukiHost.ShowToast(GetTranslation("Home_Succeeded"), $"{GetTranslation("Home_Saved")} {pngname}.png {GetTranslation("Home_ToStorage")}", NotificationType.Success);
}

Expand All @@ -292,7 +312,7 @@ public async Task ARSide()
}
else
{
SukiHost.ShowDialog(new PureDialog(GetTranslation("Common_OpenADB")), allowBackgroundClose: true);
SukiHost.ShowDialog(new PureDialog(GetTranslation("Common_EnterRecOrOpenADB")), allowBackgroundClose: true);
}
}
else
Expand Down

0 comments on commit 57a934b

Please sign in to comment.