Skip to content

Commit 7f8ad9b

Browse files
RestorerZchrisbra
authored andcommitted
translation: Generate year for MS Windows differently
Commit 22fc41f 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>
1 parent 982cda6 commit 7f8ad9b

1 file changed

Lines changed: 16 additions & 20 deletions

File tree

src/po/Make_mvc.mak

Lines changed: 16 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -12,21 +12,18 @@
1212
!ENDIF
1313

1414
!IFNDEF LANGUAGE
15-
! IF [powershell.exe -nologo -noprofile \
16-
$$lng=(Get-UICulture).TwoLetterISOLanguageName; \
17-
$$Env:LANGUAGE=$$lng;Set-Content -Path .\lng.tmp -Value "LANGUAGE=$$lng"]
15+
! IF ![powershell.exe -NoLogo -NoProfile -Command \
16+
Set-Content -Path .\_lng.tmp \
17+
-Value "LANGUAGE=$$((Get-UICulture).TwoLetterISOLanguageName)"]
18+
! INCLUDE _lng.tmp
19+
! IF [del /q .\_lng.tmp]
20+
! ENDIF
21+
! MESSAGE
22+
! MESSAGE The %LANGUAGE% environment variable is not set.
23+
! MESSAGE This variable will be temporarily set to "$(LANGUAGE)" while "nmake.exe" is running.
24+
! MESSAGE See README_mvc.txt for more information on the %LANGUAGE% environment variable.
25+
! MESSAGE
1826
! ENDIF
19-
# In order for the "install" and "cleanup-po" rule to work.
20-
# The others work with just setting the environment variable.
21-
# And to show in the message.
22-
! INCLUDE lng.tmp
23-
! IF [del /q .\lng.tmp]
24-
! ENDIF
25-
! MESSAGE
26-
! MESSAGE The %LANGUAGE% environment variable is not set.
27-
! MESSAGE This variable will be temporarily set to "$(LANGUAGE)" while "nmake.exe" is running.
28-
! MESSAGE See README_mvc.txt for more information on the %LANGUAGE% environment variable.
29-
! MESSAGE
3027
!ELSE
3128
! MESSAGE LANGUAGE is already set "$(LANGUAGE)"
3229
!ENDIF
@@ -95,12 +92,11 @@ PSFLAGS = -NoLogo -NoProfile -Command
9592

9693
INSTALLDIR = $(VIMRUNTIME)\lang\$(LANGUAGE)\LC_MESSAGES
9794

98-
!IF [%comspec% /C \
99-
"for /F %G in ('wmic Path Win32_LocalTime Get Year /format:list ^| \
100-
findstr /R [0-9^]') do @(echo:%G> .\_date.tmp)"]
101-
!ENDIF
102-
!INCLUDE .\_date.tmp
103-
!IF [$(RM) .\_date.tmp]
95+
!IF ![$(PS) $(PSFLAGS) Set-Content -Path .\_year.tmp \
96+
-Value Year=$$((Get-Date).Year)]
97+
! INCLUDE .\_year.tmp
98+
! IF [$(RM) .\_year.tmp]
99+
! ENDIF
104100
!ENDIF
105101

106102
.SUFFIXES:

0 commit comments

Comments
 (0)