free: Adjust space to really use 9 chars

@steffhip found that while the translation hint said use 9 characters in
the free headers, it really was only 7.

Currently each line is constructed with the following (in non wide format):
Header + 6 Columns.  The header takes 7 characters and each column is 11
characters wide and prefixed with one space. Thus we have
7 + (1 + 11) * 6 = 79 characters for each line

By dropping the leading space for the first column after the header -the
header is already terminated by a colon- one could indeed provide the needed
9 letters for the header and thus have 9 + 11 * 1 + (1 + 11) * 5 = 80 Chars
per line which would fit into one line.
This commit is contained in:
Craig Small 2020-04-24 17:42:58 +10:00
parent 3c079c821a
commit fb0915c3ca
9 changed files with 42 additions and 42 deletions

24
free.c
View File

@ -351,13 +351,13 @@ int main(int argc, char **argv)
* the header, and the words need to be right align to
* beginning of a number. */
if (flags & FREE_WIDE) {
printf(_(" total used free shared buffers cache available"));
printf(_(" total used free shared buffers cache available"));
} else {
printf(_(" total used free shared buff/cache available"));
printf(_(" total used free shared buff/cache available"));
}
printf("\n");
printf("%-7s", _("Mem:"));
printf(" %11s", scale_size(MEMINFO_GET(mem_info, MEMINFO_MEM_TOTAL, ul_int), flags, args));
printf("%-9s", _("Mem:"));
printf("%11s", scale_size(MEMINFO_GET(mem_info, MEMINFO_MEM_TOTAL, ul_int), flags, args));
printf(" %11s", scale_size(MEMINFO_GET(mem_info, MEMINFO_MEM_USED, ul_int), flags, args));
printf(" %11s", scale_size(MEMINFO_GET(mem_info, MEMINFO_MEM_FREE, ul_int), flags, args));
printf(" %11s", scale_size(MEMINFO_GET(mem_info, MEMINFO_MEM_SHARED, ul_int), flags, args));
@ -379,28 +379,28 @@ int main(int argc, char **argv)
* to print the high info, even if it is zero.
*/
if (flags & FREE_LOHI) {
printf("%-7s", _("Low:"));
printf(" %11s", scale_size(MEMINFO_GET(mem_info, MEMINFO_MEM_LOW_TOTAL, ul_int), flags, args));
printf("%-9s", _("Low:"));
printf("%11s", scale_size(MEMINFO_GET(mem_info, MEMINFO_MEM_LOW_TOTAL, ul_int), flags, args));
printf(" %11s", scale_size(MEMINFO_GET(mem_info, MEMINFO_MEM_LOW_USED, ul_int), flags, args));
printf(" %11s", scale_size(MEMINFO_GET(mem_info, MEMINFO_MEM_LOW_FREE, ul_int), flags, args));
printf("\n");
printf("%-7s", _("High:"));
printf(" %11s", scale_size(MEMINFO_GET(mem_info, MEMINFO_MEM_HIGH_TOTAL, ul_int), flags, args));
printf("%-9s", _("High:"));
printf("%11s", scale_size(MEMINFO_GET(mem_info, MEMINFO_MEM_HIGH_TOTAL, ul_int), flags, args));
printf(" %11s", scale_size(MEMINFO_GET(mem_info, MEMINFO_MEM_HIGH_USED, ul_int), flags, args));
printf(" %11s", scale_size(MEMINFO_GET(mem_info, MEMINFO_MEM_HIGH_FREE, ul_int), flags, args));
printf("\n");
}
printf("%-7s", _("Swap:"));
printf(" %11s", scale_size(MEMINFO_GET(mem_info, MEMINFO_SWAP_TOTAL, ul_int), flags, args));
printf("%-9s", _("Swap:"));
printf("%11s", scale_size(MEMINFO_GET(mem_info, MEMINFO_SWAP_TOTAL, ul_int), flags, args));
printf(" %11s", scale_size(MEMINFO_GET(mem_info, MEMINFO_SWAP_USED, ul_int), flags, args));
printf(" %11s", scale_size(MEMINFO_GET(mem_info, MEMINFO_SWAP_FREE, ul_int), flags, args));
printf("\n");
if (flags & FREE_TOTAL) {
printf("%-7s", _("Total:"));
printf(" %11s", scale_size(
printf("%-9s", _("Total:"));
printf("%11s", scale_size(
MEMINFO_GET(mem_info, MEMINFO_MEM_TOTAL, ul_int) +
MEMINFO_GET(mem_info, MEMINFO_SWAP_TOTAL, ul_int), flags, args));
printf(" %11s", scale_size(

View File

@ -123,19 +123,19 @@ msgstr "Anzahl im Argument konnte nicht verarbeitet werden: »%s«"
#: free.c:352
#, c-format
msgid ""
" total used free shared buffers "
" total used free shared buffers "
"cache available"
msgstr ""
" gesamt benutzt frei gemeins. Puffer "
" gesamt benutzt frei gemeins. Puffer "
"Cache verfügbar"
#: free.c:354
#, c-format
msgid ""
" total used free shared buff/cache "
" total used free shared buff/cache "
"available"
msgstr ""
" gesamt benutzt frei gemns. Puffer/Cache "
" gesamt benutzt frei gemns. Puffer/Cache "
"verfügbar"
#: free.c:357

View File

@ -139,19 +139,19 @@ msgstr "échec du décodage de l'argument du nombre de répétitions: « %s »
#: free.c:352
#, c-format
msgid ""
" total used free shared buffers "
" total used free shared buffers "
"cache available"
msgstr ""
" total utilisé libre partagé tampons "
" total utilisé libre partagé tampons "
"cache disponible"
#: free.c:354
#, c-format
msgid ""
" total used free shared buff/cache "
" total used free shared buff/cache "
"available"
msgstr ""
" total utilisé libre partagé tamp/cache "
" total utilisé libre partagé tamp/cache "
"disponible"
#: free.c:357

View File

@ -120,19 +120,19 @@ msgstr "niezrozumiały argument liczby powtórzeń: '%s'"
#: free.c:352
#, c-format
msgid ""
" total used free shared buffers "
" total used free shared buffers "
"cache available"
msgstr ""
" razem użyte wolne dzielone bufory w "
" razem użyte wolne dzielone bufory w "
"cache dostępne"
#: free.c:354
#, c-format
msgid ""
" total used free shared buff/cache "
" total used free shared buff/cache "
"available"
msgstr ""
" razem użyte wolne dzielone buf/cache "
" razem użyte wolne dzielone buf/cache "
"dostępne"
#: free.c:357

View File

@ -122,19 +122,19 @@ msgstr "falha ao analisar a quantidade de argumentos: \"%s\""
#: free.c:352
#, c-format
msgid ""
" total used free shared buffers "
" total used free shared buffers "
"cache available"
msgstr ""
" total usada livre compart. buffers "
" total usada livre compart. buffers "
"cache disponível"
#: free.c:354
#, c-format
msgid ""
" total used free shared buff/cache "
" total used free shared buff/cache "
"available"
msgstr ""
" total usada livre compart. buff/cache "
" total usada livre compart. buff/cache "
"disponível"
#: free.c:357

View File

@ -121,19 +121,19 @@ msgstr "misslyckades att tolka upprepningsargumentet: ”%s”"
#: free.c:352
#, c-format
msgid ""
" total used free shared buffers "
" total used free shared buffers "
"cache available"
msgstr ""
" totalt använt fritt delat buffertar "
" totalt använt fritt delat buffertar "
"cache tillgängl."
#: free.c:354
#, c-format
msgid ""
" total used free shared buff/cache "
" total used free shared buff/cache "
"available"
msgstr ""
" totalt använt fritt delat buff/cache "
" totalt använt fritt delat buff/cache "
"tillgängl."
#: free.c:357

View File

@ -126,19 +126,19 @@ msgstr "не вдалося обробити аргумент кількості
#: free.c:352
#, c-format
msgid ""
" total used free shared buffers "
" total used free shared buffers "
"cache available"
msgstr ""
" загалом використ. вільна спільна буфери "
" загалом використ. вільна спільна буфери "
"кеш дост."
#: free.c:354
#, c-format
msgid ""
" total used free shared buff/cache "
" total used free shared buff/cache "
"available"
msgstr ""
" загалом використ. вільна спільна буфери/кеш дост."
" загалом використ. вільна спільна буфери/кеш дост."
#: free.c:357
msgid "Mem:"

View File

@ -131,19 +131,19 @@ msgstr "gặp lỗi khi phân tích số lượng đối số: “%s”"
#: free.c:352
#, c-format
msgid ""
" total used free shared buffers "
" total used free shared buffers "
"cache available"
msgstr ""
" tổng dùng trống chsẻ đệm nhớ "
" tổng dùng trống chsẻ đệm nhớ "
"tạm sẵn sàng"
#: free.c:354
#, c-format
msgid ""
" total used free shared buff/cache "
" total used free shared buff/cache "
"available"
msgstr ""
" tổng dùng trống chsẻ đệm/tạm sẵn "
" tổng dùng trống chsẻ đệm/tạm sẵn "
"sàng"
#: free.c:357

View File

@ -132,7 +132,7 @@ msgstr "查询 spec 文件 %s 失败,无法解析\n"
#: free.c:352
#, c-format
msgid ""
" total used free shared buffers "
" total used free shared buffers "
"cache available"
msgstr ""
" 总计 已用 空闲 共享 缓冲 缓"
@ -141,7 +141,7 @@ msgstr ""
#: free.c:354
#, c-format
msgid ""
" total used free shared buff/cache "
" total used free shared buff/cache "
"available"
msgstr ""
" 总计 已用 空闲 共享 缓冲/缓存 可用"