diff options
author | Satoru SATOH <ssato@redhat.com> | 2009-07-10 12:05:05 -0300 |
---|---|---|
committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2009-07-10 12:05:05 -0300 |
commit | c2899a358ef2f5c106c058ccce05046e31f1a2ab (patch) | |
tree | cf7862d5232373232d07831083c30d9a8d94f385 | |
parent | 21d308c37a3a764f6aded0efbfb8d30228e44ad6 (diff) | |
download | tuna-c2899a358ef2f5c106c058ccce05046e31f1a2ab.tar.gz |
tuna: Use gettext and add a japanese translation
Patch and translation contributed by Satoru SATOH <ssato@redhat.com>
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
-rw-r--r-- | MANIFEST | 5 | ||||
-rw-r--r-- | Makefile | 6 | ||||
-rw-r--r-- | po/POTFILES.in | 13 | ||||
-rw-r--r-- | po/ja.po | 347 | ||||
-rw-r--r-- | po/tuna.pot | 322 | ||||
-rw-r--r-- | rpm/SPECS/tuna.spec | 9 | ||||
-rwxr-xr-x | tuna-cmd.py | 31 | ||||
-rw-r--r-- | tuna/gui/cpuview.py | 22 | ||||
-rw-r--r-- | tuna/gui/irqview.py | 31 | ||||
-rw-r--r-- | tuna/gui/procview.py | 55 | ||||
-rw-r--r-- | tuna/gui/util.py | 18 | ||||
-rwxr-xr-x | tuna/tuna.py | 8 | ||||
-rw-r--r-- | tuna/tuna_gui.py | 6 |
13 files changed, 792 insertions, 81 deletions
@@ -10,6 +10,11 @@ tuna/gui/__init__.py tuna/gui/cpuview.py tuna/gui/irqview.py tuna/gui/procview.py +tuna/gui/util.py setup.py rpm/SPECS/tuna.spec MANIFEST +po/LINGUAS +po/POTFILES.in +po/ja.po +po/tuna.pot @@ -22,6 +22,12 @@ bz2dev: rpmdirs rpmdev: bz2dev rpmdirs rpmbuild -ba --define "_topdir $(PWD)/rpm" rpm/SPECS/$(PACKAGE).spec +po/$(PACKAGE).pot: + xgettext -k_ -kN_ -f po/POTFILES.in -o $@ + +po/%.po: po/$(PACKAGE).pot + msgmerge --suffix=.old -U $@ $< && rm -f $@.old + rpmclean: @rm -f rpm/RPMS/*/$(PACKAGE)-$(VERSION)-*.rpm @rm -f rpm/SRPMS/$(PACKAGE)-$(VERSION)-*.src.rpm diff --git a/po/POTFILES.in b/po/POTFILES.in new file mode 100644 index 0000000..7dbf267 --- /dev/null +++ b/po/POTFILES.in @@ -0,0 +1,13 @@ +tuna/__init__.py +tuna/tuna_gui.glade +tuna/tuna_gui.py +tuna/sysfs.py +tuna/oscilloscope.py +tuna/tuna.py +tuna/gui/__init__.py +tuna/gui/util.py +tuna/gui/cpuview.py +tuna/gui/procview.py +tuna/gui/irqview.py +tuna-cmd.py +oscilloscope-cmd.py diff --git a/po/ja.po b/po/ja.po new file mode 100644 index 0000000..f2af29f --- /dev/null +++ b/po/ja.po @@ -0,0 +1,347 @@ +# Japanese message translations for tuna +# Copyright (C) 2009 THE tuna'S COPYRIGHT HOLDER +# This file is distributed under the same license as the tuna package. +# Satoru Satoh <ssato@redhat.com>, 2009. +# +msgid "" +msgstr "" +"Project-Id-Version: tuna 0.8.4\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2009-07-09 20:04+0900\n" +"PO-Revision-Date: 2009-07-09 21:43+0900\n" +"Last-Translator: Satoru SATOH <ssato@redhat.com>\n" +"Language-Team: Japanese <LL@li.org>\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=utf-8\n" +"Content-Transfer-Encoding: 8bit\n" + +#: tuna/tuna_gui.glade:8 +msgid "Tuna" +msgstr "Tuna" + +#: tuna/tuna_gui.glade:111 +msgid "Set Process Attributes" +msgstr "プロセス属性を設定" + +#: tuna/tuna_gui.glade:140 +msgid "_Just the selected thread" +msgstr "選択したスレッドのみ(_J)" + +#: tuna/tuna_gui.glade:155 +msgid "_All threads of the selected process" +msgstr "選択したプロセスのすべてのスレッド(_A)" + +#: tuna/tuna_gui.glade:172 +msgid "A_ll command lines matching the regex below:" +msgstr "正規表現にマッチするすべてのコマンドライン(_L)" + +#: tuna/tuna_gui.glade:190 +msgid "<b>Set for these processes</b>" +msgstr "<b>これらのプロセス群に設定</b>" + +#: tuna/tuna_gui.glade:210 +msgid "_Policy: " +msgstr "ポリシー(_P): " + +#: tuna/tuna_gui.glade:241 +msgid "_Scheduler priority:" +msgstr "スケジューラポリシー(_S):" + +#: tuna/tuna_gui.glade:277 +msgid "A_ffinity:" +msgstr "アフィニティ(_F):" + +#: tuna/tuna_gui.glade:324 +msgid "Command line rege_x:" +msgstr "コマンドラインの正規表現(_X):" + +#: tuna/tuna_gui.glade:412 +msgid "Set IRQ Attributes" +msgstr "IRQ の属性を設定" + +#: tuna/tuna_gui.glade:488 +msgid "A_ffinity" +msgstr "アフィニティ(_F)" + +#: tuna/tuna_gui.glade:503 +msgid "_Scheduler priority" +msgstr "スケジューラポリシー(_S)" + +#: tuna/tuna_gui.glade:518 +msgid "_Policy" +msgstr "ポリシー(_P)" + +#: tuna/tuna_gui.glade:538 +msgid "<b>Set attributes for this IRQ:</b>" +msgstr "<b>この IRQ の属性を設定:</b>" + +#: tuna/tuna_gui.py:102 +msgid "" +"Root privilege required\n" +"\n" +msgstr "" +"root 権限が必要です\n" +"\n" + +#: tuna/tuna.py:48 +#, python-format +msgid "Kernel Thread %(pid)d (%(cmdline)s):" +msgstr "カーネルスレッド %(pid)d (%(cmdline)s):" + +#: tuna/tuna.py:51 +#, python-format +msgid "User Thread %(pid)d (%(cmdline)s):" +msgstr "ユーザースレッド %(pid)d (%(cmdline)s):" + +#: tuna/tuna.py:204 tuna/tuna.py:227 +#, python-format +msgid "move_threads_to_cpu: could not change pid %d affinity to %s" +msgstr "move_threads_to_cpu: PID %d のアフィニティを %s に変更できませんでした" + +#: tuna/gui/util.py:50 +msgid "Invalid affinity, specify a list of CPUs!" +msgstr "不正なアフィニティです。CPU のリストを指定して下さい!" + +#: tuna/gui/util.py:69 +msgid "Invalid parameters!" +msgstr "不正なパラメータです!" + +#: tuna/gui/util.py:76 +#, python-format +msgid "" +"couldn't change pid %(pid)d from %(cpol)s(%(cpri)d) to %(npol)s(%(npri)d)!" +msgstr "PID %(pid)d について %(cpol)s(%(cpri)d) から %(npol)s(%(npri)d) に" +"変更できませんでした!" + +#: tuna/gui/util.py:110 +#, python-format +msgid "couldn't change pid %(pid)d from %(caff)s to %(naff)s!" +msgstr "PID %(pid)d について %(caff)s から %(naff)s に変更できませんでした!" + +#: tuna/gui/cpuview.py:16 +#, python-format +msgid "Couldn't change the affinity of %d to %s!" +msgstr "%d のアフィニティを %s に変更できませんでした!" + +#: tuna/gui/cpuview.py:47 +#, python-format +msgid "Socket %s" +msgstr "ソケット %s" + +#: tuna/gui/cpuview.py:65 +msgid "Filter" +msgstr "フィルタ" + +#: tuna/gui/cpuview.py:69 +msgid "CPU" +msgstr "CPU" + +#: tuna/gui/cpuview.py:75 tuna/gui/cpuview.py:79 +msgid "Usage" +msgstr "消費率" + +#: tuna/gui/cpuview.py:198 +msgid "I_nclude CPU" +msgstr "CPU を含める(_N)" + +#: tuna/gui/cpuview.py:199 +msgid "_Isolate CPU" +msgstr "" + +#: tuna/gui/cpuview.py:201 +msgid "I_nclude CPU Socket" +msgstr "CPU ソケットを含める(_N)" + +#: tuna/gui/cpuview.py:202 +msgid "_Isolate CPU Socket" +msgstr "" + +#: tuna/gui/cpuview.py:203 +msgid "_Restore CPU" +msgstr "" + +#: tuna/gui/procview.py:196 tuna/gui/procview.py:216 tuna/gui/irqview.py:119 +msgid "PID" +msgstr "PID" + +#: tuna/gui/procview.py:197 tuna/gui/procview.py:217 tuna/gui/irqview.py:120 +msgid "Policy" +msgstr "ポリシー" + +#: tuna/gui/procview.py:198 tuna/gui/procview.py:218 tuna/gui/irqview.py:121 +msgid "Priority" +msgstr "優先度" + +#: tuna/gui/procview.py:199 tuna/gui/procview.py:219 tuna/gui/irqview.py:122 +#: tuna/gui/irqview.py:141 +msgid "Affinity" +msgstr "アフィニティ" + +#: tuna/gui/procview.py:200 +msgid "VolCtxtSwitch" +msgstr "VolCtxtSwitch" + +#: tuna/gui/procview.py:201 +msgid "NonVolCtxtSwitch" +msgstr "NonVolCtxtSwitch" + +#: tuna/gui/procview.py:202 tuna/gui/procview.py:220 +msgid "Command Line" +msgstr "コマンドライン" + +#: tuna/gui/procview.py:286 +#, python-format +msgid "" +"<b>Kernel Thread %d (%s):</b>\n" +"%s%s" +msgstr "<b>カーネルスレッド %d %s):</b>\n%s%s" + +#: tuna/gui/procview.py:472 +msgid "Save As" +msgstr "名前を付けて保存" + +#: tuna/gui/procview.py:530 +#, python-format +msgid "Kernel thread tunings saved to %s!" +msgstr "カーネルスレッド設定を %s に保存しました!" + +#: tuna/gui/procview.py:543 +msgid "_Set process attributes" +msgstr "プロセス属性を設定(_S)" + +#: tuna/gui/procview.py:545 +msgid "Sto_p refreshing the process list" +msgstr "プロセスリストの更新を停止(_P)" + +#: tuna/gui/procview.py:547 +msgid "_Refresh the process list" +msgstr "プロセスリストを更新(_R)" + +#: tuna/gui/procview.py:550 +msgid "_Hide kernel threads" +msgstr "カーネルスレッドを隠す(_H)" + +#: tuna/gui/procview.py:552 +msgid "_Show kernel threads" +msgstr "カーネルスレッドを表示(_S)" + +#: tuna/gui/procview.py:555 +msgid "_Hide user threads" +msgstr "ユーザースレッドを隠す(_H)" + +#: tuna/gui/procview.py:557 +msgid "_Show user threads" +msgstr "ユーザースレッドを表示(_S)" + +#: tuna/gui/procview.py:559 +msgid "_What is this?" +msgstr "これは何?(_W)" + +#: tuna/gui/procview.py:561 +msgid "_Save kthreads tunings" +msgstr "カーネルスレッド設定を保存(_S)" + +#: tuna/gui/irqview.py:118 tuna/gui/irqview.py:140 +msgid "IRQ" +msgstr "IRQ" + +#: tuna/gui/irqview.py:123 tuna/gui/irqview.py:142 +msgid "Events" +msgstr "Events" + +#: tuna/gui/irqview.py:124 tuna/gui/irqview.py:143 +msgid "Users" +msgstr "Users" + +#: tuna/gui/irqview.py:287 +msgid "_Set IRQ attributes" +msgstr "IRQ の属性を設定(_S)" + +#: tuna/gui/irqview.py:289 +msgid "Sto_p refreshing the IRQ list" +msgstr "IRQ リストの更新を停止(_P)" + +#: tuna/gui/irqview.py:291 +msgid "_Refresh the IRQ list" +msgstr "IRQ リストを更新(_R)" + +#: tuna-cmd.py:37 +msgid "" +"Usage: tuna [OPTIONS]\n" +"\t-h, --help\t\t\tGive this help list\n" +"\t-g, --gui\t\t\tStart the GUI\n" +"\t-c, --cpus=CPU-LIST\t\tCPU-LIST affected by commands\n" +"\t-C, --affect_children\t\tOperation will affect children threads\n" +"\t-f, --filter\t\t\tDisplay filter the selected entities\n" +"\t-i, --isolate\t\t\tMove all threads away from CPU-LIST\n" +"\t-I, --include\t\t\tAllow all threads to run on CPU-LIST\n" +"\t-K, --no_kthreads\t\tOperations will not affect kernel threads\n" +"\t-m, --move\t\t\tmove selected entities to CPU-LIST\n" +"\t-p, --priority=[POLICY]:RTPRIO\tset thread scheduler POLICY and RTPRIO\n" +"\t-P, --show_threads\t\tshow thread list\n" +"\t-q, --irqs=IRQ-LIST\t\tIRQ-LIST affected by commands\n" +"\t-s, --save=FILENAME\t\tsave kthreads sched tunables to FILENAME\n" +"\t-S, --sockets=CPU-SOCKET-LIST CPU-SOCKET-LIST affected by commands\n" +"\t-t, --threads=THREAD-LIST\tTHREAD-LIST affected by commands\n" +"\t-U, --no_uthreads\t\tOperations will not affect user threads\n" +"\t-v, --version\t\t\tshow version\n" +"\t-W, --what_is\t\t\tProvides help about selected entities\n" +"\t-x, --spread\t\t\tspread selected entities over CPU-LIST" +msgstr "" +"使い方: tuna [OPTIONS]\n" +"\t-h, --help\t\t\tこのヘルプリストを表示\n" +"\t-g, --gui\t\t\tGUI を起動\n" +"\t-c, --cpus=CPU-LIST\t\tコマンドの対象とする CPU-LIST を指定\n" +"\t-C, --affect_children\t\t子のスレッドにも操作の影響が及ぶようにする\n" +"\t-f, --filter\t\t\tDisplay filter the selected entities\n" +"\t-i, --isolate\t\t\tCPU-LIST からすべてのスレッドを移動\n" +"\t-I, --include\t\t\tCPU-LIST でのすべてのスレッドの実行を許可\n" +"\t-K, --no_kthreads\t\tカーネルスレッドを操作の対象から外す\n" +"\t-m, --move\t\t\t選択したエンティティを CPU-LIST に移動\n" +"\t-p, --priority=[POLICY]:RTPRIO\tスレッドスケジューラ POLICY と RTPRIO を設" +"定\n" +"\t-P, --show_threads\t\tスレッドリストを表示\n" +"\t-q, --irqs=IRQ-LIST\t\tコマンドの対象とする IRQ-LIST を指定\n" +"\t-s, --save=FILENAME\t\tカーネルスレッドのスケジューラ設定を FILENAME に保" +"存\n" +"\t-S, --sockets=CPU-SOCKET-LIST コマンドの対象とする CPU-SOCKET-LIST を指" +"定\n" +"\t-t, --threads=THREAD-LIST\tコマンドの対象とする THREAD-LIST を指定\n" +"\t-U, --no_uthreads\t\tユーザースレッドを操作の対象から外す\n" +"\t-v, --version\t\t\tバージョンを表示\n" +"\t-W, --what_is\t\t\t選択したエンティティのヘルプを表示\n" +"\t-x, --spread\t\t\t選択したエンティティを CPU-LIST に展開" + +#: tuna-cmd.py:71 +#, python-format +msgid "tuna: thread %d doesn't exists!" +msgstr "tuna: スレッド %d は存在しません!" + +#: tuna-cmd.py:90 +msgid "thread" +msgstr "スレッド" + +#: tuna-cmd.py:314 +msgid "tuna: --isolate requires a cpu list!" +msgstr "tuna: --isolate には CPU リストが必要です!" + +#: tuna-cmd.py:319 +msgid "tuna: --include requires a cpu list!" +msgstr "tuna: --include には CPU リストが必要です!" + +#: tuna-cmd.py:334 +msgid "tuna: --move requires a cpu list!" +msgstr "tuna: --move には CPU リストが必要です!" + +#: tuna-cmd.py:337 +msgid "tuna: --move requires a list or threads/irqs!" +msgstr "tuna: --move にはリストかスレッド/IRQ が必要です!" + +#: tuna-cmd.py:362 +#, python-format +msgid "tuna: invalid socket %s, sockets available: %s" +msgstr "tuna: 不正なソケット %s, 利用可能なソケット: %s" + +#: tuna-cmd.py:387 +msgid "tuna: --what_is requires a thread list!" +msgstr "tuna: --what_is にはスレッドリストが必要です!" diff --git a/po/tuna.pot b/po/tuna.pot new file mode 100644 index 0000000..58b1e80 --- /dev/null +++ b/po/tuna.pot @@ -0,0 +1,322 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER +# This file is distributed under the same license as the PACKAGE package. +# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: PACKAGE VERSION\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2009-07-09 20:04+0900\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" +"Language-Team: LANGUAGE <LL@li.org>\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=CHARSET\n" +"Content-Transfer-Encoding: 8bit\n" + +#: tuna/tuna_gui.glade:8 +msgid "Tuna" +msgstr "" + +#: tuna/tuna_gui.glade:111 +msgid "Set Process Attributes" +msgstr "" + +#: tuna/tuna_gui.glade:140 +msgid "_Just the selected thread" +msgstr "" + +#: tuna/tuna_gui.glade:155 +msgid "_All threads of the selected process" +msgstr "" + +#: tuna/tuna_gui.glade:172 +msgid "A_ll command lines matching the regex below:" +msgstr "" + +#: tuna/tuna_gui.glade:190 +msgid "<b>Set for these processes</b>" +msgstr "" + +#: tuna/tuna_gui.glade:210 +msgid "_Policy: " +msgstr "" + +#: tuna/tuna_gui.glade:241 +msgid "_Scheduler priority:" +msgstr "" + +#: tuna/tuna_gui.glade:277 +msgid "A_ffinity:" +msgstr "" + +#: tuna/tuna_gui.glade:324 +msgid "Command line rege_x:" +msgstr "" + +#: tuna/tuna_gui.glade:412 +msgid "Set IRQ Attributes" +msgstr "" + +#: tuna/tuna_gui.glade:488 +msgid "A_ffinity" +msgstr "" + +#: tuna/tuna_gui.glade:503 +msgid "_Scheduler priority" +msgstr "" + +#: tuna/tuna_gui.glade:518 +msgid "_Policy" +msgstr "" + +#: tuna/tuna_gui.glade:538 +msgid "<b>Set attributes for this IRQ:</b>" +msgstr "" + +#: tuna/tuna_gui.py:102 +msgid "" +"Root privilege required\n" +"\n" +msgstr "" + +#: tuna/tuna.py:48 +#, python-format +msgid "Kernel Thread %(pid)d (%(cmdline)s):" +msgstr "" + +#: tuna/tuna.py:51 +#, python-format +msgid "User Thread %(pid)d (%(cmdline)s):" +msgstr "" + +#: tuna/tuna.py:204 tuna/tuna.py:227 +#, python-format +msgid "move_threads_to_cpu: could not change pid %d affinity to %s" +msgstr "" + +#: tuna/gui/util.py:50 +msgid "Invalid affinity, specify a list of CPUs!" +msgstr "" + +#: tuna/gui/util.py:69 +msgid "Invalid parameters!" +msgstr "" + +#: tuna/gui/util.py:76 +#, python-format +msgid "" +"couldn't change pid %(pid)d from %(cpol)s(%(cpri)d) to %(npol)s(%(npri)d)!" +msgstr "" + +#: tuna/gui/util.py:110 +#, python-format +msgid "couldn't change pid %(pid)d from %(caff)s to %(naff)s!" +msgstr "" + +#: tuna/gui/cpuview.py:16 +#, python-format +msgid "Couldn't change the affinity of %d to %s!" +msgstr "" + +#: tuna/gui/cpuview.py:47 +#, python-format +msgid "Socket %s" +msgstr "" + +#: tuna/gui/cpuview.py:65 +msgid "Filter" +msgstr "" + +#: tuna/gui/cpuview.py:69 +msgid "CPU" +msgstr "" + +#: tuna/gui/cpuview.py:75 tuna/gui/cpuview.py:79 +msgid "Usage" +msgstr "" + +#: tuna/gui/cpuview.py:198 +msgid "I_nclude CPU" +msgstr "" + +#: tuna/gui/cpuview.py:199 +msgid "_Isolate CPU" +msgstr "" + +#: tuna/gui/cpuview.py:201 +msgid "I_nclude CPU Socket" +msgstr "" + +#: tuna/gui/cpuview.py:202 +msgid "_Isolate CPU Socket" +msgstr "" + +#: tuna/gui/cpuview.py:203 +msgid "_Restore CPU" +msgstr "" + +#: tuna/gui/procview.py:196 tuna/gui/procview.py:216 tuna/gui/irqview.py:119 +msgid "PID" +msgstr "" + +#: tuna/gui/procview.py:197 tuna/gui/procview.py:217 tuna/gui/irqview.py:120 +msgid "Policy" +msgstr "" + +#: tuna/gui/procview.py:198 tuna/gui/procview.py:218 tuna/gui/irqview.py:121 +msgid "Priority" +msgstr "" + +#: tuna/gui/procview.py:199 tuna/gui/procview.py:219 tuna/gui/irqview.py:122 +#: tuna/gui/irqview.py:141 +msgid "Affinity" +msgstr "" + +#: tuna/gui/procview.py:200 +msgid "VolCtxtSwitch" +msgstr "" + +#: tuna/gui/procview.py:201 +msgid "NonVolCtxtSwitch" +msgstr "" + +#: tuna/gui/procview.py:202 tuna/gui/procview.py:220 +msgid "Command Line" +msgstr "" + +#: tuna/gui/procview.py:286 +#, python-format +msgid "" +"<b>Kernel Thread %d (%s):</b>\n" +"%s%s" +msgstr "" + +#: tuna/gui/procview.py:472 +msgid "Save As" +msgstr "" + +#: tuna/gui/procview.py:530 +#, python-format +msgid "Kernel thread tunings saved to %s!" +msgstr "" + +#: tuna/gui/procview.py:543 +msgid "_Set process attributes" +msgstr "" + +#: tuna/gui/procview.py:545 +msgid "Sto_p refreshing the process list" +msgstr "" + +#: tuna/gui/procview.py:547 +msgid "_Refresh the process list" +msgstr "" + +#: tuna/gui/procview.py:550 +msgid "_Hide kernel threads" +msgstr "" + +#: tuna/gui/procview.py:552 +msgid "_Show kernel threads" +msgstr "" + +#: tuna/gui/procview.py:555 +msgid "_Hide user threads" +msgstr "" + +#: tuna/gui/procview.py:557 +msgid "_Show user threads" +msgstr "" + +#: tuna/gui/procview.py:559 +msgid "_What is this?" +msgstr "" + +#: tuna/gui/procview.py:561 +msgid "_Save kthreads tunings" +msgstr "" + +#: tuna/gui/irqview.py:118 tuna/gui/irqview.py:140 +msgid "IRQ" +msgstr "" + +#: tuna/gui/irqview.py:123 tuna/gui/irqview.py:142 +msgid "Events" +msgstr "" + +#: tuna/gui/irqview.py:124 tuna/gui/irqview.py:143 +msgid "Users" +msgstr "" + +#: tuna/gui/irqview.py:287 +msgid "_Set IRQ attributes" +msgstr "" + +#: tuna/gui/irqview.py:289 +msgid "Sto_p refreshing the IRQ list" +msgstr "" + +#: tuna/gui/irqview.py:291 +msgid "_Refresh the IRQ list" +msgstr "" + +#: tuna-cmd.py:37 +msgid "" +"Usage: tuna [OPTIONS]\n" +"\t-h, --help\t\t\tGive this help list\n" +"\t-g, --gui\t\t\tStart the GUI\n" +"\t-c, --cpus=CPU-LIST\t\tCPU-LIST affected by commands\n" +"\t-C, --affect_children\t\tOperation will affect children threads\n" +"\t-f, --filter\t\t\tDisplay filter the selected entities\n" +"\t-i, --isolate\t\t\tMove all threads away from CPU-LIST\n" +"\t-I, --include\t\t\tAllow all threads to run on CPU-LIST\n" +"\t-K, --no_kthreads\t\tOperations will not affect kernel threads\n" +"\t-m, --move\t\t\tmove selected entities to CPU-LIST\n" +"\t-p, --priority=[POLICY]:RTPRIO\tset thread scheduler POLICY and RTPRIO\n" +"\t-P, --show_threads\t\tshow thread list\n" +"\t-q, --irqs=IRQ-LIST\t\tIRQ-LIST affected by commands\n" +"\t-s, --save=FILENAME\t\tsave kthreads sched tunables to FILENAME\n" +"\t-S, --sockets=CPU-SOCKET-LIST CPU-SOCKET-LIST affected by commands\n" +"\t-t, --threads=THREAD-LIST\tTHREAD-LIST affected by commands\n" +"\t-U, --no_uthreads\t\tOperations will not affect user threads\n" +"\t-v, --version\t\t\tshow version\n" +"\t-W, --what_is\t\t\tProvides help about selected entities\n" +"\t-x, --spread\t\t\tspread selected entities over CPU-LIST" +msgstr "" + +#: tuna-cmd.py:71 +#, python-format +msgid "tuna: thread %d doesn't exists!" +msgstr "" + +#: tuna-cmd.py:90 +msgid "thread" +msgstr "" + +#: tuna-cmd.py:314 +msgid "tuna: --isolate requires a cpu list!" +msgstr "" + +#: tuna-cmd.py:319 +msgid "tuna: --include requires a cpu list!" +msgstr "" + +#: tuna-cmd.py:334 +msgid "tuna: --move requires a cpu list!" +msgstr "" + +#: tuna-cmd.py:337 +msgid "tuna: --move requires a list or threads/irqs!" +msgstr "" + +#: tuna-cmd.py:362 +#, python-format +msgid "tuna: invalid socket %s, sockets available: %s" +msgstr "" + +#: tuna-cmd.py:387 +msgid "tuna: --what_is requires a thread list!" +msgstr "" diff --git a/rpm/SPECS/tuna.spec b/rpm/SPECS/tuna.spec index e74f49f..270f595 100644 --- a/rpm/SPECS/tuna.spec +++ b/rpm/SPECS/tuna.spec @@ -56,6 +56,14 @@ install -m755 tuna-cmd.py %{buildroot}/%{_bindir}/tuna install -m755 oscilloscope-cmd.py %{buildroot}/%{_bindir}/oscilloscope install -m644 help/kthreads/* %{buildroot}/%{_datadir}/tuna/help/kthreads/ +# l10n-ed message catalogues +for lng in `cat po/LINGUAS`; do + po=po/"$lng.po" + mkdir -p %{buildroot}/%{_datadir}/locale/${lng}/LC_MESSAGES + msgfmt $po -o %{buildroot}/%{_datadir}/locale/${lng}/LC_MESSAGES/tuna.mo +done + + %clean rm -rf %{buildroot} @@ -67,6 +75,7 @@ rm -rf %{buildroot} %dir %{_datadir}/tuna/help %dir %{_datadir}/tuna/help/kthreads/ %{_datadir}/tuna/help/kthreads/* +%{_datadir}/locale/*/LC_MESSAGES/*.mo %{python_sitelib}/tuna/ %if "%{python_ver}" >= "2.5" %{python_sitelib}/*.egg-info diff --git a/tuna-cmd.py b/tuna-cmd.py index 8432f11..2fbc4e9 100755 --- a/tuna-cmd.py +++ b/tuna-cmd.py @@ -17,6 +17,9 @@ import getopt, ethtool, fnmatch, inet_diag, os, procfs, re, schedutils, sys from tuna import tuna, sysfs +import gettext +import locale + try: from sets import Set as set except: @@ -31,7 +34,7 @@ irqs = None version = "0.9" def usage(): - print '''Usage: tuna [OPTIONS] + print _('''Usage: tuna [OPTIONS] -h, --help Give this help list -g, --gui Start the GUI -c, --cpus=CPU-LIST CPU-LIST affected by commands @@ -51,7 +54,7 @@ def usage(): -U, --no_uthreads Operations will not affect user threads -v, --version show version -W, --what_is Provides help about selected entities - -x, --spread spread selected entities over CPU-LIST''' + -x, --spread spread selected entities over CPU-LIST''') def get_nr_cpus(): global nr_cpus @@ -66,7 +69,7 @@ def thread_help(tid): ps = procfs.pidstats() if not ps.has_key(tid): - print "tuna: thread %d doesn't exists!" % tid + print _("tuna: thread %d doesn't exists!") % tid return pinfo = ps[tid] @@ -85,7 +88,7 @@ def save(cpu_list, thread_list, filename): def ps_show_header(has_ctxt_switch_info): print "%7s %6s %5s %7s %s" % \ - (" ", " ", " ", "thread", + (" ", " ", " ", _("thread"), has_ctxt_switch_info and "ctxt_switches" or "") print "%7s %6s %5s %7s%s %15s" % \ ("pid", "SCHED_", "rtpri", "affinity", @@ -304,7 +307,15 @@ def pick_op(argument): return (argument[0], argument[1:]) return (None, argument) +def i18n_init(): + (app, localedir) = ('tuna', '/usr/share/locale') + locale.setlocale(locale.LC_ALL, '') + gettext.bindtextdomain(app, localedir) + gettext.textdomain(app) + gettext.install(app, localedir) + def main(): + i18n_init() try: opts, args = getopt.getopt(sys.argv[1:], "c:CfghiIKmnp:Pq:s:S:t:UvWx", @@ -365,12 +376,12 @@ def main(): run_gui = True elif o in ("-i", "--isolate"): if not cpu_list: - print "tuna: --isolate requires a cpu list!" + print _("tuna: --isolate requires a cpu list!") sys.exit(2) tuna.isolate_cpus(cpu_list, get_nr_cpus()) elif o in ("-I", "--include"): if not cpu_list: - print "tuna: --include requires a cpu list!" + print _("tuna: --include requires a cpu list!") sys.exit(2) tuna.include_cpus(cpu_list, get_nr_cpus()) elif o in ("-p", "--priority"): @@ -387,10 +398,10 @@ def main(): show_sockets = True elif o in ("-m", "--move", "-x", "--spread"): if not cpu_list: - print "tuna: --move requires a cpu list!" + print _("tuna: --move requires a cpu list!") sys.exit(2) if not (thread_list or irq_list): - print "tuna: --move requires a list or threads/irqs!" + print _("tuna: --move requires a list or threads/irqs!") sys.exit(2) spread = o in ("-x", "--spread") @@ -415,7 +426,7 @@ def main(): op_list = [] for socket in sockets: if not cpu_info.sockets.has_key(socket): - print "tuna: invalid socket %s, sockets available: %s" % \ + print _("tuna: invalid socket %s, sockets available: %s") % \ (socket, ", ".join(cpu_info.sockets.keys())) sys.exit(2) @@ -440,7 +451,7 @@ def main(): print version elif o in ("-W", "--what_is"): if not thread_list: - print "tuna: --what_is requires a thread list!" + print _("tuna: --what_is requires a thread list!") sys.exit(2) for tid in thread_list: thread_help(tid) diff --git a/tuna/gui/cpuview.py b/tuna/gui/cpuview.py index 09b1a8b..dff0709 100644 --- a/tuna/gui/cpuview.py +++ b/tuna/gui/cpuview.py @@ -13,7 +13,7 @@ def set_affinity_warning(tid, affinity): gtk.DIALOG_MODAL | gtk.DIALOG_DESTROY_WITH_PARENT, gtk.MESSAGE_WARNING, gtk.BUTTONS_OK, - "Couldn't change the affinity of %d to %s!" % \ + _("Couldn't change the affinity of %d to %s!") % \ (tid, affinity)) dialog.run() dialog.destroy() @@ -44,7 +44,7 @@ class cpu_socket_frame(gtk.Frame): def __init__(self, socket, cpus, creator): if creator.nr_sockets > 1: - gtk.Frame.__init__(self, "Socket %s" % socket) + gtk.Frame.__init__(self, _("Socket %s") % socket) else: gtk.Frame.__init__(self) @@ -62,21 +62,21 @@ class cpu_socket_frame(gtk.Frame): # Filter column renderer = gtk.CellRendererToggle() renderer.connect('toggled', self.filter_toggled, self.list_store) - column = gtk.TreeViewColumn('Filter', renderer, active = self.COL_FILTER) + column = gtk.TreeViewColumn(_('Filter'), renderer, active = self.COL_FILTER) self.treeview.append_column(column) # CPU# column - column = gtk.TreeViewColumn('CPU', gtk.CellRendererText(), + column = gtk.TreeViewColumn(_('CPU'), gtk.CellRendererText(), text = self.COL_CPU) self.treeview.append_column(column) # CPU usage column try: - column = gtk.TreeViewColumn('Usage', gtk.CellRendererProgress(), + column = gtk.TreeViewColumn(_('Usage'), gtk.CellRendererProgress(), text = self.COL_USAGE, value = self.COL_USAGE) except: # CellRendererProgress needs pygtk2 >= 2.6 - column = gtk.TreeViewColumn('Usage', gtk.CellRendererText(), + column = gtk.TreeViewColumn(_('Usage'), gtk.CellRendererText(), text = self.COL_USAGE) self.treeview.append_column(column) @@ -195,12 +195,12 @@ class cpu_socket_frame(gtk.Frame): menu = gtk.Menu() - include = gtk.MenuItem("I_nclude CPU") - isolate = gtk.MenuItem("_Isolate CPU") + include = gtk.MenuItem(_("I_nclude CPU")) + isolate = gtk.MenuItem(_("_Isolate CPU")) if self.creator.nr_sockets > 1: - include_socket = gtk.MenuItem("I_nclude CPU Socket") - isolate_socket = gtk.MenuItem("_Isolate CPU Socket") - restore = gtk.MenuItem("_Restore CPU") + include_socket = gtk.MenuItem(_("I_nclude CPU Socket")) + isolate_socket = gtk.MenuItem(_("_Isolate CPU Socket")) + restore = gtk.MenuItem(_("_Restore CPU")) menu.add(include) menu.add(isolate) diff --git a/tuna/gui/irqview.py b/tuna/gui/irqview.py index 52e27e2..4bdce64 100644 --- a/tuna/gui/irqview.py +++ b/tuna/gui/irqview.py @@ -14,7 +14,7 @@ class irq_druid: self.irqs = irqs self.ps = ps self.irq = irq - self.window = gtk.glade.XML(gladefile, "set_irq_attributes") + self.window = gtk.glade.XML(gladefile, "set_irq_attributes", "tuna") self.dialog = self.window.get_widget("set_irq_attributes") pixbuf = self.dialog.render_icon(gtk.STOCK_PREFERENCES, gtk.ICON_SIZE_SMALL_TOOLBAR) @@ -115,13 +115,13 @@ class irqview: nr_columns = 7 ( COL_NUM, COL_PID, COL_POL, COL_PRI, COL_AFF, COL_EVENTS, COL_USERS ) = range(nr_columns) - columns = (gui.list_store_column("IRQ"), - gui.list_store_column("PID", gobject.TYPE_INT), - gui.list_store_column("Policy", gobject.TYPE_STRING), - gui.list_store_column("Priority", gobject.TYPE_INT), - gui.list_store_column("Affinity", gobject.TYPE_STRING), - gui.list_store_column("Events"), - gui.list_store_column("Users", gobject.TYPE_STRING)) + columns = (gui.list_store_column(_("IRQ")), + gui.list_store_column(_("PID"), gobject.TYPE_INT), + gui.list_store_column(_("Policy"), gobject.TYPE_STRING), + gui.list_store_column(_("Priority"), gobject.TYPE_INT), + gui.list_store_column(_("Affinity"), gobject.TYPE_STRING), + gui.list_store_column(_("Events")), + gui.list_store_column(_("Users"), gobject.TYPE_STRING)) def __init__(self, treeview, irqs, ps, cpus_filtered, gladefile): @@ -137,10 +137,10 @@ class irqview: self.COL_AFF, self.COL_EVENTS, self.COL_USERS ) = range(self.nr_columns) - self.columns = (gui.list_store_column("IRQ"), - gui.list_store_column("Affinity", gobject.TYPE_STRING), - gui.list_store_column("Events"), - gui.list_store_column("Users", gobject.TYPE_STRING)) + self.columns = (gui.list_store_column(_("IRQ")), + gui.list_store_column(_("Affinity"), gobject.TYPE_STRING), + gui.list_store_column(_("Events")), + gui.list_store_column(_("Users"), gobject.TYPE_STRING)) self.list_store = gtk.ListStore(*gui.generate_list_store_columns_with_attr(self.columns)) @@ -284,12 +284,11 @@ class irqview: menu = gtk.Menu() - setattr = gtk.MenuItem("_Set IRQ attributes") + setattr = gtk.MenuItem(_("_Set IRQ attributes")) if self.refreshing: - refresh_prefix = "Sto_p refreshing the" + refresh = gtk.MenuItem(_("Sto_p refreshing the IRQ list")) else: - refresh_prefix = "_Refresh" - refresh = gtk.MenuItem(refresh_prefix + " IRQ list") + refresh = gtk.MenuItem(_("_Refresh the IRQ list")) menu.add(setattr) menu.add(refresh) diff --git a/tuna/gui/procview.py b/tuna/gui/procview.py index bfe2a86..2207f30 100644 --- a/tuna/gui/procview.py +++ b/tuna/gui/procview.py @@ -13,7 +13,7 @@ class process_druid: self.pid = pid self.nr_cpus = nr_cpus pid_info = self.ps[pid] - self.window = gtk.glade.XML(gladefile, "set_process_attributes") + self.window = gtk.glade.XML(gladefile, "set_process_attributes", "tuna") self.dialog = self.window.get_widget("set_process_attributes") pixbuf = self.dialog.render_icon(gtk.STOCK_PREFERENCES, gtk.ICON_SIZE_SMALL_TOOLBAR) @@ -193,13 +193,13 @@ class procview: nr_columns = 7 ( COL_PID, COL_POL, COL_PRI, COL_AFF, COL_VOLCTXT, COL_NONVOLCTXT, COL_CMDLINE ) = range(nr_columns) - columns = (gui.list_store_column("PID"), - gui.list_store_column("Policy", gobject.TYPE_STRING), - gui.list_store_column("Priority"), - gui.list_store_column("Affinity", gobject.TYPE_STRING), - gui.list_store_column("VolCtxtSwitch", gobject.TYPE_UINT), - gui.list_store_column("NonVolCtxtSwitch", gobject.TYPE_UINT), - gui.list_store_column("Command Line", gobject.TYPE_STRING)) + columns = (gui.list_store_column(_("PID")), + gui.list_store_column(_("Policy"), gobject.TYPE_STRING), + gui.list_store_column(_("Priority")), + gui.list_store_column(_("Affinity"), gobject.TYPE_STRING), + gui.list_store_column(_("VolCtxtSwitch"), gobject.TYPE_UINT), + gui.list_store_column(_("NonVolCtxtSwitch"), gobject.TYPE_UINT), + gui.list_store_column(_("Command Line"), gobject.TYPE_STRING)) def __init__(self, treeview, ps, show_kthreads, show_uthreads, @@ -213,11 +213,11 @@ class procview: self.nr_columns = 5 ( self.COL_PID, self.COL_POL, self.COL_PRI, self.COL_AFF, self.COL_CMDLINE ) = range(self.nr_columns) - self.columns = (gui.list_store_column("PID"), - gui.list_store_column("Policy", gobject.TYPE_STRING), - gui.list_store_column("Priority"), - gui.list_store_column("Affinity", gobject.TYPE_STRING), - gui.list_store_column("Command Line", gobject.TYPE_STRING)) + self.columns = (gui.list_store_column(_("PID")), + gui.list_store_column(_("Policy"), gobject.TYPE_STRING), + gui.list_store_column(_("Priority")), + gui.list_store_column(_("Affinity"), gobject.TYPE_STRING), + gui.list_store_column(_("Command Line"), gobject.TYPE_STRING)) self.tree_store = gtk.TreeStore(*gui.generate_list_store_columns_with_attr(self.columns)) self.treeview.set_model(self.tree_store) @@ -283,7 +283,7 @@ class procview: key = cmdline suffix_help = "" help = tuna.kthread_help(key) - tooltip.set_markup("<b>Kernel Thread %d (%s):</b>\n%s%s" % (pid, cmdline, help, suffix_help)) + tooltip.set_markup(_("<b>Kernel Thread %d (%s):</b>\n%s%s") % (pid, cmdline, help, suffix_help)) return True def foreach_selected_cb(self, model, path, iter, pid_list): @@ -469,7 +469,7 @@ class procview: self.refreshing = not self.refreshing def save_kthreads_tunings(self, a): - dialog = gtk.FileChooserDialog("Save As", + dialog = gtk.FileChooserDialog(_("Save As"), None, gtk.FILE_CHOOSER_ACTION_SAVE, (gtk.STOCK_CANCEL, gtk.RESPONSE_CANCEL, @@ -527,7 +527,7 @@ class procview: gtk.DIALOG_MODAL | gtk.DIALOG_DESTROY_WITH_PARENT, gtk.MESSAGE_INFO, gtk.BUTTONS_OK, - "Kernel thread tunings saved to %s!" % filename) + _("Kernel thread tunings saved to %s!") % filename) dialog.run() dialog.destroy() @@ -540,26 +540,25 @@ class procview: menu = gtk.Menu() - setattr = gtk.MenuItem("_Set process attributes") + setattr = gtk.MenuItem(_("_Set process attributes")) if self.refreshing: - refresh_prefix = "Sto_p refreshing the" + refresh = gtk.MenuItem(_("Sto_p refreshing the process list")) else: - refresh_prefix = "_Refresh the " - refresh = gtk.MenuItem(refresh_prefix + " process list") + refresh = gtk.MenuItem(_("_Refresh the process list")) + if self.show_kthreads: - kthreads_prefix = "_Hide" + kthreads = gtk.MenuItem(_("_Hide kernel threads")) else: - kthreads_prefix = "_Show" - kthreads = gtk.MenuItem(kthreads_prefix + " kernel threads") + kthreads = gtk.MenuItem(_("_Show kernel threads")) + if self.show_uthreads: - uthreads_prefix = "_Hide" + uthreads = gtk.MenuItem(_("_Hide user threads")) else: - uthreads_prefix = "_Show" - uthreads = gtk.MenuItem(uthreads_prefix + " user threads") + uthreads = gtk.MenuItem(_("_Show user threads")) - help = gtk.MenuItem("_What is this?") + help = gtk.MenuItem(_("_What is this?")) - save_kthreads_tunings = gtk.MenuItem("_Save kthreads tunings") + save_kthreads_tunings = gtk.MenuItem(_("_Save kthreads tunings")) menu.add(save_kthreads_tunings) menu.add(setattr) diff --git a/tuna/gui/util.py b/tuna/gui/util.py index 6ea9a63..7c01a14 100644 --- a/tuna/gui/util.py +++ b/tuna/gui/util.py @@ -47,7 +47,7 @@ def invalid_affinity(): gtk.DIALOG_MODAL | gtk.DIALOG_DESTROY_WITH_PARENT, gtk.MESSAGE_WARNING, gtk.BUTTONS_OK, - "Invalid affinity, specify a list of CPUs!") + _("Invalid affinity, specify a list of CPUs!")) dialog.run() dialog.destroy() return False @@ -66,18 +66,18 @@ def thread_set_attributes(pid, threads, new_policy, new_prio, new_affinity, nr_c gtk.DIALOG_MODAL | gtk.DIALOG_DESTROY_WITH_PARENT, gtk.MESSAGE_WARNING, gtk.BUTTONS_OK, - "Invalid parameters!") + _("Invalid parameters!")) dialog.run() dialog.destroy() return False curr_policy = schedutils.get_scheduler(pid) if curr_policy != new_policy: - print "couldn't change pid %d from %s(%d) to %s(%d)!" % \ - ( pid, schedutils.schedstr(curr_policy), - curr_prio, - schedutils.schedstr(new_policy), - new_prio) + print _("couldn't change pid %(pid)d from %(cpol)s(%(cpri)d) to %(npol)s(%(npri)d)!") % \ + { 'pid': pid, 'cpol': schedutils.schedstr(curr_policy), + 'cpri': curr_prio, + 'npol': schedutils.schedstr(new_policy), + 'npri': new_prio} else: changed = True @@ -107,8 +107,8 @@ def thread_set_attributes(pid, threads, new_policy, new_prio, new_affinity, nr_c except SystemError: # (3, 'No such process') return False if curr_affinity != new_affinity: - print "couldn't change pid %d from %s to %s!" % \ - ( pid, curr_affinity, new_affinity ) + print _("couldn't change pid %(pid)d from %(caff)s to %(naff)s!") % \ + { 'pid':pid, 'caff':curr_affinity, 'naff':new_affinity } else: changed = True diff --git a/tuna/tuna.py b/tuna/tuna.py index 46c2d46..ff9540c 100755 --- a/tuna/tuna.py +++ b/tuna/tuna.py @@ -45,10 +45,10 @@ def kthread_help_plain_text(pid, cmdline): key = cmdline suffix_help = "" help = kthread_help(key) - title = "Kernel Thread %d (%s):" % (pid, cmdline) + title = _("Kernel Thread %(pid)d (%(cmdline)s):") % {'pid':pid, 'cmdline':cmdline} help += suffix_help else: - title = "User Thread %d (%s):" % (pid, cmdline) + title = _("User Thread %(pid)d (%(cmdline)s):") % {'pid':pid, 'cmdline':cmdline} help = title return help, title @@ -201,7 +201,7 @@ def move_threads_to_cpu(cpus, pid_list, set_affinity_warning = None, elif set_affinity_warning: set_affinity_warning(pid, new_affinity) else: - print "move_threads_to_cpu: could not change pid %d affinity to %s" % (pid, new_affinity) + print _("move_threads_to_cpu: could not change pid %d affinity to %s") % (pid, new_affinity) # See if this is the thread group leader if not ps.has_key(pid): @@ -224,7 +224,7 @@ def move_threads_to_cpu(cpus, pid_list, set_affinity_warning = None, elif set_affinity_warning: set_affinity_warning(tid, new_affinity) else: - print "move_threads_to_cpu: could not change pid %d affinity to %s" % (pid, new_affinity) + print _("move_threads_to_cpu: could not change pid %d affinity to %s") % (pid, new_affinity) except SystemError: # process died continue diff --git a/tuna/tuna_gui.py b/tuna/tuna_gui.py index 083d1be..3fc543b 100644 --- a/tuna/tuna_gui.py +++ b/tuna/tuna_gui.py @@ -25,7 +25,7 @@ class main_gui: tuna_glade = "%s/tuna_gui.glade" % dir if os.access(tuna_glade, os.F_OK): break - self.wtree = gtk.glade.XML(tuna_glade, "mainbig_window") + self.wtree = gtk.glade.XML(tuna_glade, "mainbig_window", "tuna") self.ps = procfs.pidstats() self.irqs = procfs.interrupts() self.window = self.wtree.get_widget("mainbig_window") @@ -99,9 +99,9 @@ class main_gui: gtk.DIALOG_MODAL | gtk.DIALOG_DESTROY_WITH_PARENT, gtk.MESSAGE_WARNING, gtk.BUTTONS_YES_NO, - "Root privilege required\n\n" + \ + _("Root privilege required\n\n" + \ "Some functions will not work without root " + \ - "privilege.\nDo you want to continue?") + "privilege.\nDo you want to continue?")) ret = dialog.run() dialog.destroy() if ret == gtk.RESPONSE_NO: |