2000-10-11 21:06:43 +00:00
|
|
|
#include <config.h>
|
|
|
|
|
|
|
|
#include "LString.h"
|
|
|
|
#include "gettext.h"
|
|
|
|
|
2000-10-12 02:17:32 +00:00
|
|
|
#ifdef ENABLE_NLS
|
2000-10-11 21:06:43 +00:00
|
|
|
|
|
|
|
char const * _(char const * str)
|
|
|
|
{
|
2001-01-08 09:37:13 +00:00
|
|
|
// I'd rather have an Assert on str, we should not allow
|
|
|
|
// null pointers here. Lgb
|
|
|
|
// Assert(str);
|
2001-01-03 17:43:29 +00:00
|
|
|
if (str && str[0])
|
|
|
|
return gettext(str);
|
|
|
|
else
|
|
|
|
return "";
|
2000-10-11 21:06:43 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
string const _(string const & str)
|
|
|
|
{
|
2001-01-03 17:43:29 +00:00
|
|
|
if (!str.empty()) {
|
|
|
|
int const s = str.length();
|
|
|
|
char * tmp = new char[s + 1];
|
|
|
|
str.copy(tmp, s);
|
|
|
|
tmp[s] = '\0';
|
|
|
|
string ret(gettext(tmp));
|
|
|
|
delete [] tmp;
|
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
return string();
|
2000-10-11 21:06:43 +00:00
|
|
|
}
|
2000-10-12 02:17:32 +00:00
|
|
|
|
|
|
|
#endif
|