Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
62 changes: 62 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
name: Build Tai

on:
push:
branches: [ main, develop, feat/*, hotfix/* ]
pull_request:
branches: [ main, develop ]

jobs:
build:
runs-on: windows-latest

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Setup .NET Framework
uses: microsoft/setup-dotnet@v3
with:
dotnet-version: '4.8.x'

- name: Restore NuGet packages
run: |
nuget restore Tai.sln

- name: Build Core project
run: |
msbuild Core/Core.csproj /p:Configuration=Release /p:Platform="Any CPU" /verbosity:minimal

- name: Build UI project
run: |
msbuild UI/UI.csproj /p:Configuration=Release /p:Platform="Any CPU" /verbosity:minimal

- name: Build TaiBug project
run: |
msbuild TaiBug/TaiBug.csproj /p:Configuration=Release /p:Platform="Any CPU" /verbosity:minimal

- name: Build Updater project
run: |
msbuild Updater/Updater.csproj /p:Configuration=Release /p:Platform="Any CPU" /verbosity:minimal

- name: Create artifacts directory
run: |
mkdir -p artifacts

- name: Copy build outputs
run: |
xcopy /E /I /Y "UI\bin\Release\*" "artifacts\"
xcopy /E /I /Y "Core\bin\Release\*" "artifacts\"
xcopy /E /I /Y "TaiBug\bin\Release\*" "artifacts\"
xcopy /E /I /Y "Updater\bin\Release\*" "artifacts\"

- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: tai-build-artifacts
path: artifacts/

- name: Build summary
run: |
echo "Build completed successfully!"
echo "Artifacts are available in the artifacts directory"
1 change: 1 addition & 0 deletions .github/workflows/ci-cd.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

82 changes: 82 additions & 0 deletions .github/workflows/localization-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
name: Localization Test

on:
push:
branches: [ main, develop, feat/* ]
paths: [ 'UI/Properties/Resources*.resx', 'UI/Servicers/LocalizationServicer.cs', 'UI/Controls/Converters/LocalizationExtension.cs' ]
pull_request:
branches: [ main, develop ]
paths: [ 'UI/Properties/Resources*.resx', 'UI/Servicers/LocalizationServicer.cs', 'UI/Controls/Converters/LocalizationExtension.cs' ]

jobs:
test-localization:
runs-on: windows-latest

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Setup .NET Framework
uses: microsoft/setup-dotnet@v3
with:
dotnet-version: '4.8.x'

- name: Restore dependencies
run: |
nuget restore Tai.sln

- name: Build UI project
run: |
msbuild UI/UI.csproj /p:Configuration=Debug /p:Platform="Any CPU" /verbosity:minimal

- name: Test resource files
run: |
echo "Testing resource files..."

# 检查中文资源文件
if (Test-Path "UI/Properties/Resources.resx") {
echo "✓ Chinese resource file exists"
} else {
echo "✗ Chinese resource file missing"
exit 1
}

# 检查英文资源文件
if (Test-Path "UI/Properties/Resources.en.resx") {
echo "✓ English resource file exists"
} else {
echo "✗ English resource file missing"
exit 1
}

- name: Validate resource keys
run: |
echo "Validating resource keys..."

# 这里可以添加更详细的资源键验证逻辑
# 例如检查中英文资源文件中的键是否匹配

echo "Resource validation completed"

- name: Test localization service
run: |
echo "Testing localization service..."

# 编译测试程序
csc /reference:UI/bin/Debug/UI.dll /reference:Core/bin/Debug/Core.dll LocalizationTest.cs

if (Test-Path "LocalizationTest.exe") {
echo "✓ Localization test program compiled successfully"
} else {
echo "✗ Failed to compile localization test program"
exit 1
}

- name: Upload test results
uses: actions/upload-artifact@v4
with:
name: localization-test-results
path: |
LocalizationTest.exe
UI/bin/Debug/
retention-days: 7
9 changes: 9 additions & 0 deletions Core/AppState.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,14 @@ public class AppState
public static int ProcessValue { get; set; } = 0;

public static string ActionText { get; set; } = "加载中,请稍后...";

/// <summary>
/// 设置操作文本(本地化)
/// </summary>
/// <param name="text">本地化键</param>
public static void SetActionText(string text)
{
ActionText = text;
}
}
}
12 changes: 12 additions & 0 deletions Core/Models/Config/ConfigAttribute.cs
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,18 @@ public ConfigAttribute()
Options = string.Empty;
IsBeta = false;
}

public ConfigAttribute(string toggleTrueText, string toggleFalseText)
{
ToggleTrueText = toggleTrueText;
ToggleFalseText = toggleFalseText;
IsCanRepeat = true;
Index = 0;
IsName = false;
IsCanImportExport = false;
Options = string.Empty;
IsBeta = false;
}


}
Expand Down
Loading