]> git.donarmstrong.com Git - lilypond.git/blob - flower/international.cc
78dc3ddb3c363e5fc7caa6bf176fad280f2d707b
[lilypond.git] / flower / international.cc
1 /*
2   international.cc -- implement stuff for internationalisation
3
4   source file of the GNU LilyPond music typesetter
5
6   (c) 1997--2007 Jan Nieuwenhuizen <janneke@gnu.org>
7 */
8
9 #include "config.hh"
10
11 #include "international.hh"
12 #include "string-convert.hh"
13
14 #if !HAVE_GETTEXT
15 inline char *
16 gettext (char const *s)
17 {
18   return (char *)s;
19 }
20 #else
21 #include <libintl.h>
22 #endif
23
24 string
25 _ (char const *ch)
26 {
27   return string (gettext (ch));
28 }
29
30 string
31 _f (char const *format, ...)
32 {
33   va_list args;
34   va_start (args, format);
35   string str = v_f (format, args);
36   va_end (args);
37   return str;
38 }
39
40 string
41 v_f (char const *format, va_list args)
42 {
43   return String_convert::vform_string (gettext (format), args);
44 }
45
46 string
47 _f (char const *format, string s, string s2, string s3)
48 {
49   return String_convert::form_string (gettext (format), s.c_str (), s2.c_str (),
50                                       s3.c_str ());
51 }