]> git.ipfire.org Git - thirdparty/git.git/commit - builtin/blame.c
blame: dynamic blame_date_width for different locales
authorJiang Xin <worldhello.net@gmail.com>
Tue, 22 Apr 2014 14:39:10 +0000 (22:39 +0800)
committerJunio C Hamano <gitster@pobox.com>
Wed, 23 Apr 2014 07:02:15 +0000 (00:02 -0700)
commitdd75553b357d4483d2b58a9e1ac86352f3d2e103
treedd9195aa76294981342188c8e4e6a5e04642b12b
parentbccce0f8099fac6bcc80914726ddf43ca544b3c1
blame: dynamic blame_date_width for different locales

When show date in relative date format for git-blame, the max display
width of datetime is set as the length of the string "Thu Oct 19
16:00:04 2006 -0700" (30 characters long).  But actually the max width
for C locale is only 22 (the length of string "x years, xx months ago").
And for other locale, it maybe smaller.  E.g. For Chinese locale, only
needs a half (16-character width).

Set blame_date_width as the display width of _("4 years, 11 months
ago"), so that translators can make the choice.

Helped-by: Junio C Hamano <gitster@pobox.com>
Signed-off-by: Jiang Xin <worldhello.net@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin/blame.c