~ubuntu-branches/debian/sid/gsmartcontrol/sid

« back to all changes in this revision

Viewing changes to src/hz/i18n.h

  • Committer: Package Import Robot
  • Author(s): Giuseppe Iuculano
  • Date: 2013-05-31 11:41:52 UTC
  • mfrom: (1.1.4)
  • Revision ID: package-import@ubuntu.com-20130531114152-5ljhkuswwpt4kdwo
Tags: 0.8.7-1
* [314881d] Updated debian/watch
* [18ebada] Imported Upstream version 0.8.7
* [c2a1f1b] debian/rules: Provide build-arch and build-indep
* [d3036a4] Enabled Hardening Options
* [2edfb87] Refreshed patches and removed patches apllied upstream
* [ac3b953] Bump to standard versions 3.9.4
* [292c276] Remove quilt from depends

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/**************************************************************************
2
2
 Copyright:
3
 
      (C) 2008 - 2011  Alexander Shaduri <ashaduri 'at' gmail.com>
 
3
      (C) 2008 - 2012  Alexander Shaduri <ashaduri 'at' gmail.com>
4
4
 License: See LICENSE_zlib.txt file
5
5
***************************************************************************/
 
6
/// \file
 
7
/// \author Alexander Shaduri
 
8
/// \ingroup hz
 
9
/// \weakgroup hz
 
10
/// @{
6
11
 
7
12
#ifndef HZ_I18N_H
8
13
#define HZ_I18N_H
10
15
#include "hz_config.h"  // feature macros
11
16
 
12
17
 
13
 
// Gettext bridge for internationalization. Sort of like gettext.h,
14
 
// but a lot simpler / lighter.
15
 
// This file is for internal use in hz. The application is expected
16
 
// to use gettext.h or similar mechanisms.
 
18
/**
 
19
\file
 
20
Gettext bridge for internationalization. Sort of like gettext.h,
 
21
but a lot simpler / lighter.
 
22
This file is for internal use in hz. The application is expected
 
23
to use gettext.h or similar mechanisms.
17
24
 
18
 
// Note: If you are using UTF-8 to display messages in your application
19
 
// but system locale is not UTF-8, then you need to call gettext's
20
 
// bind_textdomain_codeset(package, "UTF-8");
21
 
// to enable locale -> UTF-8 conversion for translated messages.
 
25
Note: If you are using UTF-8 to display messages in your application
 
26
but system locale is not UTF-8, then you need to call gettext's
 
27
bind_textdomain_codeset(package, "UTF-8");
 
28
to enable locale -> UTF-8 conversion for translated messages.
 
29
*/
22
30
 
23
31
 
24
32
namespace hz {
25
33
 
26
34
 
27
 
// Usually NLS can be disabled through the configure --disable-nls option.
 
35
/// \def ENABLE_NLS
 
36
/// Defined to 0 or 1. If 1, enable native language support.
 
37
/// Usually NLS can be disabled through the configure --disable-nls option.
28
38
#if defined ENABLE_NLS && ENABLE_NLS
29
39
 
30
40
        #include <libintl.h>  // gettext functions
66
76
 
67
77
        // ------- Mark and translate
68
78
 
69
 
        // The main gettext function. Marks and translates at runtime.
70
 
        // You need to pass --keyword=HZ__ to xgettext when extracting messages.
 
79
        /// The main gettext function. Marks and translates at runtime.
 
80
        /// You need to pass --keyword=HZ__ to xgettext when extracting messages.
71
81
        #define HZ__(String) gettext(String)
72
82
 
73
 
        // Same as above, but specifies a context too, to e.g.
74
 
        // disambiguate two "Open" menu entries as ("File", "Open") and ("Printer", "Open").
75
 
        // You MUST pass --keyword=C_:1c,2 to xgettext when extracting messages.
 
83
        /// Same as HZ__(), but specifies a context too, to e.g.
 
84
        /// disambiguate two "Open" menu entries as ("File", "Open") and ("Printer", "Open").
 
85
        /// You MUST pass --keyword=C_:1c,2 to xgettext when extracting messages.
76
86
        #define HZ_C_(Context, String) i18n_C_helper((Context "\004" String), (String))
77
87
 
78
88
 
79
89
        // ------- Mark only
80
90
 
81
 
        // The no-op marking of a string for translation.
82
 
        // You MUST pass --keyword=HZ_N_ to xgettext when extracting messages.
 
91
        /// The no-op marking of a string for translation.
 
92
        /// You MUST pass --keyword=HZ_N_ to xgettext when extracting messages.
83
93
        #define HZ_N_(String) (String)
84
94
 
85
 
        // Same as above, but accepts context too.
86
 
        // --keyword=HZ_NC_:1c,2
 
95
        /// Same as HZ_N_(), but accepts context too.
 
96
        /// --keyword=HZ_NC_:1c,2
87
97
        #define HZ_NC_(Context, String) (String)
88
98
 
89
99
 
90
100
        // ------- Translate only
91
101
 
92
 
        // Translate a dynamic string.
 
102
        /// Translate a dynamic string.
93
103
        #define HZ_R_(String) gettext(String)
94
104
 
95
 
        // Same as above, but accepts context too.
 
105
        /// Same as HZ_R_(), but accepts context too.
96
106
        #define HZ_RC_(Context, String) i18n_R_helper((Context), (String))
97
107
 
98
108
 
115
125
 
116
126
 
117
127
#endif
 
128
 
 
129
/// @}