19 lines
810 B
PowerShell
19 lines
810 B
PowerShell
|
|
# Write list of .cs files into cs-files.txt file
|
|
Get-ChildItem $PSScriptRoot/.. -Recurse -File -Filter '*.cs' |
|
|
Where-Object { $_ -notmatch '[/\\]obj[/\\]' } |
|
|
ForEach-Object { $_.FullName } |
|
|
Out-File $PSScriptRoot/cs-files.txt
|
|
|
|
# Create .pot file
|
|
xgettext --force-po --from-code=UTF-8 '--language=c#' -o $PSScriptRoot/source.pot --files-from=$PSScriptRoot/cs-files.txt --keyword=_
|
|
|
|
# Backup .po files
|
|
$BackupTargetFolder = $env:TEMP + '/mpv.net po backup ' + (Get-Date -Format 'yyyy-MM-dd HH_mm_ss')
|
|
Copy-Item $PSScriptRoot/po $BackupTargetFolder -Force -Recurse
|
|
'PO file backup: ' + (Resolve-Path $BackupTargetFolder)
|
|
|
|
# Update .po files
|
|
(Get-ChildItem $PSScriptRoot/PO -Filter '*.po').FullName |
|
|
ForEach-Object { msgmerge --sort-output --backup=none --update $_ $PSScriptRoot/source.pot }
|