- added gettext interface
[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  * \todo Use config.h for TEXTDOMAIN/LOCALEDIR.
14 */
15 #ifndef ZYPP_BASE_GETTEXT_H
16 #define ZYPP_BASE_GETTEXT_H
17
18 /** Just tag text for translation. */
19 #define N_(MSG) MSG
20
21 /** Return translated text. */
22 #define _(MSG) ::zypp::gettext::dgettext( MSG )
23
24 /** Return translated text (plural form). */
25 #define _PL(MSG1,MSG2,N) ::zypp::gettext::dngettext( MSG1; MSG2, N )
26
27 ///////////////////////////////////////////////////////////////////
28 namespace zypp
29 { /////////////////////////////////////////////////////////////////
30   ///////////////////////////////////////////////////////////////////
31   namespace gettext
32   { /////////////////////////////////////////////////////////////////
33
34     /** Return translated text. */
35     const char * dgettext( const char * msgid );
36
37     /** Return translated text (plural form). */
38     const char * dngettext( const char * msgid1, const char * msgid2,
39                             unsigned long n );
40
41     /////////////////////////////////////////////////////////////////
42   } // namespace gettext
43   ///////////////////////////////////////////////////////////////////
44   /////////////////////////////////////////////////////////////////
45 } // namespace zypp
46 ///////////////////////////////////////////////////////////////////
47 #endif // ZYPP_BASE_GETTEXT_H