From fb0915c3caabc6101302e4fc11c6ff942a5bd349 Mon Sep 17 00:00:00 2001 From: Craig Small Date: Fri, 24 Apr 2020 17:42:58 +1000 Subject: [PATCH] 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. --- free.c | 24 ++++++++++++------------ po/de.po | 8 ++++---- po/fr.po | 8 ++++---- po/pl.po | 8 ++++---- po/pt_BR.po | 8 ++++---- po/sv.po | 8 ++++---- po/uk.po | 8 ++++---- po/vi.po | 8 ++++---- po/zh_CN.po | 4 ++-- 9 files changed, 42 insertions(+), 42 deletions(-) diff --git a/free.c b/free.c index 87249564..9bc34d35 100644 --- a/free.c +++ b/free.c @@ -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( diff --git a/po/de.po b/po/de.po index 81377b12..637c037b 100644 --- a/po/de.po +++ b/po/de.po @@ -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 diff --git a/po/fr.po b/po/fr.po index 75ae23b9..ca9a6899 100644 --- a/po/fr.po +++ b/po/fr.po @@ -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 diff --git a/po/pl.po b/po/pl.po index 7dfc57c3..4e3c0447 100644 --- a/po/pl.po +++ b/po/pl.po @@ -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 diff --git a/po/pt_BR.po b/po/pt_BR.po index e7a859f3..bff36ce4 100644 --- a/po/pt_BR.po +++ b/po/pt_BR.po @@ -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 diff --git a/po/sv.po b/po/sv.po index c15cc4dc..16057406 100644 --- a/po/sv.po +++ b/po/sv.po @@ -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 diff --git a/po/uk.po b/po/uk.po index 61292a19..744dd095 100644 --- a/po/uk.po +++ b/po/uk.po @@ -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:" diff --git a/po/vi.po b/po/vi.po index b4e63a70..b01ded96 100644 --- a/po/vi.po +++ b/po/vi.po @@ -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 diff --git a/po/zh_CN.po b/po/zh_CN.po index e642c584..677721b0 100644 --- a/po/zh_CN.po +++ b/po/zh_CN.po @@ -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 "" " 总计 已用 空闲 共享 缓冲/缓存 可用"