intl: translatable.

This commit is contained in:
Alastair Poole 2021-03-29 07:59:01 +01:00
parent ae6d5c2d15
commit 726a705275
2 changed files with 34 additions and 31 deletions

View File

@ -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 <sys/types.h>
# include <sys/sysctl.h>
@ -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

View File

@ -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++;
}