From d57692c5d19e969f221e8d54592ef47d8506da22 Mon Sep 17 00:00:00 2001 From: dyphire Date: Sat, 9 Dec 2023 14:44:40 +0800 Subject: [PATCH] auto build: create .mo files & update binary files --- .github/workflows/build.yml | 7 +++++-- lang/create-mo-files.ps1 | 5 +++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 2dc9bbd..6109590 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -48,16 +48,19 @@ jobs: nuget restore msbuild -restore msbuild MpvNet.sln /m /p:Configuration=Debug + - name: Create .mo files for localization + shell: pwsh + run: Install-Package Gettext.Tools -Force; .\lang\create-mo-files.ps1 - name: Download libmpv # In principle, only update this binary file when significant feature changes occur in mpv/mpv.net shell: msys2 {0} run: | - wget -nv -O libmpv.7z https://downloads.sourceforge.net/mpv-player-windows/mpv-dev-x86_64-v3-20231022-git-6e428c2.7z + wget -nv -O libmpv.7z https://downloads.sourceforge.net/mpv-player-windows/mpv-dev-x86_64-20231203-git-f551a9d.7z 7z x -y libmpv.7z -olibmpv cp -f libmpv/libmpv-2.dll src/MpvNet.Windows/bin/Debug/ || true - name: Download MediaInfo shell: msys2 {0} run: | - wget -nv -O MediaInfo.7z https://mediaarea.net/download/binary/libmediainfo0/23.10/MediaInfo_DLL_23.10_Windows_x64_WithoutInstaller.7z + wget -nv -O MediaInfo.7z https://mediaarea.net/download/binary/libmediainfo0/23.11/MediaInfo_DLL_23.11_Windows_x64_WithoutInstaller.7z 7z x -y MediaInfo.7z -oMediaInfo cp -f MediaInfo/MediaInfo.dll src/MpvNet.Windows/bin/Debug/ || true - name: Download mpvnet.com file diff --git a/lang/create-mo-files.ps1 b/lang/create-mo-files.ps1 index 8dec4ed..12b11be 100644 --- a/lang/create-mo-files.ps1 +++ b/lang/create-mo-files.ps1 @@ -20,8 +20,9 @@ function CreateFolder foreach ($it in $PoFiles) { $folder = "$ExeFolder/Locale/$($it.BaseName)/LC_MESSAGES" - CreateFolder $folder - $moPath = Resolve-Path $folder/mpvnet.mo -ErrorAction Ignore + New-Item -ItemType Directory -Path $folder + $moPath = "$folder/mpvnet.mo" + New-Item -ItemType File -Path $moPath msgfmt --output-file=$moPath $it.FullName if ($LASTEXITCODE -ne 0)