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:
@@ -1131,12 +1131,12 @@ EXTERN char_u tolower_tab[256]; /* table for tolower() */
|
|||||||
EXTERN char breakat_flags[256]; /* which characters are in 'breakat' */
|
EXTERN char breakat_flags[256]; /* which characters are in 'breakat' */
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* these are in version.c */
|
/* These are in version.c, call init_longVersion() before use. */
|
||||||
extern char *Version;
|
extern char *Version;
|
||||||
#if defined(HAVE_DATE_TIME) && defined(VMS) && defined(VAXC)
|
#if defined(HAVE_DATE_TIME) && defined(VMS) && defined(VAXC)
|
||||||
extern char longVersion[];
|
extern char longVersion[];
|
||||||
#else
|
#else
|
||||||
extern char *longVersion;
|
EXTERN char *longVersion;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@@ -940,10 +940,6 @@ common_init(mparm_T *paramp)
|
|||||||
/* Init the table of Normal mode commands. */
|
/* Init the table of Normal mode commands. */
|
||||||
init_normal_cmds();
|
init_normal_cmds();
|
||||||
|
|
||||||
#if defined(HAVE_DATE_TIME) && defined(VMS) && defined(VAXC)
|
|
||||||
make_version(); /* Construct the long version string. */
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Allocate space for the generic buffers (needed for set_init_1() and
|
* Allocate space for the generic buffers (needed for set_init_1() and
|
||||||
* EMSG2()).
|
* EMSG2()).
|
||||||
@@ -3215,6 +3211,7 @@ mainerr(
|
|||||||
reset_signals(); /* kill us with CTRL-C here, if you like */
|
reset_signals(); /* kill us with CTRL-C here, if you like */
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
init_longVersion();
|
||||||
mch_errmsg(longVersion);
|
mch_errmsg(longVersion);
|
||||||
mch_errmsg("\n");
|
mch_errmsg("\n");
|
||||||
mch_errmsg(_(main_errors[n]));
|
mch_errmsg(_(main_errors[n]));
|
||||||
@@ -3268,6 +3265,7 @@ usage(void)
|
|||||||
reset_signals(); /* kill us with CTRL-C here, if you like */
|
reset_signals(); /* kill us with CTRL-C here, if you like */
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
init_longVersion();
|
||||||
mch_msg(longVersion);
|
mch_msg(longVersion);
|
||||||
mch_msg(_("\n\nUsage:"));
|
mch_msg(_("\n\nUsage:"));
|
||||||
for (i = 0; ; ++i)
|
for (i = 0; ; ++i)
|
||||||
|
@@ -1,5 +1,5 @@
|
|||||||
/* version.c */
|
/* version.c */
|
||||||
void make_version(void);
|
void init_longVersion(void);
|
||||||
int highest_patch(void);
|
int highest_patch(void);
|
||||||
int has_patch(int n);
|
int has_patch(int n);
|
||||||
void ex_version(exarg_T *eap);
|
void ex_version(exarg_T *eap);
|
||||||
|
@@ -37,7 +37,7 @@ char longVersion[sizeof(VIM_VERSION_LONG_DATE) + sizeof(__DATE__)
|
|||||||
+ sizeof(__TIME__) + 3];
|
+ sizeof(__TIME__) + 3];
|
||||||
|
|
||||||
void
|
void
|
||||||
make_version(void)
|
init_longVersion(void)
|
||||||
{
|
{
|
||||||
/*
|
/*
|
||||||
* Construct the long version string. Necessary because
|
* Construct the long version string. Necessary because
|
||||||
@@ -49,8 +49,25 @@ make_version(void)
|
|||||||
strcat(longVersion, __TIME__);
|
strcat(longVersion, __TIME__);
|
||||||
strcat(longVersion, ")");
|
strcat(longVersion, ")");
|
||||||
}
|
}
|
||||||
|
|
||||||
# else
|
# 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
|
# endif
|
||||||
#else
|
#else
|
||||||
char *longVersion = VIM_VERSION_LONG;
|
char *longVersion = VIM_VERSION_LONG;
|
||||||
@@ -761,6 +778,8 @@ static char *(features[]) =
|
|||||||
|
|
||||||
static int included_patches[] =
|
static int included_patches[] =
|
||||||
{ /* Add new patch number below this line */
|
{ /* Add new patch number below this line */
|
||||||
|
/**/
|
||||||
|
103,
|
||||||
/**/
|
/**/
|
||||||
102,
|
102,
|
||||||
/**/
|
/**/
|
||||||
@@ -1148,6 +1167,7 @@ list_version(void)
|
|||||||
* When adding features here, don't forget to update the list of
|
* When adding features here, don't forget to update the list of
|
||||||
* internal variables in eval.c!
|
* internal variables in eval.c!
|
||||||
*/
|
*/
|
||||||
|
init_longVersion();
|
||||||
MSG(longVersion);
|
MSG(longVersion);
|
||||||
#ifdef WIN3264
|
#ifdef WIN3264
|
||||||
# ifdef FEAT_GUI_W32
|
# ifdef FEAT_GUI_W32
|
||||||
|
@@ -36,5 +36,7 @@
|
|||||||
#define VIM_VERSION_NODOT "vim81"
|
#define VIM_VERSION_NODOT "vim81"
|
||||||
#define VIM_VERSION_SHORT "8.1"
|
#define VIM_VERSION_SHORT "8.1"
|
||||||
#define VIM_VERSION_MEDIUM "8.1"
|
#define VIM_VERSION_MEDIUM "8.1"
|
||||||
#define VIM_VERSION_LONG "VIM - Vi IMproved 8.1 (2018 May 17)"
|
#define VIM_VERSION_LONG "VIM - Vi IMproved 8.1 (2018 May 18)"
|
||||||
#define VIM_VERSION_LONG_DATE "VIM - Vi IMproved 8.1 (2018 May 17, compiled "
|
#define VIM_VERSION_LONG_DATE "VIM - Vi IMproved 8.1 (2018 May 18, compiled "
|
||||||
|
#define VIM_VERSION_LONG_ONLY "VIM - Vi IMproved 8.1"
|
||||||
|
#define VIM_VERSION_DATE_ONLY "2018 May 18"
|
||||||
|
Reference in New Issue
Block a user