patch 8.1.0103: long version string cannot be translated
Problem: Long version string cannot be translated.
Solution: Build the string in init_longVersion().
diff --git a/src/version.c b/src/version.c
index a38cdda..45f339b 100644
--- a/src/version.c
+++ b/src/version.c
@@ -37,7 +37,7 @@
+ sizeof(__TIME__) + 3];
void
-make_version(void)
+init_longVersion(void)
{
/*
* Construct the long version string. Necessary because
@@ -49,8 +49,25 @@
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;
@@ -762,6 +779,8 @@
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
+ 103,
+/**/
102,
/**/
101,
@@ -1148,6 +1167,7 @@
* 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