Another way might be like:
```c
#define ADD_KB_CUSTOM_COMMAND(n, key, mod) \
add_kb(group, GEANY_KEYS_FORMAT_SENTOCMD##n, NULL, key, mod, \
"edit_sentocmd"#n, _("Send to Custom Command "#n), NULL)
```
Not sure if that works for gettext scanning or translations though.
Alternatively, we could use `g_intern_string()` which will copy the given
string, then we can free our formatted one, to avoid "leaking" it like:
```c
#define ADD_KB_CUSTOM_COMMAND(n, key, mod) \
do { \
gchar *label = g_strdup_printf(_("Send to Custom Command %d"),
n); \
add_kb(group, GEANY_KEYS_FORMAT_SENDTOCMD##n, NULL, key, mod, \
"edit_sendtocmd"#n, g_intern_string(label),
NULL); \
g_free(label); \
} while(0)
```
Or just leak them...
---
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/geany/geany/pull/1058#issuecomment-224773699