ECGetText.h 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. /*
  2. * Copyright 2005 - 2016 Zarafa and its licensors
  3. *
  4. * This program is free software: you can redistribute it and/or modify
  5. * it under the terms of the GNU Affero General Public License, version 3,
  6. * as published by the Free Software Foundation.
  7. *
  8. * This program is distributed in the hope that it will be useful,
  9. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  11. * GNU Affero General Public License for more details.
  12. *
  13. * You should have received a copy of the GNU Affero General Public License
  14. * along with this program. If not, see <http://www.gnu.org/licenses/>.
  15. *
  16. */
  17. #ifndef ECGetText_INCLUDED
  18. #define ECGetText_INCLUDED
  19. #ifndef NO_GETTEXT
  20. # include <kopano/zcdefs.h>
  21. #include <libintl.h>
  22. #define _A(string) dcgettext("kopano", string, LC_MESSAGES)
  23. #define _W(string) kopano_dcgettext_wide("kopano", string)
  24. namespace KC {
  25. extern _kc_export LPWSTR kopano_dcgettext_wide(const char *domainname, const char *msgid);
  26. }
  27. #else
  28. #define _A(string) string
  29. #define _W(string) _T(string)
  30. #endif
  31. // This must go. Obviously someone was trying to be clever, but a macro named _
  32. // can cause all sorts of mischief that can be hard to trace. Unfortunately
  33. // it's in use in 51 different files all over the project, so changing it is
  34. // a bit of a bother. NS 16 October 2013
  35. #ifdef UNICODE
  36. #define _(string) _W(string)
  37. #else
  38. #define _(string) _A(string)
  39. #endif
  40. #endif // ndef ECGetText_INCLUDED