~mateo-salta/touch-rss-scope/utfeed1

« back to all changes in this revision

Viewing changes to include/scope/localization.h

  • Committer: Mateo Salta
  • Date: 2014-11-30 22:43:28 UTC
  • Revision ID: mateo_salta@yahoo.com-20141130224328-1bshkjh7chb1kwvs
- Added 4 more custom feeds

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#ifndef SCOPE_LOCALIZATION_H_
 
2
#define SCOPE_LOCALIZATION_H_
 
3
 
 
4
#include <libintl.h>
 
5
#include <string>
 
6
 
 
7
inline char * _(const char *__msgid) {
 
8
    return dgettext(GETTEXT_PACKAGE, __msgid);
 
9
}
 
10
 
 
11
inline std::string _(const char *__msgid1, const char *__msgid2,
 
12
                     unsigned long int __n) {
 
13
    char buffer [256];
 
14
    if (snprintf ( buffer, 256, dngettext(GETTEXT_PACKAGE, __msgid1, __msgid2, __n), __n ) >= 0) {
 
15
        return buffer;
 
16
    } else {
 
17
        return std::string();
 
18
    }
 
19
}
 
20
 
 
21
#endif // SCOPE_LOCALIZATION_H_
 
22
 
 
23