1
0
forked from aniani/vim

patch 8.1.0103: long version string cannot be translated

Problem:    Long version string cannot be translated.
Solution:   Build the string in init_longVersion().
This commit is contained in:
Bram Moolenaar
2018-06-23 16:12:21 +02:00
parent 1f8c469fe2
commit 35fb6fbf72
5 changed files with 31 additions and 11 deletions

View File

@@ -37,7 +37,7 @@ char longVersion[sizeof(VIM_VERSION_LONG_DATE) + sizeof(__DATE__)
+ sizeof(__TIME__) + 3];
void
make_version(void)
init_longVersion(void)
{
/*
* Construct the long version string. Necessary because
@@ -49,8 +49,25 @@ make_version(void)
strcat(longVersion, __TIME__);
strcat(longVersion, ")");
}
# else
char *longVersion = VIM_VERSION_LONG_DATE __DATE__ " " __TIME__ ")";
void
init_longVersion(void)
{
char *date_time = __DATE__ " " __TIME__;
char *msg = _("%s (%s, compiled %s)");
size_t len = strlen(msg)
+ strlen(VIM_VERSION_LONG_ONLY)
+ strlen(VIM_VERSION_DATE_ONLY)
+ strlen(date_time);
longVersion = (char *)alloc(len);
if (longVersion == NULL)
longVersion = VIM_VERSION_LONG;
else
vim_snprintf(longVersion, len, msg,
VIM_VERSION_LONG_ONLY, VIM_VERSION_DATE_ONLY, date_time);
}
# endif
#else
char *longVersion = VIM_VERSION_LONG;
@@ -761,6 +778,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
103,
/**/
102,
/**/
@@ -1148,6 +1167,7 @@ list_version(void)
* When adding features here, don't forget to update the list of
* internal variables in eval.c!
*/
init_longVersion();
MSG(longVersion);
#ifdef WIN3264
# ifdef FEAT_GUI_W32