-
-
Notifications
You must be signed in to change notification settings - Fork 2
88 lines (71 loc) · 2.86 KB
/
localization.yml
File metadata and controls
88 lines (71 loc) · 2.86 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
# Localization Validation Workflow
# Validates that all resource files have consistent keys across all languages
# Runs on push, pull requests, and can be manually triggered
name: Localization Validation
on:
push:
branches: [ "main" ]
paths:
- 'src/Melodee.Blazor/Resources/**'
- 'scripts/validate-resources.sh'
- '.github/workflows/localization.yml'
pull_request:
branches: [ "main" ]
paths:
- 'src/Melodee.Blazor/Resources/**'
- 'scripts/validate-resources.sh'
- '.github/workflows/localization.yml'
workflow_dispatch:
permissions:
contents: read
jobs:
validate-localization:
name: Validate Resource Files
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Validate resource key consistency
run: bash scripts/validate-resources.sh
- name: Count resource keys
run: |
echo "## Resource Key Counts" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "| Language | Key Count |" >> $GITHUB_STEP_SUMMARY
echo "|----------|-----------|" >> $GITHUB_STEP_SUMMARY
BASE_COUNT=$(grep -o '<data name="[^"]*"' src/Melodee.Blazor/Resources/SharedResources.resx | wc -l)
echo "| en-US (Base) | $BASE_COUNT |" >> $GITHUB_STEP_SUMMARY
for lang in de-DE es-ES fr-FR it-IT ja-JP pt-BR ru-RU zh-CN ar-SA; do
COUNT=$(grep -o '<data name="[^"]*"' src/Melodee.Blazor/Resources/SharedResources.$lang.resx | wc -l)
echo "| $lang | $COUNT |" >> $GITHUB_STEP_SUMMARY
done
echo "" >> $GITHUB_STEP_SUMMARY
echo "✅ All language files validated successfully!" >> $GITHUB_STEP_SUMMARY
test-localization:
name: Run Localization Tests
runs-on: ubuntu-latest
needs: validate-localization
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: 10.0.104
- name: Restore dependencies
run: dotnet restore
- name: Build
run: dotnet build --no-restore
- name: Run localization unit tests
run: dotnet test tests/Melodee.Tests.Blazor/Melodee.Tests.Blazor.csproj --no-build --filter "FullyQualifiedName~Localization" --verbosity normal
- name: Test summary
if: success()
run: |
echo "## Localization Test Results" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "✅ All localization tests passed!" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "**Total Tests:** 209+ (including RTL support tests)" >> $GITHUB_STEP_SUMMARY
echo "- LocalizationService tests: 61" >> $GITHUB_STEP_SUMMARY
echo "- Component localization tests: 119" >> $GITHUB_STEP_SUMMARY
echo "- MelodeeComponentBase tests: 29" >> $GITHUB_STEP_SUMMARY