This patch adds the _( gettext macro to every string that may be translatable. Strings that contain only filenames or HTML tags are left out on purpose. If necessary it includes the libint.h and defines _(string) as gettext(string)
Signed-off-by: Peter Huewe <[email protected]> --- cpu/cpu.cpp | 6 +- csstoh.c | 11 +- devices/device.cpp | 10 +- html.cpp | 18 +- main.cpp | 4 +- parameters/learn.cpp | 20 ++-- parameters/parameters.cpp | 28 ++-- parameters/persistent.cpp | 2 +- perf/perf.cpp | 6 +- perf/perf_bundle.cpp | 32 ++-- po/powertop.pot | 369 +++++++++++++++++++++++++++++++++++++++++++-- process/do_process.cpp | 16 +- tuning/bluetooth.cpp | 2 +- tuning/iw.c | 16 +- tuning/tuning.cpp | 6 +- 15 files changed, 451 insertions(+), 95 deletions(-) diff --git a/cpu/cpu.cpp b/cpu/cpu.cpp index 39f00e7..af8ede3 100644 --- a/cpu/cpu.cpp +++ b/cpu/cpu.cpp @@ -340,7 +340,7 @@ void html_display_cpu_cstates(void) if (!htmlout) return; - fprintf(htmlout, "<h2>Processor Idle state report</h2>\n"); + fprintf(htmlout, _("<h2>Processor Idle state report</h2>\n")); for (package = 0; package < system_level.children.size(); package++) { int first_pkg = 0; @@ -543,7 +543,7 @@ void html_display_cpu_pstates(void) return; - fprintf(htmlout, "<h2>Processor frequency report</h2>\n"); + fprintf(htmlout, _("<h2>Processor frequency report</h2>\n")); for (package = 0; package < system_level.children.size(); package++) { @@ -759,7 +759,7 @@ void perf_power_bundle::handle_trace_point(int type, void *trace, int cpunr, uin event_name = event_names[type]; if (cpunr >= (int)all_cpus.size()) { - cout << "INVALID cpu nr in handle_trace_point\n"; + cout << _("INVALID cpu nr in handle_trace_point\n"); return; } diff --git a/csstoh.c b/csstoh.c index 7772b55..52941c6 100644 --- a/csstoh.c +++ b/csstoh.c @@ -27,6 +27,9 @@ #include <stdlib.h> #include <errno.h> #include <string.h> +#include <libintl.h> + +#define _(STRING) gettext(STRING) int main(int argc, char **argv) { @@ -34,17 +37,17 @@ int main(int argc, char **argv) char line[4096]; if (argc < 2) { - printf("Usage: csstoh cssfile header.h \n"); + printf(_("Usage: csstoh cssfile header.h \n")); exit(0); } in = fopen(argv[1], "rm"); if (!in) { - printf("Failed to open input file %s (%s) \n", argv[1], strerror(errno)); + printf(_("Failed to open input file %s (%s) \n"), argv[1], strerror(errno)); exit(0); } out = fopen(argv[2], "wm"); if (!out) { - printf("Failed to open output file %s (%s) \n", argv[1], strerror(errno)); + printf(_("Failed to open output file %s (%s) \n"), argv[1], strerror(errno)); exit(0); } @@ -65,4 +68,4 @@ int main(int argc, char **argv) fprintf(out, "#endif\n"); fclose(out); fclose(in); -} \ No newline at end of file +} diff --git a/devices/device.cpp b/devices/device.cpp index c38b96c..c72d1ee 100644 --- a/devices/device.cpp +++ b/devices/device.cpp @@ -237,27 +237,27 @@ void html_report_devices(void) sort(all_devices.begin(), all_devices.end(), power_device_sort); - fprintf(htmlout, "<h2>Device power report</h2>\n"); + fprintf(htmlout, _("<h2>Device power report</h2>\n")); pw = global_joules_consumed(); if (pw > 0.0001) { char buf[32]; - fprintf(htmlout, "<p>The battery reports a discharge rate of %sW</p>\n", + fprintf(htmlout, _("<p>The battery reports a discharge rate of %sW</p>\n"), fmt_prefix(pw, buf)); } if (show_power) { char buf[32]; - fprintf(htmlout, "<p>System baseline power is estimated at %sW</p>\n", + fprintf(htmlout, _("<p>System baseline power is estimated at %sW</p>\n"), fmt_prefix(get_parameter_value("base power"), buf)); } fprintf(htmlout, "<table width=100%%>\n"); if (show_power) - fprintf(htmlout, "<tr><th width=10%%>Power est.</th><th width=10%%>Usage</th><th class=\"device\">Device name</th></tr>\n"); + fprintf(htmlout, _("<tr><th width=10%%>Power est.</th><th width=10%%>Usage</th><th class=\"device\">Device name</th></tr>\n")); else - fprintf(htmlout, "<tr><th width=10%%>Usage</th><th class=\"device\">Device name</th></tr>\n"); + fprintf(htmlout, _("<tr><th width=10%%>Usage</th><th class=\"device\">Device name</th></tr>\n")); for (i = 0; i < all_devices.size(); i++) { double P; diff --git a/html.cpp b/html.cpp index 0a4db2e..cf719f3 100644 --- a/html.cpp +++ b/html.cpp @@ -84,29 +84,29 @@ static void system_info(void) if (!htmlout) return; - fprintf(htmlout, "<h1>PowerTOP report</h1>\n"); + fprintf(htmlout, _("<h1>PowerTOP report</h1>\n")); - fprintf(htmlout, "<h2>System information</h2>\n"); + fprintf(htmlout, _("<h2>System information</h2>\n")); fprintf(htmlout, "<table width=100%%>\n"); - fprintf(htmlout, "<tr class=\"system_even\"><td width=20%%>PowerTOP version</td><td>%s</td></tr>\n", POWERTOP_VERSION); + fprintf(htmlout, _("<tr class=\"system_even\"><td width=20%%>PowerTOP version</td><td>%s</td></tr>\n"), POWERTOP_VERSION); str = read_sysfs_string("/proc/version"); - fprintf(htmlout, "<tr class=\"system_odd\"><td>Kernel version</td><td>%s</td></tr>\n", str.c_str()); + fprintf(htmlout, _("<tr class=\"system_odd\"><td>Kernel version</td><td>%s</td></tr>\n"), str.c_str()); str = read_sysfs_string("/sys/devices/virtual/dmi/id/board_vendor"); str2 = read_sysfs_string("/sys/devices/virtual/dmi/id/board_name"); str3 = read_sysfs_string("/sys/devices/virtual/dmi/id/product_version"); - fprintf(htmlout, "<tr class=\"system_even\"><td>System name</td><td>%s %s %s</td></tr>\n", str.c_str(), str2.c_str(), str3.c_str()); + fprintf(htmlout, _("<tr class=\"system_even\"><td>System name</td><td>%s %s %s</td></tr>\n"), str.c_str(), str2.c_str(), str3.c_str()); str = cpu_model(); - fprintf(htmlout, "<tr class=\"system_odd\"><td>CPU information</td><td>%lix %s</td></tr>\n", sysconf(_SC_NPROCESSORS_ONLN), str.c_str()); + fprintf(htmlout, _("<tr class=\"system_odd\"><td>CPU information</td><td>%lix %s</td></tr>\n"), sysconf(_SC_NPROCESSORS_ONLN), str.c_str()); str = read_sysfs_string("/etc/system-release"); if (str.length() < 1) str = read_sysfs_string("/etc/redhat-release"); - fprintf(htmlout, "<tr class=\"system_even\"><td>OS information</td><td>%s</td></tr>\n", str.c_str()); + fprintf(htmlout, _("<tr class=\"system_even\"><td>OS information</td><td>%s</td></tr>\n"), str.c_str()); fprintf(htmlout, "</table>\n"); @@ -119,10 +119,10 @@ void init_html_output(const char *filename) htmlout = fopen(filename, "wm"); if (!htmlout) { - fprintf(stderr, "Cannot open output file %s (%s)\n", filename, strerror(errno)); + fprintf(stderr, _("Cannot open output file %s (%s)\n"), filename, strerror(errno)); } - printf("Writing PowerTOP output to file %s\n", filename); + printf(_("Writing PowerTOP output to file %s\n"), filename); fprintf(htmlout, "<!DOCTYPE html PUBLIC \"-//W3C/DTD HTML 4.01//EN\">\n"); fprintf(htmlout, "<html>\n\n"); fprintf(htmlout, "<head>\n"); diff --git a/main.cpp b/main.cpp index c5b8a60..6009445 100644 --- a/main.cpp +++ b/main.cpp @@ -152,7 +152,7 @@ void one_measurement(int seconds) void out_of_memory() { reset_display(); - printf("Out of memory. Aborting...\n"); + printf(_("Out of memory. Aborting...\n")); abort(); } @@ -234,7 +234,7 @@ int main(int argc, char **argv) } if (debug_learning) - printf("Learning debugging enabled\n"); + printf(_("Learning debugging enabled\n")); diff --git a/parameters/learn.cpp b/parameters/learn.cpp index 974719b..be086d8 100644 --- a/parameters/learn.cpp +++ b/parameters/learn.cpp @@ -148,7 +148,7 @@ void learn_parameters(int iterations, int do_base_power) delta = 0.05; if (debug_learning) - printf("Delta starts at %5.3f\n", delta); + printf(_("Delta starts at %5.3f\n"), delta); if (best_so_far->parameters[bpi] > min_power * 0.9) best_so_far->parameters[bpi] = min_power * 0.9; @@ -197,7 +197,7 @@ void learn_parameters(int iterations, int do_base_power) if (value > 5000) value = 5000; -// printf("Trying %s %4.2f -> %4.2f\n", param.c_str(), best_so_far->parameters[param], value); +// printf(_("Trying %s %4.2f -> %4.2f\n"), param.c_str(), best_so_far->parameters[param], value); best_so_far->parameters[i] = value; calculate_params(best_so_far); @@ -221,7 +221,7 @@ void learn_parameters(int iterations, int do_base_power) value = 5000; -// printf("Trying %s %4.2f -> %4.2f\n", param.c_str(), orgvalue, value); +// printf(_("Trying %s %4.2f -> %4.2f\n"), param.c_str(), orgvalue, value); if (orgvalue != value) { best_so_far->parameters[i] = value; @@ -251,11 +251,11 @@ void learn_parameters(int iterations, int do_base_power) prevparam = -1; } else { if (debug_learning) { - printf("Retry is %i \n", retry); - printf("delta is %5.4f\n", delta); - printf("Best parameter is %i \n", bestparam); - printf("Changing score from %4.3f to %4.3f\n", orgscore, best_score); - printf("Changing value from %4.3f to %4.3f\n", best_so_far->parameters[bestparam], newvalue); + printf(_("Retry is %i \n"), retry); + printf(_("delta is %5.4f\n"), delta); + printf(_("Best parameter is %i \n"), bestparam); + printf(_("Changing score from %4.3f to %4.3f\n"), orgscore, best_score); + printf(_("Changing value from %4.3f to %4.3f\n"), best_so_far->parameters[bestparam], newvalue); } best_so_far->parameters[bestparam] = newvalue; if (prevparam == bestparam) @@ -277,7 +277,7 @@ void learn_parameters(int iterations, int do_base_power) weed_empties(best_so_far); if (debug_learning) - printf("Final score %4.2f (%i points)\n", best_so_far->score / past_results.size(), (int)past_results.size()); + printf(_("Final score %4.2f (%i points)\n"), best_so_far->score / past_results.size(), (int)past_results.size()); // dump_parameter_bundle(best_so_far); // dump_past_results(); -} \ No newline at end of file +} diff --git a/parameters/parameters.cpp b/parameters/parameters.cpp index 59161d9..962a914 100644 --- a/parameters/parameters.cpp +++ b/parameters/parameters.cpp @@ -50,7 +50,7 @@ int get_param_index(const char *name) } if (index == 0) - printf("OH BLA\n"); + printf(_("OH BLA\n")); return index; } @@ -103,7 +103,7 @@ double get_parameter_value(const char *name, struct parameter_bundle *the_bundle index = get_param_index(name); if (index >= the_bundle->parameters.size()) { - fprintf(stderr, "BUG: requesting unregistered parameter %s\n", name); + fprintf(stderr, _("BUG: requesting unregistered parameter %s\n"), name); } return the_bundle->parameters[index]; } @@ -185,7 +185,7 @@ double compute_bundle(struct parameter_bundle *parameters, struct result_bundle power += all_devices[i]->power_usage(results, parameters); } -// printf("result power is %6.2f guessed is %6.2f\n", results->power, power); +// printf(_("result power is %6.2f guessed is %6.2f\n"), results->power, power); parameters->actual_power = results->power; parameters->guessed_power = power; /* scale the squared error by the actual power so that non-idle data points weigh heavier */ @@ -237,18 +237,18 @@ void dump_parameter_bundle(struct parameter_bundle *para) int index; printf("\n\n"); - printf("Parameter state \n"); + printf(_("Parameter state \n")); printf("----------------------------------\n"); - printf("Value\t\tName\n"); + printf(_("Value\t\tName\n")); for (it = param_index.begin(); it != param_index.end(); it++) { index = it->second; printf("%5.2f\t\t%s (%i)\n", para->parameters[index], it->first.c_str(), index); } printf("\n"); - printf("Score: %5.1f (%5.1f)\n", sqrt(para->score / (0.001 + past_results.size()) / average_power()), para->score); - printf("Guess: %5.1f\n", para->guessed_power); - printf("Actual: %5.1f\n", para->actual_power); + printf(_("Score: %5.1f (%5.1f)\n"), sqrt(para->score / (0.001 + past_results.size()) / average_power()), para->score); + printf(_("Guess: %5.1f\n"), para->guessed_power); + printf(_("Actual: %5.1f\n"), para->actual_power); printf("----------------------------------\n"); } @@ -259,16 +259,16 @@ void dump_result_bundle(struct result_bundle *res) unsigned int index; printf("\n\n"); - printf("Utilisation state \n"); + printf(_("Utilisation state \n")); printf("----------------------------------\n"); - printf("Value\t\tName\n"); + printf(_("Value\t\tName\n")); for (it = result_index.begin(); it != result_index.end(); it++) { index = get_result_index(it->first.c_str()); printf("%5.2f%%\t\t%s(%i)\n", res->utilization[index], it->first.c_str(), index); } printf("\n"); - printf("Power: %5.1f\n", res->power); + printf(_("Power: %5.1f\n"), res->power); printf("----------------------------------\n"); } @@ -346,13 +346,13 @@ void dump_past_results(void) struct result_bundle *result; for (j = 0; j < past_results.size(); j+=10) { - printf("Est "); + printf(_("Est ")); for (i = j; i < past_results.size() && i < j + 10; i++) { result = past_results[i]; printf("%6.2f ", bundle_power(&all_parameters, result)); } printf("\n"); - printf("Actual "); + printf(_("Actual ")); for (i = j; i < past_results.size() && i < j + 10; i++) { result = past_results[i]; printf("%6.2f ", result->power); @@ -432,4 +432,4 @@ int global_power_valid(void) return 0; -} \ No newline at end of file +} diff --git a/parameters/persistent.cpp b/parameters/persistent.cpp index 069095d..fbadc16 100644 --- a/parameters/persistent.cpp +++ b/parameters/persistent.cpp @@ -120,7 +120,7 @@ void save_parameters(const char *filename) { ofstream file; -// printf("result size is %i, #parameters is %i \n", (int)past_results.size(), (int)all_parameters.parameters.size()); +// printf(_("result size is %i, #parameters is %i \n"), (int)past_results.size(), (int)all_parameters.parameters.size()); if (!global_power_valid()) return; diff --git a/perf/perf.cpp b/perf/perf.cpp index 73682aa..e1bdd8f 100644 --- a/perf/perf.cpp +++ b/perf/perf.cpp @@ -115,7 +115,7 @@ void perf_event::create_perf_event(char *eventname, int _cpu) } if (read(perf_fd, &read_data, sizeof(read_data)) == -1) { reset_display(); - perror("Unable to read perf file descriptor\n"); + perror(_("Unable to read perf file descriptor\n")); exit(-1); } @@ -124,14 +124,14 @@ void perf_event::create_perf_event(char *eventname, int _cpu) perf_mmap = mmap(NULL, (bufsize+1)*getpagesize(), PROT_READ | PROT_WRITE, MAP_SHARED, perf_fd, 0); if (perf_mmap == MAP_FAILED) { - fprintf(stderr, "failed to mmap with %d (%s)\n", errno, strerror(errno)); + fprintf(stderr, _("failed to mmap with %d (%s)\n"), errno, strerror(errno)); return; } ret = ioctl(perf_fd, PERF_EVENT_IOC_ENABLE); if (ret < 0) { - fprintf(stderr, "failed to enable perf \n"); + fprintf(stderr, _("failed to enable perf \n")); } pc = (perf_event_mmap_page *)perf_mmap; diff --git a/perf/perf_bundle.cpp b/perf/perf_bundle.cpp index 81ac1a1..55d769d 100644 --- a/perf/perf_bundle.cpp +++ b/perf/perf_bundle.cpp @@ -33,6 +33,8 @@ #include "perf.h" #include "../cpu/cpu.h" +#include "../lib.h" + class perf_bundle_event: public perf_event { @@ -164,20 +166,20 @@ static uint64_t timestamp(perf_event_header *event) int i; unsigned char *x; - printf("header:\n"); - printf(" type is %x \n", sample->header.type); - printf(" misc is %x \n", sample->header.misc); - printf(" size is %i \n", sample->header.size); - printf("sample:\n"); - printf(" time is %llx \n", sample->trace.time); - printf(" cpu is %i / %x \n", sample->trace.cpu, sample->trace.cpu); - printf(" res is %i / %x \n", sample->trace.res, sample->trace.res); - printf(" size is %i / %x \n", sample->trace.size, sample->trace.size); - printf(" type is %i / %x \n", sample->trace.type, sample->trace.type); - printf(" flags is %i / %x \n", sample->trace.flags, sample->trace.flags); - printf(" p/c is %i / %x \n", sample->trace.preempt_count, sample->trace.preempt_count); - printf(" pid is %i / %x \n", sample->trace.pid, sample->trace.pid); - printf(" lock dept is %i / %x \n", sample->trace.lock_depth, sample->trace.lock_depth); + printf(_("header:\n"); + printf(_(" type is %x \n"), sample->header.type); + printf(_(" misc is %x \n"), sample->header.misc); + printf(_(" size is %i \n"), sample->header.size); + printf(_("sample:\n"); + printf(_(" time is %llx \n"), sample->trace.time); + printf(_(" cpu is %i / %x \n"), sample->trace.cpu, sample->trace.cpu); + printf(_(" res is %i / %x \n"), sample->trace.res, sample->trace.res); + printf(_(" size is %i / %x \n"), sample->trace.size, sample->trace.size); + printf(_(" type is %i / %x \n"), sample->trace.type, sample->trace.type); + printf(_(" flags is %i / %x \n"), sample->trace.flags, sample->trace.flags); + printf(_(" p/c is %i / %x \n"), sample->trace.preempt_count, sample->trace.preempt_count); + printf(_(" pid is %i / %x \n"), sample->trace.pid, sample->trace.pid); + printf(_(" lock dept is %i / %x \n"), sample->trace.lock_depth, sample->trace.lock_depth); x = (unsigned char *)sample; for (i = 0; i < sample->header.size; i++) @@ -228,6 +230,6 @@ void perf_bundle::process(void) void perf_bundle::handle_trace_point(int type, void *trace, int cpu, uint64_t time, unsigned char flags) { - printf("UH OH... abstract handle_trace_point called\n"); + printf(_("UH OH... abstract handle_trace_point called\n")); } diff --git a/po/powertop.pot b/po/powertop.pot index 800f135..cbee169 100644 --- a/po/powertop.pot +++ b/po/powertop.pot @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2011-01-10 21:48-0800\n" +"POT-Creation-Date: 2011-01-21 00:09+0100\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" "Language-Team: LANGUAGE <[email protected]>\n" @@ -17,6 +17,66 @@ msgstr "" "Content-Type: text/plain; charset=CHARSET\n" "Content-Transfer-Encoding: 8bit\n" +#: perf/perf_bundle.cpp:175 +#, c-format +msgid "\tcpu is %i / %x \n" +msgstr "" + +#: perf/perf_bundle.cpp:179 +#, c-format +msgid "\tflags is %i / %x \n" +msgstr "" + +#: perf/perf_bundle.cpp:182 +#, c-format +msgid "\tlock dept is %i / %x \n" +msgstr "" + +#: perf/perf_bundle.cpp:171 +#, c-format +msgid "\tmisc is %x \n" +msgstr "" + +#: perf/perf_bundle.cpp:180 +#, c-format +msgid "\tp/c is %i / %x \n" +msgstr "" + +#: perf/perf_bundle.cpp:181 +#, c-format +msgid "\tpid is %i / %x \n" +msgstr "" + +#: perf/perf_bundle.cpp:176 +#, c-format +msgid "\tres is %i / %x \n" +msgstr "" + +#: perf/perf_bundle.cpp:172 +#, c-format +msgid "\tsize is %i \n" +msgstr "" + +#: perf/perf_bundle.cpp:177 +#, c-format +msgid "\tsize is %i / %x \n" +msgstr "" + +#: perf/perf_bundle.cpp:174 +#, c-format +msgid "\ttime is %llx \n" +msgstr "" + +#: perf/perf_bundle.cpp:178 +#, c-format +msgid "\ttype is %i / %x \n" +msgstr "" + +#: perf/perf_bundle.cpp:170 +#, c-format +msgid "\ttype is %x \n" +msgstr "" + #: process/do_process.cpp:664 msgid " Usage Events/s Category Description\n" msgstr "" @@ -94,11 +154,105 @@ msgstr "" msgid ".... device %s \n" msgstr "" +#: html.cpp:87 +#, c-format +msgid "<h1>PowerTOP report</h1>\n" +msgstr "" + +#: devices/device.cpp:240 +#, c-format +msgid "<h2>Device power report</h2>\n" +msgstr "" + +#: tuning/tuning.cpp:253 +#, c-format +msgid "<h2>Optimal tuned software settings</h2>\n" +msgstr "" + +#: process/do_process.cpp:721 +#, c-format +msgid "<h2>Overview of software power consumers</h2>\n" +msgstr "" + +#: process/do_process.cpp:803 +#, c-format +msgid "<h2>Power consumption summary</h2>\n" +msgstr "" + #: devlist.cpp:308 #, c-format msgid "<h2>Process device activity</h2>\n" msgstr "" +#: cpu/cpu.cpp:343 +#, c-format +msgid "<h2>Processor Idle state report</h2>\n" +msgstr "" + +#: cpu/cpu.cpp:546 +#, c-format +msgid "<h2>Processor frequency report</h2>\n" +msgstr "" + +#: tuning/tuning.cpp:216 +#, c-format +msgid "<h2>Software settings in need of tuning</h2>\n" +msgstr "" + +#: html.cpp:89 +#, c-format +msgid "<h2>System information</h2>\n" +msgstr "" + +#: tuning/tuning.cpp:231 +#, c-format +msgid "<h2>Untunable software issues</h2>\n" +msgstr "" + +#: process/do_process.cpp:805 +#, c-format +msgid "" +"<p>%3.1f wakeups/second, %3.1f GPU ops/second and %3.1f VFS ops/sec</p>" +msgstr "" + +#: devices/device.cpp:252 +#, c-format +msgid "<p>System baseline power is estimated at %sW</p>\n" +msgstr "" + +#: devices/device.cpp:246 +#, c-format +msgid "<p>The battery reports a discharge rate of %sW</p>\n" +msgstr "" + +#: html.cpp:93 +#, c-format +msgid "" +"<tr class=\"system_even\"><td width=20%%>PowerTOP version</td><td>%s</td></" +"tr>\n" +msgstr "" + +#: html.cpp:109 +#, c-format +msgid "<tr class=\"system_even\"><td>OS information</td><td>%s</td></tr>\n" +msgstr "" + +#: html.cpp:101 +#, c-format +msgid "<tr class=\"system_even\"><td>System name</td><td>%s %s %s</td></tr>\n" +msgstr "" + +#: html.cpp:105 +#, c-format +msgid "" +"<tr class=\"system_odd\"><td>CPU information</td><td>%lix %s</td></tr>\n" +msgstr "" + +#: html.cpp:96 +#, c-format +msgid "<tr class=\"system_odd\"><td>Kernel version</td><td>%s</td></tr>\n" +msgstr "" + #: devlist.cpp:310 #, c-format msgid "" @@ -106,11 +260,66 @@ msgid "" "th></tr>\n" msgstr "" +#: devices/device.cpp:258 +#, c-format +msgid "" +"<tr><th width=10%%>Power est.</th><th width=10%%>Usage</th><th class=\"device" +"\">Device name</th></tr>\n" +msgstr "" + +#: process/do_process.cpp:812 +#, c-format +msgid "" +"<tr><th width=10%%>Power est.</th><th width=10%%>Usage</th><th " +"width=10%%>Events/s</th><th width=10%% class=\"process\">Category</th><th " +"class=\"process\">Description</th></tr>\n" +msgstr "" + +#: process/do_process.cpp:726 +#, c-format +msgid "" +"<tr><th width=10%%>Power est.</th><th width=10%%>Usage</th><th " +"width=10%%>Wakeups/s</th><th width=10%%>GPU ops/s</th><th width=10%%>Disk IO/" +"s</th><th width=10%% class=\"process\">Category</th><th class=\"process" +"\">Description</th></tr>\n" +msgstr "" + +#: devices/device.cpp:260 +#, c-format +msgid "" +"<tr><th width=10%%>Usage</th><th class=\"device\">Device name</th></tr>\n" +msgstr "" + +#: process/do_process.cpp:814 +#, c-format +msgid "" +"<tr><th width=10%%>Usage</th><th width=10%%>Events/s</th><th width=10%% " +"class=\"process\">Category</th><th class=\"process\">Description</th></tr>\n" +msgstr "" + +#: process/do_process.cpp:728 +#, c-format +msgid "" +"<tr><th width=10%%>Usage</th><th width=10%%>Wakeups/s</th><th width=10%%>GPU " +"ops/s</th><th width=10%%>Disk IO/s</th><th width=10%% class=\"process" +"\">Category</th><th class=\"process\">Description</th></tr>\n" +msgstr "" + #: cpu/intel_cpus.cpp:577 #, c-format msgid "Actual" msgstr "" +#: parameters/parameters.cpp:355 +#, c-format +msgid "Actual " +msgstr "" + +#: parameters/parameters.cpp:251 +#, c-format +msgid "Actual: %5.1f\n" +msgstr "" + #: devices/alsa.cpp:80 devices/alsa.cpp:82 #, c-format msgid "Audio codec %s: %s" @@ -131,12 +340,22 @@ msgstr "" msgid "Autosuspend for unknown USB device %s (%s:%s)" msgstr "" -#: tuning/cpufreq.cpp:42 tuning/ethernet.cpp:50 tuning/runtime.cpp:41 -#: tuning/sysfs.cpp:37 tuning/tunable.cpp:49 tuning/usb.cpp:40 -#: tuning/wifi.cpp:45 +#: parameters/parameters.cpp:106 +#, c-format +msgid "BUG: requesting unregistered parameter %s\n" +msgstr "" + +#: tuning/bluetooth.cpp:46 tuning/cpufreq.cpp:42 tuning/ethernet.cpp:50 +#: tuning/runtime.cpp:41 tuning/sysfs.cpp:37 tuning/tunable.cpp:49 +#: tuning/usb.cpp:40 tuning/wifi.cpp:45 msgid "Bad" msgstr "" +#: parameters/learn.cpp:256 +#, c-format +msgid "Best parameter is %i \n" +msgstr "" + #: tuning/bluetooth.cpp:48 #, c-format msgid "Bluetooth device interface status" @@ -231,10 +450,30 @@ msgstr "" msgid "Cannot load from file " msgstr "" +#: html.cpp:122 +#, c-format +msgid "Cannot open output file %s (%s)\n" +msgstr "" + #: parameters/persistent.cpp:43 parameters/persistent.cpp:130 msgid "Cannot save to file " msgstr "" +#: parameters/learn.cpp:257 +#, c-format +msgid "Changing score from %4.3f to %4.3f\n" +msgstr "" + +#: parameters/learn.cpp:258 +#, c-format +msgid "Changing value from %4.3f to %4.3f\n" +msgstr "" + +#: parameters/learn.cpp:151 +#, c-format +msgid "Delta starts at %5.3f\n" +msgstr "" + #: display.cpp:73 msgid "Device stats" msgstr "" @@ -247,6 +486,11 @@ msgstr "" msgid "Enable SATA link power management for /dev/sda" msgstr "" +#: parameters/parameters.cpp:349 +#, c-format +msgid "Est " +msgstr "" + #: process/do_process.cpp:636 #, c-format msgid "" @@ -254,6 +498,11 @@ msgid "" "\n" msgstr "" +#: parameters/learn.cpp:280 +#, c-format +msgid "Final score %4.2f (%i points)\n" +msgstr "" + #: calibrate/calibrate.cpp:480 msgid "Finishing PowerTOP power estimate calibration \n" msgstr "" @@ -262,12 +511,21 @@ msgstr "" msgid "Frequency stats" msgstr "" -#: tuning/cpufreq.cpp:42 tuning/ethernet.cpp:50 tuning/runtime.cpp:41 -#: tuning/sysfs.cpp:37 tuning/tunable.cpp:48 tuning/usb.cpp:40 -#: tuning/wifi.cpp:45 +#: tuning/bluetooth.cpp:46 tuning/cpufreq.cpp:42 tuning/ethernet.cpp:50 +#: tuning/runtime.cpp:41 tuning/sysfs.cpp:37 tuning/tunable.cpp:48 +#: tuning/usb.cpp:40 tuning/wifi.cpp:45 msgid "Good" msgstr "" +#: parameters/parameters.cpp:250 +#, c-format +msgid "Guess: %5.1f\n" +msgstr "" + +#: cpu/cpu.cpp:762 +msgid "INVALID cpu nr in handle_trace_point\n" +msgstr "" + #: cpu/cpu_core.cpp:116 cpu/cpu_linux.cpp:329 cpu/cpu_package.cpp:145 #: cpu/intel_cpus.cpp:211 cpu/intel_cpus.cpp:446 cpu/intel_cpus.cpp:647 msgid "Idle" @@ -281,6 +539,11 @@ msgstr "" msgid "Intel built in USB hub" msgstr "" +#: main.cpp:237 +#, c-format +msgid "Learning debugging enabled\n" +msgstr "" + #: main.cpp:269 #, c-format msgid "Leaving PowerTOP\n" @@ -305,6 +568,16 @@ msgstr "" msgid "Network interface: %s (%s)" msgstr "" +#: parameters/parameters.cpp:53 +#, c-format +msgid "OH BLA\n" +msgstr "" + +#: main.cpp:155 +#, c-format +msgid "Out of memory. Aborting...\n" +msgstr "" + #: display.cpp:70 msgid "Overview" msgstr "" @@ -328,6 +601,11 @@ msgstr "" msgid "Package" msgstr "" +#: parameters/parameters.cpp:240 +#, c-format +msgid "Parameter state \n" +msgstr "" + #: calibrate/calibrate.cpp:484 #, c-format msgid "Parameters after calibration:\n" @@ -345,6 +623,11 @@ msgstr "" msgid "Power est. Usage Device name\n" msgstr "" +#: parameters/parameters.cpp:271 +#, c-format +msgid "Power: %5.1f\n" +msgstr "" + #: main.cpp:172 #, c-format msgid "PowerTOP " @@ -360,6 +643,11 @@ msgstr "" msgid "Radio device: %s" msgstr "" +#: parameters/learn.cpp:254 +#, c-format +msgid "Retry is %i \n" +msgstr "" + #: tuning/runtime.cpp:47 #, c-format msgid "Runtime PM for %s device %s" @@ -384,10 +672,22 @@ msgstr "" msgid "SATA link: %s" msgstr "" +#: parameters/parameters.cpp:249 +#, c-format +msgid "Score: %5.1f (%5.1f)\n" +msgstr "" + #: calibrate/calibrate.cpp:457 msgid "Starting PowerTOP power estimate calibration \n" msgstr "" +#: process/do_process.cpp:657 +#, c-format +msgid "" +"Summary: %3.1f wakeups/second, %3.1f GPU ops/second and %3.1f VFS ops/sec\n" +"\n" +msgstr "" + #: devices/device.cpp:174 #, c-format msgid "System baseline power is estimated at %sW\n" @@ -413,6 +713,11 @@ msgstr "" msgid "Turbo Mode" msgstr "" +#: perf/perf_bundle.cpp:233 +#, c-format +msgid "UH OH... abstract handle_trace_point called\n" +msgstr "" + #: devices/usb.cpp:51 devices/usb.cpp:94 devices/usb.cpp:96 #, c-format msgid "USB device: %s" @@ -423,9 +728,13 @@ msgstr "" msgid "USB device: %s (%s)" msgstr "" -#: tuning/cpufreq.cpp:42 tuning/ethernet.cpp:50 tuning/runtime.cpp:41 -#: tuning/sysfs.cpp:37 tuning/tunable.cpp:50 tuning/usb.cpp:40 -#: tuning/wifi.cpp:45 +#: perf/perf.cpp:118 +msgid "Unable to read perf file descriptor\n" +msgstr "" + +#: tuning/bluetooth.cpp:46 tuning/cpufreq.cpp:42 tuning/ethernet.cpp:50 +#: tuning/runtime.cpp:41 tuning/sysfs.cpp:37 tuning/tunable.cpp:50 +#: tuning/usb.cpp:40 tuning/wifi.cpp:45 msgid "Unknown" msgstr "" @@ -434,10 +743,20 @@ msgstr "" msgid "Using 'ondemand' cpufreq governor" msgstr "" +#: parameters/parameters.cpp:262 +#, c-format +msgid "Utilisation state \n" +msgstr "" + #: tuning/tuning.cpp:65 msgid "VM writeback timeout" msgstr "" +#: parameters/parameters.cpp:242 parameters/parameters.cpp:264 +#, c-format +msgid "Value\t\tName\n" +msgstr "" + #: tuning/ethernet.cpp:54 #, c-format msgid "Wake-on-lan status for device %s" @@ -448,6 +767,11 @@ msgstr "" msgid "Wireless Power Saving for interface %s" msgstr "" +#: html.cpp:125 +#, c-format +msgid "Writing PowerTOP output to file %s\n" +msgstr "" + #: perf/perf.cpp:112 #, c-format msgid "as well as support for trace points in the kernel:\n" @@ -462,7 +786,32 @@ msgstr "" msgid "cpu package %i" msgstr "" +#: parameters/learn.cpp:255 +#, c-format +msgid "delta is %5.4f\n" +msgstr "" + #: main.cpp:173 #, c-format msgid "exiting...\n" msgstr "" + +#: perf/perf.cpp:134 +#, c-format +msgid "failed to enable perf \n" +msgstr "" + +#: perf/perf.cpp:127 +#, c-format +msgid "failed to mmap with %d (%s)\n" +msgstr "" + +#: perf/perf_bundle.cpp:169 +#, c-format +msgid "header:\n" +msgstr "" + +#: perf/perf_bundle.cpp:173 +#, c-format +msgid "sample:\n" +msgstr "" diff --git a/process/do_process.cpp b/process/do_process.cpp index 2ca4b10..aa35916 100644 --- a/process/do_process.cpp +++ b/process/do_process.cpp @@ -654,7 +654,7 @@ void process_update_display(void) wprintw(win, "\n"); - wprintw(win, "Summary: %3.1f wakeups/second, %3.1f GPU ops/second and %3.1f VFS ops/sec\n\n", + wprintw(win, _("Summary: %3.1f wakeups/second, %3.1f GPU ops/second and %3.1f VFS ops/sec\n\n"), total_wakeups(), total_gpu_ops(), total_disk_hits()); @@ -718,14 +718,14 @@ void html_process_update_display(void) show_power = global_power_valid(); - fprintf(htmlout, "<h2>Overview of software power consumers</h2>\n"); + fprintf(htmlout, _("<h2>Overview of software power consumers</h2>\n")); fprintf(htmlout, "<table width=100%%>\n"); if (show_power) - fprintf(htmlout, "<tr><th width=10%%>Power est.</th><th width=10%%>Usage</th><th width=10%%>Wakeups/s</th><th width=10%%>GPU ops/s</th><th width=10%%>Disk IO/s</th><th width=10%% class=\"process\">Category</th><th class=\"process\">Description</th></tr>\n"); + fprintf(htmlout, _("<tr><th width=10%%>Power est.</th><th width=10%%>Usage</th><th width=10%%>Wakeups/s</th><th width=10%%>GPU ops/s</th><th width=10%%>Disk IO/s</th><th width=10%% class=\"process\">Category</th><th class=\"process\">Description</th></tr>\n")); else - fprintf(htmlout, "<tr><th width=10%%>Usage</th><th width=10%%>Wakeups/s</th><th width=10%%>GPU ops/s</th><th width=10%%>Disk IO/s</th><th width=10%% class=\"process\">Category</th><th class=\"process\">Description</th></tr>\n"); + fprintf(htmlout, _("<tr><th width=10%%>Usage</th><th width=10%%>Wakeups/s</th><th width=10%%>GPU ops/s</th><th width=10%%>Disk IO/s</th><th width=10%% class=\"process\">Category</th><th class=\"process\">Description</th></tr>\n")); total = all_power.size(); @@ -800,18 +800,18 @@ void html_summary(void) show_power = global_power_valid(); - fprintf(htmlout, "<h2>Power consumption summary</h2>\n"); + fprintf(htmlout, _("<h2>Power consumption summary</h2>\n")); - fprintf(htmlout, "<p>%3.1f wakeups/second, %3.1f GPU ops/second and %3.1f VFS ops/sec</p>", + fprintf(htmlout, _("<p>%3.1f wakeups/second, %3.1f GPU ops/second and %3.1f VFS ops/sec</p>"), total_wakeups(), total_gpu_ops(), total_disk_hits()); fprintf(htmlout, "<table width=100%%>\n"); if (show_power) - fprintf(htmlout, "<tr><th width=10%%>Power est.</th><th width=10%%>Usage</th><th width=10%%>Events/s</th><th width=10%% class=\"process\">Category</th><th class=\"process\">Description</th></tr>\n"); + fprintf(htmlout, _("<tr><th width=10%%>Power est.</th><th width=10%%>Usage</th><th width=10%%>Events/s</th><th width=10%% class=\"process\">Category</th><th class=\"process\">Description</th></tr>\n")); else - fprintf(htmlout, "<tr><th width=10%%>Usage</th><th width=10%%>Events/s</th><th width=10%% class=\"process\">Category</th><th class=\"process\">Description</th></tr>\n"); + fprintf(htmlout, _("<tr><th width=10%%>Usage</th><th width=10%%>Events/s</th><th width=10%% class=\"process\">Category</th><th class=\"process\">Description</th></tr>\n")); total = all_power.size(); if (total > 10) diff --git a/tuning/bluetooth.cpp b/tuning/bluetooth.cpp index 3957316..02b44a7 100644 --- a/tuning/bluetooth.cpp +++ b/tuning/bluetooth.cpp @@ -43,7 +43,7 @@ #include "../lib.h" #include "bluetooth.h" -bt_tunable::bt_tunable(void) : tunable("", 1.0, "Good", "Bad", "Unknown") +bt_tunable::bt_tunable(void) : tunable("", 1.0, _("Good"), _("Bad"), _("Unknown")) { sprintf(desc, _("Bluetooth device interface status")); } diff --git a/tuning/iw.c b/tuning/iw.c index fd6fd93..e1b16e7 100644 --- a/tuning/iw.c +++ b/tuning/iw.c @@ -44,13 +44,15 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. #include <netlink/genl/ctrl.h> #include <netlink/msg.h> #include <netlink/attr.h> +#include <libintl.h> + +#define _(STRING) gettext(STRING) #include "nl80211.h" #include <asm/errno.h> #include <linux/genetlink.h> #include "iw.h" - #ifndef CONFIG_LIBNL20 /* libnl 2.0 compatibility code */ @@ -82,18 +84,18 @@ static int nl80211_init(struct nl80211_state *state) state->nl_sock = nl_socket_alloc(); if (!state->nl_sock) { - fprintf(stderr, "Failed to allocate netlink socket.\n"); + fprintf(stderr, _("Failed to allocate netlink socket.\n")); return -ENOMEM; } if (genl_connect(state->nl_sock)) { - fprintf(stderr, "Failed to connect to generic netlink.\n"); + fprintf(stderr, _("Failed to connect to generic netlink.\n")); err = -ENOLINK; goto out_handle_destroy; } if (genl_ctrl_alloc_cache(state->nl_sock, &state->nl_cache)) { - fprintf(stderr, "Failed to allocate generic netlink cache.\n"); + fprintf(stderr, _("Failed to allocate generic netlink cache.\n")); err = -ENOMEM; goto out_handle_destroy; } @@ -211,13 +213,13 @@ static int __handle_cmd(struct nl80211_state *state, const char *iface, int get) msg = nlmsg_alloc(); if (!msg) { - fprintf(stderr, "failed to allocate netlink message\n"); + fprintf(stderr, _("failed to allocate netlink message\n")); return 2; } cb = nl_cb_alloc(NL_CB_DEFAULT); if (!cb) { - fprintf(stderr, "failed to allocate netlink callbacks\n"); + fprintf(stderr, _("failed to allocate netlink callbacks\n")); err = 2; goto out_free_msg; } @@ -258,7 +260,7 @@ static int __handle_cmd(struct nl80211_state *state, const char *iface, int get) nlmsg_free(msg); return err; nla_put_failure: - fprintf(stderr, "building message failed\n"); + fprintf(stderr, _("building message failed\n")); return 2; } diff --git a/tuning/tuning.cpp b/tuning/tuning.cpp index c63f1e8..3488aad 100644 --- a/tuning/tuning.cpp +++ b/tuning/tuning.cpp @@ -213,7 +213,7 @@ void html_show_tunables(void) continue; if (line == 0) { - fprintf(htmlout, "<h2>Software settings in need of tuning</h2>\n"); + fprintf(htmlout, _("<h2>Software settings in need of tuning</h2>\n")); fprintf(htmlout, "<p><table width=100%%>\n"); } @@ -228,7 +228,7 @@ void html_show_tunables(void) line = 0; for (i = 0; i < all_untunables.size(); i++) { if (line == 0) { - fprintf(htmlout, "<h2>Untunable software issues</h2>\n"); + fprintf(htmlout, _("<h2>Untunable software issues</h2>\n")); fprintf(htmlout, "<p><table width=100%%>\n"); } @@ -250,7 +250,7 @@ void html_show_tunables(void) continue; if (line == 0) { - fprintf(htmlout, "<h2>Optimal tuned software settings</h2>\n"); + fprintf(htmlout, _("<h2>Optimal tuned software settings</h2>\n")); fprintf(htmlout, "<p><table width=100%%>\n"); } -- 1.7.2.2 _______________________________________________ Power mailing list [email protected] http://www.bughost.org/mailman/listinfo/power
