From 7f8ad9b3749cd098b68d7808c779cc19bb63a643 Mon Sep 17 00:00:00 2001 From: RestorerZ Date: Sat, 9 Aug 2025 23:32:32 +0200 Subject: [PATCH] translation: Generate year for MS Windows differently Commit 22fc41f1f7c94fca491b6759e49ac2430f0b81a2 used wmic to generate the year, however it may not always be available. So use Powershell directly. related: #17855 closes: #17955 Signed-off-by: RestorerZ Signed-off-by: Christian Brabandt --- src/po/Make_mvc.mak | 36 ++++++++++++++++-------------------- 1 file changed, 16 insertions(+), 20 deletions(-) diff --git a/src/po/Make_mvc.mak b/src/po/Make_mvc.mak index aa11d9fc6a..84620878e8 100644 --- a/src/po/Make_mvc.mak +++ b/src/po/Make_mvc.mak @@ -12,21 +12,18 @@ !ENDIF !IFNDEF LANGUAGE -! IF [powershell.exe -nologo -noprofile \ - $$lng=(Get-UICulture).TwoLetterISOLanguageName; \ - $$Env:LANGUAGE=$$lng;Set-Content -Path .\lng.tmp -Value "LANGUAGE=$$lng"] +! IF ![powershell.exe -NoLogo -NoProfile -Command \ + Set-Content -Path .\_lng.tmp \ + -Value "LANGUAGE=$$((Get-UICulture).TwoLetterISOLanguageName)"] +! INCLUDE _lng.tmp +! IF [del /q .\_lng.tmp] +! ENDIF +! MESSAGE +! MESSAGE The %LANGUAGE% environment variable is not set. +! MESSAGE This variable will be temporarily set to "$(LANGUAGE)" while "nmake.exe" is running. +! MESSAGE See README_mvc.txt for more information on the %LANGUAGE% environment variable. +! MESSAGE ! ENDIF -# In order for the "install" and "cleanup-po" rule to work. -# The others work with just setting the environment variable. -# And to show in the message. -! INCLUDE lng.tmp -! IF [del /q .\lng.tmp] -! ENDIF -! MESSAGE -! MESSAGE The %LANGUAGE% environment variable is not set. -! MESSAGE This variable will be temporarily set to "$(LANGUAGE)" while "nmake.exe" is running. -! MESSAGE See README_mvc.txt for more information on the %LANGUAGE% environment variable. -! MESSAGE !ELSE ! MESSAGE LANGUAGE is already set "$(LANGUAGE)" !ENDIF @@ -95,12 +92,11 @@ PSFLAGS = -NoLogo -NoProfile -Command INSTALLDIR = $(VIMRUNTIME)\lang\$(LANGUAGE)\LC_MESSAGES -!IF [%comspec% /C \ - "for /F %G in ('wmic Path Win32_LocalTime Get Year /format:list ^| \ - findstr /R [0-9^]') do @(echo:%G> .\_date.tmp)"] -!ENDIF -!INCLUDE .\_date.tmp -!IF [$(RM) .\_date.tmp] +!IF ![$(PS) $(PSFLAGS) Set-Content -Path .\_year.tmp \ + -Value Year=$$((Get-Date).Year)] +! INCLUDE .\_year.tmp +! IF [$(RM) .\_year.tmp] +! ENDIF !ENDIF .SUFFIXES: