core: add terabyte unit for size displayed
parent
b62705a299
commit
f227e9ec3e
|
@ -15,6 +15,7 @@ http://weechat.org/files/releasenotes/ReleaseNotes-devel.html[release notes]
|
|||
|
||||
== Version 1.0 (under dev)
|
||||
|
||||
* core: add terabyte unit for size displayed
|
||||
* core: fix insert of mouse code in input line after a partial key combo
|
||||
(closes #130)
|
||||
* core: check code point value in UTF-8 check function (closes #108)
|
||||
|
|
16
po/cs.po
16
po/cs.po
|
@ -20,8 +20,8 @@ msgid ""
|
|||
msgstr ""
|
||||
"Project-Id-Version: WeeChat\n"
|
||||
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
|
||||
"POT-Creation-Date: 2014-07-20 12:16+0200\n"
|
||||
"PO-Revision-Date: 2014-07-14 18:44+0200\n"
|
||||
"POT-Creation-Date: 2014-07-24 22:41+0200\n"
|
||||
"PO-Revision-Date: 2014-07-25 07:49+0200\n"
|
||||
"Last-Translator: Jiri Golembiovsky <golemj@gmail.com>\n"
|
||||
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
|
||||
"Language: cs\n"
|
||||
|
@ -3903,9 +3903,6 @@ msgstr ""
|
|||
msgid "No secured data set"
|
||||
msgstr ""
|
||||
|
||||
msgid "bytes"
|
||||
msgstr "bajtů"
|
||||
|
||||
msgid "KB"
|
||||
msgstr "KB"
|
||||
|
||||
|
@ -3915,8 +3912,15 @@ msgstr "MB"
|
|||
msgid "GB"
|
||||
msgstr "GB"
|
||||
|
||||
msgid "TB"
|
||||
msgstr ""
|
||||
|
||||
#, fuzzy
|
||||
msgid "byte"
|
||||
msgstr "bajt"
|
||||
msgid_plural "bytes"
|
||||
msgstr[0] "bajt"
|
||||
msgstr[1] "bajt"
|
||||
msgstr[2] "bajt"
|
||||
|
||||
#, c-format
|
||||
msgid "debug: removing file: %s"
|
||||
|
|
15
po/de.po
15
po/de.po
|
@ -22,8 +22,8 @@ msgid ""
|
|||
msgstr ""
|
||||
"Project-Id-Version: WeeChat\n"
|
||||
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
|
||||
"POT-Creation-Date: 2014-07-20 12:16+0200\n"
|
||||
"PO-Revision-Date: 2014-07-22 12:01+0100\n"
|
||||
"POT-Creation-Date: 2014-07-24 22:41+0200\n"
|
||||
"PO-Revision-Date: 2014-07-25 07:49+0200\n"
|
||||
"Last-Translator: Nils Görs <weechatter@arcor.de>\n"
|
||||
"Language-Team: German <weechatter@arcor.de>\n"
|
||||
"Language: de_DE\n"
|
||||
|
@ -4577,9 +4577,6 @@ msgstr ""
|
|||
msgid "No secured data set"
|
||||
msgstr "keine schutzwürdigen Daten definiert"
|
||||
|
||||
msgid "bytes"
|
||||
msgstr "Bytes"
|
||||
|
||||
msgid "KB"
|
||||
msgstr "KB"
|
||||
|
||||
|
@ -4589,8 +4586,14 @@ msgstr "MB"
|
|||
msgid "GB"
|
||||
msgstr "GB"
|
||||
|
||||
msgid "TB"
|
||||
msgstr ""
|
||||
|
||||
#, fuzzy
|
||||
msgid "byte"
|
||||
msgstr "Byte"
|
||||
msgid_plural "bytes"
|
||||
msgstr[0] "Byte"
|
||||
msgstr[1] "Byte"
|
||||
|
||||
#, c-format
|
||||
msgid "debug: removing file: %s"
|
||||
|
|
15
po/es.po
15
po/es.po
|
@ -22,8 +22,8 @@ msgid ""
|
|||
msgstr ""
|
||||
"Project-Id-Version: WeeChat\n"
|
||||
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
|
||||
"POT-Creation-Date: 2014-07-20 12:16+0200\n"
|
||||
"PO-Revision-Date: 2014-07-14 18:44+0200\n"
|
||||
"POT-Creation-Date: 2014-07-24 22:41+0200\n"
|
||||
"PO-Revision-Date: 2014-07-25 07:49+0200\n"
|
||||
"Last-Translator: Elián Hanisch <lambdae2@gmail.com>\n"
|
||||
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
|
||||
"Language: es\n"
|
||||
|
@ -4114,9 +4114,6 @@ msgstr ""
|
|||
msgid "No secured data set"
|
||||
msgstr ""
|
||||
|
||||
msgid "bytes"
|
||||
msgstr "bytes"
|
||||
|
||||
msgid "KB"
|
||||
msgstr "KB"
|
||||
|
||||
|
@ -4126,8 +4123,14 @@ msgstr "MB"
|
|||
msgid "GB"
|
||||
msgstr "GB"
|
||||
|
||||
msgid "TB"
|
||||
msgstr ""
|
||||
|
||||
#, fuzzy
|
||||
msgid "byte"
|
||||
msgstr "byte"
|
||||
msgid_plural "bytes"
|
||||
msgstr[0] "byte"
|
||||
msgstr[1] "byte"
|
||||
|
||||
#, c-format
|
||||
msgid "debug: removing file: %s"
|
||||
|
|
14
po/fr.po
14
po/fr.po
|
@ -21,8 +21,8 @@ msgid ""
|
|||
msgstr ""
|
||||
"Project-Id-Version: WeeChat\n"
|
||||
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
|
||||
"POT-Creation-Date: 2014-07-20 12:16+0200\n"
|
||||
"PO-Revision-Date: 2014-07-20 12:27+0200\n"
|
||||
"POT-Creation-Date: 2014-07-24 22:41+0200\n"
|
||||
"PO-Revision-Date: 2014-07-25 07:49+0200\n"
|
||||
"Last-Translator: Sébastien Helleu <flashcode@flashtux.org>\n"
|
||||
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
|
||||
"Language: fr\n"
|
||||
|
@ -4478,9 +4478,6 @@ msgstr ""
|
|||
msgid "No secured data set"
|
||||
msgstr "Pas de donnée sécurisée définie"
|
||||
|
||||
msgid "bytes"
|
||||
msgstr "octets"
|
||||
|
||||
msgid "KB"
|
||||
msgstr "Ko"
|
||||
|
||||
|
@ -4490,8 +4487,13 @@ msgstr "Mo"
|
|||
msgid "GB"
|
||||
msgstr "Go"
|
||||
|
||||
msgid "TB"
|
||||
msgstr "To"
|
||||
|
||||
msgid "byte"
|
||||
msgstr "octet"
|
||||
msgid_plural "bytes"
|
||||
msgstr[0] "octet"
|
||||
msgstr[1] "octets"
|
||||
|
||||
#, c-format
|
||||
msgid "debug: removing file: %s"
|
||||
|
|
14
po/hu.po
14
po/hu.po
|
@ -20,8 +20,8 @@ msgid ""
|
|||
msgstr ""
|
||||
"Project-Id-Version: WeeChat\n"
|
||||
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
|
||||
"POT-Creation-Date: 2014-07-20 12:16+0200\n"
|
||||
"PO-Revision-Date: 2014-07-14 18:44+0200\n"
|
||||
"POT-Creation-Date: 2014-07-24 22:41+0200\n"
|
||||
"PO-Revision-Date: 2014-07-25 07:49+0200\n"
|
||||
"Last-Translator: Andras Voroskoi <voroskoi@frugalware.org>\n"
|
||||
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
|
||||
"Language: hu\n"
|
||||
|
@ -3525,9 +3525,6 @@ msgstr ""
|
|||
msgid "No secured data set"
|
||||
msgstr ""
|
||||
|
||||
msgid "bytes"
|
||||
msgstr "byte"
|
||||
|
||||
msgid "KB"
|
||||
msgstr "KB"
|
||||
|
||||
|
@ -3537,9 +3534,14 @@ msgstr "MB"
|
|||
msgid "GB"
|
||||
msgstr "GB"
|
||||
|
||||
msgid "TB"
|
||||
msgstr ""
|
||||
|
||||
#, fuzzy
|
||||
msgid "byte"
|
||||
msgstr "byte"
|
||||
msgid_plural "bytes"
|
||||
msgstr[0] "byte"
|
||||
msgstr[1] "byte"
|
||||
|
||||
#, fuzzy, c-format
|
||||
msgid "debug: removing file: %s"
|
||||
|
|
15
po/it.po
15
po/it.po
|
@ -20,8 +20,8 @@ msgid ""
|
|||
msgstr ""
|
||||
"Project-Id-Version: WeeChat\n"
|
||||
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
|
||||
"POT-Creation-Date: 2014-07-20 12:16+0200\n"
|
||||
"PO-Revision-Date: 2014-07-14 18:44+0200\n"
|
||||
"POT-Creation-Date: 2014-07-24 22:41+0200\n"
|
||||
"PO-Revision-Date: 2014-07-25 07:49+0200\n"
|
||||
"Last-Translator: Esteban I. Ruiz Moreno <exio4.com@gmail.com>\n"
|
||||
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
|
||||
"Language: it\n"
|
||||
|
@ -4237,9 +4237,6 @@ msgstr ""
|
|||
msgid "No secured data set"
|
||||
msgstr "Dati sicuri non configurati"
|
||||
|
||||
msgid "bytes"
|
||||
msgstr "byte"
|
||||
|
||||
msgid "KB"
|
||||
msgstr "KB"
|
||||
|
||||
|
@ -4249,8 +4246,14 @@ msgstr "MB"
|
|||
msgid "GB"
|
||||
msgstr "GB"
|
||||
|
||||
msgid "TB"
|
||||
msgstr ""
|
||||
|
||||
#, fuzzy
|
||||
msgid "byte"
|
||||
msgstr "byte"
|
||||
msgid_plural "bytes"
|
||||
msgstr[0] "byte"
|
||||
msgstr[1] "byte"
|
||||
|
||||
#, c-format
|
||||
msgid "debug: removing file: %s"
|
||||
|
|
14
po/ja.po
14
po/ja.po
|
@ -20,8 +20,8 @@ msgid ""
|
|||
msgstr ""
|
||||
"Project-Id-Version: WeeChat\n"
|
||||
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
|
||||
"POT-Creation-Date: 2014-07-20 12:16+0200\n"
|
||||
"PO-Revision-Date: 2014-07-14 18:44+0200\n"
|
||||
"POT-Creation-Date: 2014-07-24 22:41+0200\n"
|
||||
"PO-Revision-Date: 2014-07-25 07:50+0200\n"
|
||||
"Last-Translator: AYANOKOUZI, Ryuunosuke <i38w7i3@yahoo.co.jp>\n"
|
||||
"Language-Team: Japanese <https://github.com/l/weechat/tree/translation_ja>\n"
|
||||
"Language: ja\n"
|
||||
|
@ -4289,9 +4289,6 @@ msgstr ""
|
|||
msgid "No secured data set"
|
||||
msgstr "保護データが設定されていません"
|
||||
|
||||
msgid "bytes"
|
||||
msgstr "バイト"
|
||||
|
||||
msgid "KB"
|
||||
msgstr "キロバイト"
|
||||
|
||||
|
@ -4301,8 +4298,13 @@ msgstr "メガバイト"
|
|||
msgid "GB"
|
||||
msgstr "ギガバイト"
|
||||
|
||||
msgid "TB"
|
||||
msgstr ""
|
||||
|
||||
#, fuzzy
|
||||
msgid "byte"
|
||||
msgstr "バイト"
|
||||
msgid_plural "bytes"
|
||||
msgstr[0] "バイト"
|
||||
|
||||
#, c-format
|
||||
msgid "debug: removing file: %s"
|
||||
|
|
16
po/pl.po
16
po/pl.po
|
@ -21,8 +21,8 @@ msgid ""
|
|||
msgstr ""
|
||||
"Project-Id-Version: WeeChat\n"
|
||||
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
|
||||
"POT-Creation-Date: 2014-07-20 12:16+0200\n"
|
||||
"PO-Revision-Date: 2014-07-14 18:44+0200\n"
|
||||
"POT-Creation-Date: 2014-07-24 22:41+0200\n"
|
||||
"PO-Revision-Date: 2014-07-25 07:50+0200\n"
|
||||
"Last-Translator: Krzysztof Korościk <soltys@szluug.org>\n"
|
||||
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
|
||||
"Language: pl\n"
|
||||
|
@ -4359,9 +4359,6 @@ msgstr ""
|
|||
msgid "No secured data set"
|
||||
msgstr "Brak zabezpieczonych danych"
|
||||
|
||||
msgid "bytes"
|
||||
msgstr "bajty"
|
||||
|
||||
msgid "KB"
|
||||
msgstr "KB"
|
||||
|
||||
|
@ -4371,8 +4368,15 @@ msgstr "MB"
|
|||
msgid "GB"
|
||||
msgstr "GB"
|
||||
|
||||
msgid "TB"
|
||||
msgstr ""
|
||||
|
||||
#, fuzzy
|
||||
msgid "byte"
|
||||
msgstr "bajt"
|
||||
msgid_plural "bytes"
|
||||
msgstr[0] "bajt"
|
||||
msgstr[1] "bajt"
|
||||
msgstr[2] "bajt"
|
||||
|
||||
#, c-format
|
||||
msgid "debug: removing file: %s"
|
||||
|
|
12
po/pt_BR.po
12
po/pt_BR.po
|
@ -21,7 +21,7 @@ msgid ""
|
|||
msgstr ""
|
||||
"Project-Id-Version: WeeChat\n"
|
||||
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
|
||||
"POT-Creation-Date: 2014-07-20 12:16+0200\n"
|
||||
"POT-Creation-Date: 2014-07-24 22:41+0200\n"
|
||||
"PO-Revision-Date: 2014-07-14 18:44+0200\n"
|
||||
"Last-Translator: Sergio Durigan Junior <sergiosdj@gmail.com>\n"
|
||||
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
|
||||
|
@ -4005,9 +4005,6 @@ msgstr ""
|
|||
msgid "No secured data set"
|
||||
msgstr ""
|
||||
|
||||
msgid "bytes"
|
||||
msgstr ""
|
||||
|
||||
msgid "KB"
|
||||
msgstr ""
|
||||
|
||||
|
@ -4017,9 +4014,14 @@ msgstr ""
|
|||
msgid "GB"
|
||||
msgstr ""
|
||||
|
||||
msgid "byte"
|
||||
msgid "TB"
|
||||
msgstr ""
|
||||
|
||||
msgid "byte"
|
||||
msgid_plural "bytes"
|
||||
msgstr[0] ""
|
||||
msgstr[1] ""
|
||||
|
||||
#, c-format
|
||||
msgid "debug: removing file: %s"
|
||||
msgstr ""
|
||||
|
|
15
po/ru.po
15
po/ru.po
|
@ -21,8 +21,8 @@ msgid ""
|
|||
msgstr ""
|
||||
"Project-Id-Version: WeeChat\n"
|
||||
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
|
||||
"POT-Creation-Date: 2014-07-20 12:16+0200\n"
|
||||
"PO-Revision-Date: 2014-07-14 18:44+0200\n"
|
||||
"POT-Creation-Date: 2014-07-24 22:41+0200\n"
|
||||
"PO-Revision-Date: 2014-07-25 07:50+0200\n"
|
||||
"Last-Translator: Aleksey V Zapparov AKA ixti <ixti@member.fsf.org>\n"
|
||||
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
|
||||
"Language: ru\n"
|
||||
|
@ -3554,9 +3554,6 @@ msgstr ""
|
|||
msgid "No secured data set"
|
||||
msgstr ""
|
||||
|
||||
msgid "bytes"
|
||||
msgstr "байтов"
|
||||
|
||||
msgid "KB"
|
||||
msgstr "КБ"
|
||||
|
||||
|
@ -3566,9 +3563,15 @@ msgstr "МБ"
|
|||
msgid "GB"
|
||||
msgstr "ГБ"
|
||||
|
||||
msgid "TB"
|
||||
msgstr ""
|
||||
|
||||
#, fuzzy
|
||||
msgid "byte"
|
||||
msgstr "байтов"
|
||||
msgid_plural "bytes"
|
||||
msgstr[0] "байтов"
|
||||
msgstr[1] "байтов"
|
||||
msgstr[2] "байтов"
|
||||
|
||||
#, fuzzy, c-format
|
||||
msgid "debug: removing file: %s"
|
||||
|
|
14
po/tr.po
14
po/tr.po
|
@ -20,8 +20,8 @@ msgid ""
|
|||
msgstr ""
|
||||
"Project-Id-Version: WeeChat\n"
|
||||
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
|
||||
"POT-Creation-Date: 2014-07-20 12:16+0200\n"
|
||||
"PO-Revision-Date: 2014-07-14 18:44+0200\n"
|
||||
"POT-Creation-Date: 2014-07-24 22:41+0200\n"
|
||||
"PO-Revision-Date: 2014-07-25 07:50+0200\n"
|
||||
"Last-Translator: Hasan Kiran <sunder67@hotmail.com>\n"
|
||||
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
|
||||
"Language: tr\n"
|
||||
|
@ -3167,9 +3167,6 @@ msgstr ""
|
|||
msgid "No secured data set"
|
||||
msgstr ""
|
||||
|
||||
msgid "bytes"
|
||||
msgstr "bayt"
|
||||
|
||||
msgid "KB"
|
||||
msgstr "KB"
|
||||
|
||||
|
@ -3179,8 +3176,13 @@ msgstr "MB"
|
|||
msgid "GB"
|
||||
msgstr "GB"
|
||||
|
||||
msgid "TB"
|
||||
msgstr ""
|
||||
|
||||
#, fuzzy
|
||||
msgid "byte"
|
||||
msgstr "bayt"
|
||||
msgid_plural "bytes"
|
||||
msgstr[0] "bayt"
|
||||
|
||||
#, c-format
|
||||
msgid "debug: removing file: %s"
|
||||
|
|
|
@ -21,7 +21,7 @@ msgid ""
|
|||
msgstr ""
|
||||
"Project-Id-Version: WeeChat 0.4.1-dev\n"
|
||||
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
|
||||
"POT-Creation-Date: 2014-07-20 12:16+0200\n"
|
||||
"POT-Creation-Date: 2014-07-24 22:41+0200\n"
|
||||
"PO-Revision-Date: 2013-02-14 18:20+0100\n"
|
||||
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
|
||||
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
|
||||
|
@ -3166,9 +3166,6 @@ msgstr ""
|
|||
msgid "No secured data set"
|
||||
msgstr ""
|
||||
|
||||
msgid "bytes"
|
||||
msgstr ""
|
||||
|
||||
msgid "KB"
|
||||
msgstr ""
|
||||
|
||||
|
@ -3178,9 +3175,14 @@ msgstr ""
|
|||
msgid "GB"
|
||||
msgstr ""
|
||||
|
||||
msgid "byte"
|
||||
msgid "TB"
|
||||
msgstr ""
|
||||
|
||||
msgid "byte"
|
||||
msgid_plural "bytes"
|
||||
msgstr[0] ""
|
||||
msgstr[1] ""
|
||||
|
||||
#, c-format
|
||||
msgid "debug: removing file: %s"
|
||||
msgstr ""
|
||||
|
|
|
@ -2274,30 +2274,37 @@ string_iconv_fprintf (FILE *file, const char *data, ...)
|
|||
char *
|
||||
string_format_size (unsigned long long size)
|
||||
{
|
||||
char *unit_name[] = { N_("bytes"), N_("KB"), N_("MB"), N_("GB") };
|
||||
char *unit_format[] = { "%.0f", "%.1f", "%.02f", "%.02f" };
|
||||
float unit_divide[] = { 1, 1024, 1024*1024, 1024*1024*1024 };
|
||||
char *unit_name[] = { "", N_("KB"), N_("MB"), N_("GB"), N_("TB") };
|
||||
char *unit_format[] = { "%.0f", "%.1f", "%.02f", "%.02f", "%.02f" };
|
||||
float unit_divide[] = { 1.0, 1000.0, 1000.0 * 1000.0,
|
||||
1000.0 * 1000.0 * 1000.0,
|
||||
1000.0 * 1000.0 * 1000.0 * 1000.0 };
|
||||
char format_size[128], str_size[128];
|
||||
int num_unit;
|
||||
float size_float;
|
||||
|
||||
str_size[0] = '\0';
|
||||
|
||||
if (size < 1024*10)
|
||||
if (size < 10L * 1000L)
|
||||
num_unit = 0;
|
||||
else if (size < 1024*1024)
|
||||
else if (size < 1000L * 1000L)
|
||||
num_unit = 1;
|
||||
else if (size < 1024*1024*1024)
|
||||
else if (size < 1000L * 1000L * 1000L)
|
||||
num_unit = 2;
|
||||
else
|
||||
else if (size < 1000L * 1000L * 1000L * 1000L)
|
||||
num_unit = 3;
|
||||
else
|
||||
num_unit = 4;
|
||||
|
||||
snprintf (format_size, sizeof (format_size),
|
||||
"%s %%s",
|
||||
unit_format[num_unit]);
|
||||
size_float = ((float)size) / ((float)(unit_divide[num_unit]));
|
||||
snprintf (str_size, sizeof (str_size),
|
||||
format_size,
|
||||
((float)size) / ((float)(unit_divide[num_unit])),
|
||||
(size <= 1) ? _("byte") : _(unit_name[num_unit]));
|
||||
size_float,
|
||||
(num_unit == 0) ?
|
||||
NG_("byte", "bytes", size_float) : _(unit_name[num_unit]));
|
||||
|
||||
return strdup (str_size);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue