-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Parse_XML.ps1
38 lines (29 loc) · 955 Bytes
/
Parse_XML.ps1
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
$dir = ".\directory\"
$strings = "strings.xml"
$fullDir = $dir + $strings
$csv = $dir + "Results.csv"
[XML]$content = Get-Content $fullDIr
Stop-Process -Name notepad -Force
Remove-Item -Path $csv
$xml = New-Object -TypeName XML
$xml.Load($fullDir)
$translatableCount=0;
$translatableFalseCount=0;
foreach ($bename in $Xml.resources.string) {
if($bename.translatable -ne $false){
$translatableCount++;
Write-Host $bename.name #key
$AdditionalContent = [PSCustomObject]@{Key = $bename.name; Value = $bename.InnerXML}
$AdditionalContent | Export-Csv -Path $csv -NoTypeInformation -Append
}
else
{
$translatableFalseCount++;
}
$i++
}
Invoke-Item $fullDir
Invoke-Item $csv
Write-Host "Strings Translatable = " $translatableCount
Write-Host "Strings Non-Translatable = " $translatableFalseCount
Write-Host "Strings Total = " $i