translation: Generate year for MS Windows differently
Commit:
https://github.com/vim/vim/commit/7f8ad9b3749cd098b68d7808c779cc19bb63a643
Author: RestorerZ <[email protected]>
Date: Sat Aug 9 23:32:32 2025 +0200
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 <[email protected]>
Signed-off-by: Christian Brabandt <[email protected]>
diff --git a/src/po/Make_mvc.mak b/src/po/Make_mvc.mak
index aa11d9fc6..84620878e 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:
--
--
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php
---
You received this message because you are subscribed to the Google Groups
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion visit
https://groups.google.com/d/msgid/vim_dev/E1ukrND-005B9B-Cb%40256bit.org.