Files
mpv.net/lang/create-mo-files.ps1
2024-07-15 07:32:30 +02:00

21 lines
479 B
PowerShell

$ErrorActionPreference = 'Stop'
$PoFiles = Get-ChildItem $PSScriptRoot/po
$ExeFolder = "$PSScriptRoot/../src/MpvNet.Windows/bin/Debug"
foreach ($it in $PoFiles)
{
$folder = "$ExeFolder/Locale/$($it.BaseName)/LC_MESSAGES"
if (-not (Test-Path $folder))
{
New-Item -ItemType Directory -Path $folder | Out-Null
}
$moPath = "$folder/mpvnet.mo"
msgfmt --output-file=$moPath $it.FullName
if ($LastExitCode) { throw $LastExitCode }
$moPath
}