]> git.lyx.org Git - lyx.git/blob - src/gettext.C
Dekels tabular/textinset patches
[lyx.git] / src / gettext.C
1 #include <config.h>
2
3 #include "LString.h"
4 #include "gettext.h"
5
6 #ifdef ENABLE_NLS
7
8 char const * _(char const * str)
9 {
10         // I'd rather have an Assert on str, we should not allow
11         // null pointers here. Lgb
12         // Assert(str);
13         if (str && str[0])
14                 return gettext(str);
15         else
16                 return "";
17 }
18
19
20 string const _(string const & str) 
21 {
22         if (!str.empty()) {
23                 int const s = str.length();
24                 char * tmp = new char[s + 1];
25                 str.copy(tmp, s);
26                 tmp[s] = '\0';
27                 string ret(gettext(tmp));
28                 delete [] tmp;
29                 return ret;
30         }
31         else
32                 return string();
33 }
34
35 #endif