Imported Upstream version 14.45.0
[platform/upstream/libzypp.git] / zypp / base / Gettext.h
1 /*---------------------------------------------------------------------\
2 |                          ____ _   __ __ ___                          |
3 |                         |__  / \ / / . \ . \                         |
4 |                           / / \ V /|  _/  _/                         |
5 |                          / /__ | | | | | |                           |
6 |                         /_____||_| |_| |_|                           |
7 |                                                                      |
8 \---------------------------------------------------------------------*/
9 /** \file       zypp/base/Gettext.h
10  *
11  * Interface to gettext.
12  *
13 */
14 #ifndef ZYPP_BASE_GETTEXT_H
15 #define ZYPP_BASE_GETTEXT_H
16
17 /** Just tag text for translation. */
18 #define N_(MSG) MSG
19
20 #ifdef ZYPP_DLL //defined if zypp is compiled as DLL
21
22 /** Return translated text. */
23 #define _(MSG) ::zypp::gettext::dgettext( MSG )
24
25 /** Return translated text (plural form). */
26 #define _PL(MSG1,MSG2,N) ::zypp::gettext::dngettext( MSG1, MSG2, N )
27
28 #else
29 #define _(MSG) ::gettext( MSG )
30 #define _PL(MSG1,MSG2,N) ::ngettext( MSG1, MSG2, N )
31 #endif
32
33 ///////////////////////////////////////////////////////////////////
34 namespace zypp
35 { /////////////////////////////////////////////////////////////////
36   ///////////////////////////////////////////////////////////////////
37   namespace gettext
38   { /////////////////////////////////////////////////////////////////
39
40     /** Return translated text. */
41     const char * dgettext( const char * msgid );
42
43     /** Return translated text (plural form). */
44     const char * dngettext( const char * msgid1, const char * msgid2,
45                             unsigned long n );
46
47     /////////////////////////////////////////////////////////////////
48   } // namespace gettext
49   ///////////////////////////////////////////////////////////////////
50   /////////////////////////////////////////////////////////////////
51 } // namespace zypp
52 ///////////////////////////////////////////////////////////////////
53 #endif // ZYPP_BASE_GETTEXT_H