Skip to content

Instantly share code, notes, and snippets.

@agateau
Created December 24, 2010 13:31
Show Gist options
  • Save agateau/754235 to your computer and use it in GitHub Desktop.
Save agateau/754235 to your computer and use it in GitHub Desktop.
Debug issues when strings get too wide to fit a window by prefixing translated strings with a custom string
QString wide_prefix()
{
return qgetenv("WIDE");
}
inline QString wide_i18n(const char* txt)
{
return wide_prefix() + i18n(txt);
}
template <typename A1>
inline QString wide_i18n(const char* txt, const A1& a1)
{
return wide_prefix() + i18n(txt, a1);
}
#define i18n(x, ...) wide_i18n((x), ## __VA_ARGS__)
#define i18nc(c, x, ...) i18n((x), ## __VA_ARGS__)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment