Skip to content

Find untranslated strings PowerShell script #696

Closed Answered by WimLeflere
WimLeflere asked this question in Q&A
Discussion options

You must be logged in to vote

This is the script that I created that reports all errors.
It gets the solution folder as a command line argument.

param (
   [Parameter(Mandatory=$true)][string]$solutionFolder
)

Add-Type -Path 'ResXManager.Scripting.dll'
$myhost = New-Object -TypeName 'ResXManager.Scripting.Host'
$myhost.Load($solutionFolder)

$allEntries = $myhost.ResourceManager.TableEntries
$allCultures = $myhost.ResourceManager.Cultures

$errorMessage = ""
foreach($entry in $allEntries)
{
   foreach($culture in $allCultures)
   {
      if($entry.GetError($culture, [ref]$errorMessage))
      {
         $fullError = $entry.Container.ToString() + ' - ' + $errorMessage
         Write-Error $fullError
      }
   }
}

$m…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by WimLeflere
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant