mirror of
https://github.com/gryf/wmaker.git
synced 2025-12-19 12:28:22 +01:00
wmaker: Avoid multiple calls to gettext
The original code called gettext twice every time, the new code calls it only once. Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
This commit is contained in:
committed by
Carlos R. Mafra
parent
667bb9191b
commit
1f17fb940c
@@ -94,8 +94,15 @@ int wWorkspaceNew(WScreen *scr)
|
||||
wspace->clip = NULL;
|
||||
|
||||
if (!wspace->name) {
|
||||
wspace->name = wmalloc(strlen(_("Workspace %i")) + 8);
|
||||
sprintf(wspace->name, _("Workspace %i"), w_global.workspace.count);
|
||||
static const char *new_name = NULL;
|
||||
static size_t name_length;
|
||||
|
||||
if (new_name == NULL) {
|
||||
new_name = _("Workspace %i");
|
||||
name_length = strlen(new_name) + 8;
|
||||
}
|
||||
wspace->name = wmalloc(name_length);
|
||||
snprintf(wspace->name, name_length, new_name, w_global.workspace.count);
|
||||
}
|
||||
|
||||
if (!wPreferences.flags.noclip)
|
||||
|
||||
Reference in New Issue
Block a user