Skip to content

Commit 7f8e824

Browse files
committed
add english support
1 parent 3aa0198 commit 7f8e824

19 files changed

Lines changed: 970 additions & 157 deletions
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
name: Bug report
2+
description: Report a reproducible issue
3+
title: "[Bug] "
4+
labels: ["bug"]
5+
body:
6+
- type: textarea
7+
id: summary
8+
attributes:
9+
label: Summary
10+
description: What happened?
11+
validations:
12+
required: true
13+
- type: textarea
14+
id: steps
15+
attributes:
16+
label: Steps to reproduce
17+
description: Please provide exact steps.
18+
placeholder: |
19+
1. ...
20+
2. ...
21+
3. ...
22+
validations:
23+
required: true
24+
- type: textarea
25+
id: expected
26+
attributes:
27+
label: Expected behavior
28+
validations:
29+
required: true
30+
- type: textarea
31+
id: actual
32+
attributes:
33+
label: Actual behavior
34+
validations:
35+
required: true
36+
- type: input
37+
id: env
38+
attributes:
39+
label: Environment
40+
placeholder: Windows version, TimeTask version
41+
validations:
42+
required: true

.github/ISSUE_TEMPLATE/config.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
blank_issues_enabled: false
2+
contact_links:
3+
- name: Discussions
4+
url: https://github.com/showkeyjar/TimeTask/discussions
5+
about: Ask questions and discuss ideas with the community.
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
name: Feature request
2+
description: Suggest an improvement
3+
title: "[Feature] "
4+
labels: ["enhancement"]
5+
body:
6+
- type: textarea
7+
id: problem
8+
attributes:
9+
label: Problem
10+
description: What problem are you trying to solve?
11+
validations:
12+
required: true
13+
- type: textarea
14+
id: proposal
15+
attributes:
16+
label: Proposal
17+
description: Describe your preferred solution.
18+
validations:
19+
required: true
20+
- type: textarea
21+
id: alternatives
22+
attributes:
23+
label: Alternatives considered
24+
- type: textarea
25+
id: context
26+
attributes:
27+
label: Additional context

.github/workflows/release.yml

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
name: TimeTask Release
2+
3+
on:
4+
push:
5+
tags:
6+
- "v*"
7+
workflow_dispatch:
8+
9+
permissions:
10+
contents: write
11+
12+
jobs:
13+
release:
14+
runs-on: windows-latest
15+
env:
16+
Main_Project_Path: TimeTask.csproj
17+
Build_Configuration: Release
18+
Build_Platform: AnyCPU
19+
Artifact_Name: TimeTask-win-x64.zip
20+
21+
steps:
22+
- name: Checkout
23+
uses: actions/checkout@v4
24+
25+
- name: Setup MSBuild.exe
26+
uses: microsoft/setup-msbuild@v2
27+
28+
- name: Restore
29+
run: msbuild $env:Main_Project_Path /t:Restore /p:Configuration=$env:Build_Configuration /p:Platform=$env:Build_Platform
30+
31+
- name: Build
32+
run: msbuild $env:Main_Project_Path /p:Configuration=$env:Build_Configuration /p:Platform=$env:Build_Platform /m
33+
34+
- name: Package app
35+
shell: pwsh
36+
run: |
37+
$outputDir = Join-Path $env:GITHUB_WORKSPACE "bin\Release"
38+
if (-not (Test-Path (Join-Path $outputDir "TimeTask.exe"))) {
39+
throw "TimeTask.exe not found in $outputDir"
40+
}
41+
42+
$stagingDir = Join-Path $env:RUNNER_TEMP "TimeTask"
43+
New-Item -ItemType Directory -Path $stagingDir -Force | Out-Null
44+
Copy-Item -Path (Join-Path $outputDir "*") -Destination $stagingDir -Recurse -Force
45+
46+
$zipPath = Join-Path $env:GITHUB_WORKSPACE $env:Artifact_Name
47+
if (Test-Path $zipPath) { Remove-Item $zipPath -Force }
48+
Compress-Archive -Path (Join-Path $stagingDir "*") -DestinationPath $zipPath -Force
49+
50+
- name: Create release
51+
uses: softprops/action-gh-release@v2
52+
with:
53+
files: TimeTask-win-x64.zip
54+
generate_release_notes: true

App.config

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,9 @@
138138
<setting name="Left" serializeAs="String">
139139
<value>640</value>
140140
</setting>
141+
<setting name="UiLanguage" serializeAs="String">
142+
<value>zh-CN</value>
143+
</setting>
141144
</TimeTask.Properties.Settings>
142145
</userSettings>
143146
</configuration>

App.xaml.cs

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -29,12 +29,13 @@ public partial class App : Application
2929

3030
protected override void OnStartup(StartupEventArgs e)
3131
{
32+
I18n.InitializeFromSettings();
3233
base.OnStartup(e); // Call base implementation
3334
VoiceRuntimeLog.Info("App startup.");
3435
VoiceRuntimeLog.Info($"ProcessBitness: {(Environment.Is64BitProcess ? "x64" : "x86")}, OS: {(Environment.Is64BitOperatingSystem ? "x64" : "x86")}");
3536
VoiceRuntimeLog.Info($"BaseDirectory: {AppDomain.CurrentDomain.BaseDirectory}");
3637
VoiceRuntimeLog.Info($"Config: VoiceAsrProvider={ConfigurationManager.AppSettings["VoiceAsrProvider"]}, FunAsrAutoBootstrap={ConfigurationManager.AppSettings["FunAsrAutoBootstrap"]}");
37-
VoiceListenerStatusCenter.Publish(VoiceListenerState.Unavailable, "语音监听不可用(启动初始化中)");
38+
VoiceListenerStatusCenter.Publish(VoiceListenerState.Unavailable, I18n.T("Voice_StatusUnavailable"));
3839
FunAsrRuntimeManager.KickoffIfNeeded();
3940

4041
// 启动自动更新检查(后台执行)
@@ -55,10 +56,8 @@ protected override void OnStartup(StartupEventArgs e)
5556
if (string.IsNullOrWhiteSpace(apiKey) || apiKey == PlaceholderApiKey)
5657
{
5758
System.Windows.MessageBox.Show(
58-
"The OpenAI API key is not configured or is using the placeholder value. " +
59-
"LLM-powered features like smart suggestions and automatic task classification will use dummy responses or may not function correctly. " +
60-
"Please refer to the readme.md file for instructions on how to set up your API key in the App.config file.",
61-
"API Key Configuration Warning",
59+
I18n.T("App_ApiKeyWarningText"),
60+
I18n.T("App_ApiKeyWarningTitle"),
6261
System.Windows.MessageBoxButton.OK,
6362
System.Windows.MessageBoxImage.Warning
6463
);
@@ -107,17 +106,16 @@ protected override void OnStartup(StartupEventArgs e)
107106
_legacyAudioService = new AudioCaptureService();
108107
_legacyAudioService.Start();
109108
VoiceRuntimeLog.Info("Legacy AudioCaptureService started as fallback.");
110-
VoiceListenerStatusCenter.Publish(VoiceListenerState.Ready, "已回退到系统语音引擎,监听可用");
109+
VoiceListenerStatusCenter.Publish(VoiceListenerState.Ready, I18n.T("Voice_StatusReady"));
111110
}
112111
catch (Exception ex2)
113112
{
114113
Console.WriteLine($"[App] Legacy AudioCaptureService also failed: {ex2.Message}");
115114
VoiceRuntimeLog.Error("Legacy AudioCaptureService start failed.", ex2);
116-
VoiceListenerStatusCenter.Publish(VoiceListenerState.Unavailable, "语音监听不可用");
115+
VoiceListenerStatusCenter.Publish(VoiceListenerState.Unavailable, I18n.T("Voice_StatusUnavailable"));
117116
MessageBox.Show(
118-
"语音识别初始化失败,系统未检测到可用语音识别引擎或麦克风权限异常。\n" +
119-
$"请查看日志:{VoiceRuntimeLog.LogFilePath}",
120-
"语音功能不可用",
117+
I18n.Tf("App_VoiceInitFailedTextFormat", VoiceRuntimeLog.LogFilePath),
118+
I18n.T("App_VoiceInitFailedTitle"),
121119
MessageBoxButton.OK,
122120
MessageBoxImage.Warning);
123121
}

CONTRIBUTING.md

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
# Contributing to TimeTask
2+
3+
Thanks for helping improve TimeTask.
4+
5+
## Ways To Contribute
6+
- Report bugs with reproducible steps.
7+
- Propose features with clear user scenarios.
8+
- Improve docs (setup, screenshots, translations).
9+
- Submit focused pull requests.
10+
11+
## Before Opening A PR
12+
1. Check existing issues/PRs to avoid duplicates.
13+
2. Keep changes scoped to one topic.
14+
3. Update docs when behavior changes.
15+
16+
## Pull Request Checklist
17+
- Describe what changed and why.
18+
- Include screenshots for UI changes.
19+
- Mention breaking changes clearly.
20+
- Link related issue (if any).
21+
22+
## Bug Report Template
23+
Include:
24+
- Environment (Windows version, app version).
25+
- Steps to reproduce.
26+
- Expected vs actual behavior.
27+
- Error logs (if available, redact secrets).
28+
29+
## Security
30+
Do not post API keys or personal data in issues.
31+
32+
For sensitive issues, open a private report with repository maintainers.

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2026 showkeyjar
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

0 commit comments

Comments
 (0)