自动化立体仓库 - WMS系统
lty
3 天以前 8e943b7104561c3b14cf223016698709c5ade4b5
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
$javaFiles = Get-ChildItem -Path "src/main/java" -Recurse -Filter "*.java"
$foundKeys = @()
foreach ($file in $javaFiles) {
    $content = Get-Content $file.FullName
    $matches = [regex]::Matches($content, 'response\.[a-zA-Z0-9_]+')
    foreach ($match in $matches) {
        $foundKeys += $match.Value
    }
}
$foundKeys = $foundKeys | Sort-Object | Get-Unique
 
# Exclude technical calls like response.getOutputStream, response.setContentType, etc.
$exclude = @("response.getOutputStream", "response.setContentType", "response.setCharacterEncoding", "response.setHeader", "response.sendRedirect", "response.getWriter", "response.addCookie", "response.setStatus", "response.reset")
$foundKeys = $foundKeys | Where-Object { $exclude -notcontains $_ }
 
$enContent = Get-Content "src/main/webapp/static/i18n/en.json" -Raw
$enKeys = [regex]::Matches($enContent, '"(response\.[^"]+)"') | ForEach-Object { $_.Groups[1].Value }
 
$cnContent = Get-Content "src/main/webapp/static/i18n/zh-cn.json" -Raw
$cnKeys = [regex]::Matches($cnContent, '"(response\.[^"]+)"') | ForEach-Object { $_.Groups[1].Value }
 
$missingEn = $foundKeys | Where-Object { $enKeys -notcontains $_ }
$missingCn = $foundKeys | Where-Object { $cnKeys -notcontains $_ }
 
Write-Output "Missing in EN:"
$missingEn
Write-Output "Missing in CN:"
$missingCn