From 726a70527594fac7a88dea7d30f2ba854ee9e014 Mon Sep 17 00:00:00 2001 From: Alastair Poole Date: Mon, 29 Mar 2021 07:59:01 +0100 Subject: [PATCH] intl: translatable. --- src/bin/system/process.c | 35 +++++++++++++++++++---------------- src/bin/ui/ui_process_list.c | 30 +++++++++++++++--------------- 2 files changed, 34 insertions(+), 31 deletions(-) diff --git a/src/bin/system/process.c b/src/bin/system/process.c index 071ad4d..12693fc 100644 --- a/src/bin/system/process.c +++ b/src/bin/system/process.c @@ -2,6 +2,9 @@ # define __MacOS__ #endif +#include "ui/gettext.h" +#define _(STR) gettext(STR) + #if defined(__MacOS__) || defined(__FreeBSD__) || defined(__DragonFly__) || defined(__OpenBSD__) # include # include @@ -70,27 +73,27 @@ static void _states_init(void) { #if defined(__linux__) - _states['D'] = "dsleep"; - _states['I'] = "idle"; - _states['R'] = "running"; - _states['S'] = "sleeping"; - _states['T'] = "stopped"; - _states['X'] = "dead"; - _states['Z'] = "zombie"; + _states['D'] = _("dsleep"); + _states['I'] = _("idle"); + _states['R'] = _("running"); + _states['S'] = _("sleeping"); + _states['T'] = _("stopped"); + _states['X'] = _("dead"); + _states['Z'] = _("zombie"); #else - _states[SIDL] = "idle"; - _states[SRUN] = "running"; - _states[SSLEEP] = "sleeping"; - _states[SSTOP] = "stopped"; + _states[SIDL] = _("idle"); + _states[SRUN] = _("running"); + _states[SSLEEP] = _("sleeping"); + _states[SSTOP] = _("stopped"); #if !defined(__MacOS__) #if !defined(__OpenBSD__) - _states[SWAIT] = "wait"; - _states[SLOCK] = "lock"; - _states[SZOMB] = "zombie"; + _states[SWAIT] = _("wait"); + _states[SLOCK] = _("lock"); + _states[SZOMB] = _("zombie"); #endif #if defined(__OpenBSD__) - _states[SDEAD] = "zombie"; - _states[SONPROC] = "running"; + _states[SDEAD] = _("zombie"); + _states[SONPROC] = _("running"); #endif #endif #endif diff --git a/src/bin/ui/ui_process_list.c b/src/bin/ui/ui_process_list.c index 9ccd3a4..5d31b7a 100644 --- a/src/bin/ui/ui_process_list.c +++ b/src/bin/ui/ui_process_list.c @@ -885,21 +885,21 @@ _summary_update(Data *pd) { Eina_Strbuf *buf = eina_strbuf_new(); - eina_strbuf_append_printf(buf, "%i processes: ", pd->summary.total); + eina_strbuf_append_printf(buf, _("%i processes: "), pd->summary.total); if (pd->summary.running) - eina_strbuf_append_printf(buf, "%i running, ", pd->summary.running); + eina_strbuf_append_printf(buf, _("%i running, "), pd->summary.running); if (pd->summary.sleeping) - eina_strbuf_append_printf(buf, "%i sleeping, ", pd->summary.sleeping); + eina_strbuf_append_printf(buf, _("%i sleeping, "), pd->summary.sleeping); if (pd->summary.stopped) - eina_strbuf_append_printf(buf, "%i stopped, ", pd->summary.stopped); + eina_strbuf_append_printf(buf, _("%i stopped, "), pd->summary.stopped); if (pd->summary.idle) - eina_strbuf_append_printf(buf, "%i idle, ", pd->summary.idle); + eina_strbuf_append_printf(buf, _("%i idle, "), pd->summary.idle); if (pd->summary.dead) - eina_strbuf_append_printf(buf, "%i dead, ", pd->summary.dead); + eina_strbuf_append_printf(buf, _("%i dead, "), pd->summary.dead); if (pd->summary.dsleep) - eina_strbuf_append_printf(buf, "%i dsleep, ", pd->summary.dsleep); + eina_strbuf_append_printf(buf, _("%i dsleep, "), pd->summary.dsleep); if (pd->summary.zombie) - eina_strbuf_append_printf(buf, "%i zombie, ", pd->summary.zombie); + eina_strbuf_append_printf(buf, _("%i zombie, "), pd->summary.zombie); eina_strbuf_replace_last(buf, ",", "."); @@ -912,19 +912,19 @@ static void _summary_total(Data *pd, Proc_Info *proc) { pd->summary.total++; - if (!strcmp(proc->state, "running")) + if (!strcmp(proc->state, _("running"))) pd->summary.running++; - else if (!strcmp(proc->state, "sleeping")) + else if (!strcmp(proc->state, _("sleeping"))) pd->summary.sleeping++; - else if (!strcmp(proc->state, "stopped")) + else if (!strcmp(proc->state, _("stopped"))) pd->summary.stopped++; - else if (!strcmp(proc->state, "idle")) + else if (!strcmp(proc->state, _("idle"))) pd->summary.idle++; - else if (!strcmp(proc->state, "zombie")) + else if (!strcmp(proc->state, _("zombie"))) pd->summary.zombie++; - else if (!strcmp(proc->state, "dead")) + else if (!strcmp(proc->state, _("dead"))) pd->summary.dead++; - else if (!strcmp(proc->state, "dsleep")) + else if (!strcmp(proc->state, _("dsleep"))) pd->summary.dsleep++; }