]> git.ipfire.org Git - thirdparty/vim.git/commitdiff
translation: Generate year for MS Windows differently
authorRestorerZ <restorer@mail2k.ru>
Sat, 9 Aug 2025 21:32:32 +0000 (23:32 +0200)
committerChristian Brabandt <cb@256bit.org>
Sat, 9 Aug 2025 21:35:11 +0000 (23:35 +0200)
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 <restorer@mail2k.ru>
Signed-off-by: Christian Brabandt <cb@256bit.org>
src/po/Make_mvc.mak

index aa11d9fc6a2c4737ee2aa0f6b599b88ae98848cd..84620878e8a267c4ef3d4ac61210c93b1a60b509 100644 (file)
 !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: