Skip to content

Commit

Permalink
Updated Russian translation
Browse files Browse the repository at this point in the history
  • Loading branch information
rilian-la-te committed Apr 20, 2015
1 parent d65c018 commit a50a288
Show file tree
Hide file tree
Showing 3 changed files with 207 additions and 46 deletions.
83 changes: 54 additions & 29 deletions applets/gtop/gtop.vala
Original file line number Diff line number Diff line change
Expand Up @@ -77,38 +77,63 @@ public class NetloadIconExporter : ItemExporter
dlg.icon_name = "network-wired";
return dlg;
}
private string format_net_label(uint64 data, bool padding)
private string format_net_label(uint64 bytes, bool padding, bool less_kilo = true, int show_as = 0, string in_begin = "")
{
string str;
/*if(data < 1000)
{
string = g_strdup_printf("%d B/s", data);
string format;
string unit;
uint64 kilo; /* no really a kilo : a kilo or kibi */

if (show_as == 2) { //Bits
bytes *= 8;
kilo = 1000;
} else if (show_as == 1) //Decimal
kilo = 1000;
else //Binary
kilo = 1024;

if (less_kilo && (bytes < kilo)) {
format = "%s%.0lf %s";
if (show_as == 2) unit = _("b");
else if (show_as == 1) unit = _("B");
else unit = _("B");

} else if (bytes < (kilo * kilo)) {
format = (bytes < (100 * kilo)) ? "%s%.1f %s" : "%s%.0f %s";
bytes /= kilo;
if (show_as == 2) unit = _("kb");
else if (show_as == 1) unit = _("kB");
else unit = _("KiB");

} else if (bytes < (kilo * kilo * kilo)) {
format = "%s%.1lf %s";
bytes /= kilo * kilo;
if (show_as == 2) unit = _("Mb");
else if (show_as == 1) unit = _("MB");
else unit = _("MiB");

} else if (bytes < (kilo * kilo * kilo * kilo)) {
format = "%s%.3lf %s";
bytes /= kilo * kilo * kilo;
if (show_as == 2) unit = _("Gb");
else if (show_as == 1) unit = _("GB");
else unit = _("GiB");

} else if (bytes < (kilo * kilo * kilo * kilo * kilo)) {
format = "%s%.3lf %s";
bytes /= kilo * kilo * kilo * kilo;
if (show_as == 2) unit = _("Tb");
else if (show_as == 1) unit = _("TB");
else unit = _("TiB");

} else {
format = "%s%.3f %s";
bytes /= kilo * kilo * kilo * kilo * kilo;
if (show_as == 2) unit = _("Pb");
else if (show_as == 1) unit = _("PB");
else unit = _("PiB");
}
else*/ if(data < 1000000) //should be < 1 MiB and not 1 MB, but this keeps width smaller
str = "%.1lf KiB/s".printf(data/1024.0);
else
str = "%.2lf MiB/s".printf(data/1048576.0);
//will someone have 1 gb/s ? maybe...
//~ if(padding)
//~ {
//~ //render string and get its pixel width
//~ int width = 0;
//~ int maxWidth = 12; //max width for label in pixels
//~ //TODO: should be determined from current panel font type and size
//~ int spaceWidth = 4; //width of one space char in pixels,
//~ Pango.Context context = this.get_pango_context();
//~ Pango.Layout layout = new Pango.Layout(context);
//~ layout.set_text(str);
//~ layout.get_pixel_size(out width, null);
//~ // frees the layout object, do not use after this point
//~ //push max size up as needed
//~ if (width > maxWidth) maxWidth = width + spaceWidth;
//~ //fill up with spaces
//~ str = "%*s%s".printf((int)((maxWidth-width)/spaceWidth), " ", str);
//~ }
return str;
return format.printf(in_begin, bytes, unit);
}

private void get_net(ref uint64[] traffic)
{
glibtop_netload netload;
Expand Down
86 changes: 77 additions & 9 deletions po/ru.po
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ msgid ""
msgstr ""
"Project-Id-Version: lxpanel\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2015-04-21 01:10+0600\n"
"PO-Revision-Date: 2015-04-21 01:13+0600\n"
"POT-Creation-Date: 2015-04-21 01:25+0600\n"
"PO-Revision-Date: 2015-04-21 01:27+0600\n"
"Last-Translator: Andriy Grytsenko <[email protected]>\n"
"Language-Team: Russian <[email protected]>\n"
"Language: ru\n"
Expand Down Expand Up @@ -294,7 +294,7 @@ msgstr ""
"Отдача: %s\n"
"Загрузка: %s"

#: ../applets/gtop/gtop.vala:73 ../applets/gtop/gtop.vala:236
#: ../applets/gtop/gtop.vala:73 ../applets/gtop/gtop.vala:261
msgid "Vala Panel Netload Applet"
msgstr "Апплет загрузки сети Vala Panel"

Expand All @@ -306,27 +306,95 @@ msgstr "Выбрать сетевой интерфейс"
msgid "Reload network interfaces"
msgstr "Перезагрузить сетевой интерфейс"

#: ../applets/gtop/gtop.vala:200
#: ../applets/gtop/gtop.vala:96
msgid "b"
msgstr "б"

#: ../applets/gtop/gtop.vala:97 ../applets/gtop/gtop.vala:98
msgid "B"
msgstr "Б"

#: ../applets/gtop/gtop.vala:103
msgid "kb"
msgstr "Кбит"

#: ../applets/gtop/gtop.vala:104
msgid "kB"
msgstr "КБ"

#: ../applets/gtop/gtop.vala:105
msgid "KiB"
msgstr "КиБ"

#: ../applets/gtop/gtop.vala:110
msgid "Mb"
msgstr "Мбит"

#: ../applets/gtop/gtop.vala:111
msgid "MB"
msgstr "МБ"

#: ../applets/gtop/gtop.vala:112
msgid "MiB"
msgstr "МиБ"

#: ../applets/gtop/gtop.vala:117
msgid "Gb"
msgstr "Гбит"

#: ../applets/gtop/gtop.vala:118
msgid "GB"
msgstr "ГБ"

#: ../applets/gtop/gtop.vala:119
msgid "GiB"
msgstr "ГиБ"

#: ../applets/gtop/gtop.vala:124
msgid "Tb"
msgstr "Тбит"

#: ../applets/gtop/gtop.vala:125
msgid "TB"
msgstr "ТБ"

#: ../applets/gtop/gtop.vala:126
msgid "TiB"
msgstr "ТиБ"

#: ../applets/gtop/gtop.vala:131
msgid "Pb"
msgstr "Пбит"

#: ../applets/gtop/gtop.vala:132
msgid "PB"
msgstr "ПБ"

#: ../applets/gtop/gtop.vala:133
msgid "PiB"
msgstr "ПиБ"

#: ../applets/gtop/gtop.vala:225
msgid "All"
msgstr "Все"

#: ../applets/gtop/gtop.vala:212
#: ../applets/gtop/gtop.vala:237
msgid "Netload Applet"
msgstr "Апплет загрузки сети"

#: ../applets/gtop/gtop.vala:219
#: ../applets/gtop/gtop.vala:244
msgid "Interfaces"
msgstr "Интерфейсы"

#: ../applets/gtop/gtop.vala:226
#: ../applets/gtop/gtop.vala:251
msgid "Down"
msgstr "Загрузка"

#: ../applets/gtop/gtop.vala:230
#: ../applets/gtop/gtop.vala:255
msgid "Up"
msgstr "Отдача"

#: ../applets/gtop/gtop.vala:237
#: ../applets/gtop/gtop.vala:262
msgid "Simple LibGTop based network indicator."
msgstr "Простой индикатор загрузки сети на libgtop."

Expand Down
84 changes: 76 additions & 8 deletions po/vala-panel-extras.pot
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2015-04-21 01:10+0600\n"
"POT-Creation-Date: 2015-04-21 01:25+0600\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <[email protected]>\n"
Expand Down Expand Up @@ -290,7 +290,7 @@ msgid ""
"Down: %s"
msgstr ""

#: ../applets/gtop/gtop.vala:73 ../applets/gtop/gtop.vala:236
#: ../applets/gtop/gtop.vala:73 ../applets/gtop/gtop.vala:261
msgid "Vala Panel Netload Applet"
msgstr ""

Expand All @@ -302,27 +302,95 @@ msgstr ""
msgid "Reload network interfaces"
msgstr ""

#: ../applets/gtop/gtop.vala:200
#: ../applets/gtop/gtop.vala:96
msgid "b"
msgstr ""

#: ../applets/gtop/gtop.vala:97 ../applets/gtop/gtop.vala:98
msgid "B"
msgstr ""

#: ../applets/gtop/gtop.vala:103
msgid "kb"
msgstr ""

#: ../applets/gtop/gtop.vala:104
msgid "kB"
msgstr ""

#: ../applets/gtop/gtop.vala:105
msgid "KiB"
msgstr ""

#: ../applets/gtop/gtop.vala:110
msgid "Mb"
msgstr ""

#: ../applets/gtop/gtop.vala:111
msgid "MB"
msgstr ""

#: ../applets/gtop/gtop.vala:112
msgid "MiB"
msgstr ""

#: ../applets/gtop/gtop.vala:117
msgid "Gb"
msgstr ""

#: ../applets/gtop/gtop.vala:118
msgid "GB"
msgstr ""

#: ../applets/gtop/gtop.vala:119
msgid "GiB"
msgstr ""

#: ../applets/gtop/gtop.vala:124
msgid "Tb"
msgstr ""

#: ../applets/gtop/gtop.vala:125
msgid "TB"
msgstr ""

#: ../applets/gtop/gtop.vala:126
msgid "TiB"
msgstr ""

#: ../applets/gtop/gtop.vala:131
msgid "Pb"
msgstr ""

#: ../applets/gtop/gtop.vala:132
msgid "PB"
msgstr ""

#: ../applets/gtop/gtop.vala:133
msgid "PiB"
msgstr ""

#: ../applets/gtop/gtop.vala:225
msgid "All"
msgstr ""

#: ../applets/gtop/gtop.vala:212
#: ../applets/gtop/gtop.vala:237
msgid "Netload Applet"
msgstr ""

#: ../applets/gtop/gtop.vala:219
#: ../applets/gtop/gtop.vala:244
msgid "Interfaces"
msgstr ""

#: ../applets/gtop/gtop.vala:226
#: ../applets/gtop/gtop.vala:251
msgid "Down"
msgstr ""

#: ../applets/gtop/gtop.vala:230
#: ../applets/gtop/gtop.vala:255
msgid "Up"
msgstr ""

#: ../applets/gtop/gtop.vala:237
#: ../applets/gtop/gtop.vala:262
msgid "Simple LibGTop based network indicator."
msgstr ""

Expand Down

0 comments on commit a50a288

Please sign in to comment.