1
/* $Id: translation.h,v 1.4 2004/06/09 15:36:28 daniel Exp $
3
* Copyright (c) 2004 Daniel Elstner <daniel.elstner@gmx.net>
5
* This program is free software; you can redistribute it and/or modify
6
* it under the terms of the GNU General Public License VERSION 2 as
7
* published by the Free Software Foundation. You are not allowed to
8
* use any other version of the license; unless you got the explicit
9
* permission from the author to do so.
11
* This program is distributed in the hope that it will be useful,
2
* Copyright (c) 2002-2007 Daniel Elstner <daniel.kitta@gmail.com>
4
* This file is part of regexxer.
6
* regexxer is free software; you can redistribute it and/or modify
7
* it under the terms of the GNU General Public License as published by
8
* the Free Software Foundation; either version 2 of the License, or
9
* (at your option) any later version.
11
* regexxer is distributed in the hope that it will be useful,
12
12
* but WITHOUT ANY WARRANTY; without even the implied warranty of
13
13
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
14
* GNU General Public License for more details.
16
16
* You should have received a copy of the GNU General Public License
17
* along with this program; if not, write to the Free Software
18
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17
* along with regexxer; if not, write to the Free Software Foundation,
18
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
21
21
#ifndef REGEXXER_TRANSLATION_H_INCLUDED
37
37
void initialize_gettext(const char* domain, const char* localedir);
38
const char* translate(const char* msgid) G_GNUC_PURE G_GNUC_FORMAT(1);
40
Glib::ustring compose(const Glib::ustring& format, const Glib::ustring& arg1);
41
Glib::ustring compose(const Glib::ustring& format, const Glib::ustring& arg1,
42
const Glib::ustring& arg2);
43
Glib::ustring compose(const Glib::ustring& format, const Glib::ustring& arg1,
44
const Glib::ustring& arg2,
45
const Glib::ustring& arg3);
38
const char* translate(const char* msgid) G_GNUC_FORMAT(1);
40
Glib::ustring compose_argv(const char* format, int argc, const Glib::ustring *const * argv);
43
* The compose functions substitute placeholders in a format string with
44
* the referenced arguments. The template string should be in qt-format,
45
* that is "%1", "%2", ..., "%9" are used as placeholders and "%%" denotes
46
* a literal "%". Substitutions may be reordered.
48
* Note that the format argument is of type const char* because the format
49
* should generally not be computed. It should be either a literal string
50
* or the result of a call to Util::translate().
53
Glib::ustring compose(const char* format, const Glib::ustring& s1)
55
const Glib::ustring *const argv[] = { &s1 };
56
return compose_argv(format, G_N_ELEMENTS(argv), argv);
60
Glib::ustring compose(const char* format, const Glib::ustring& s1, const Glib::ustring& s2)
62
const Glib::ustring *const argv[] = { &s1, &s2 };
63
return compose_argv(format, G_N_ELEMENTS(argv), argv);
67
Glib::ustring compose(const char* format, const Glib::ustring& s1, const Glib::ustring& s2,
68
const Glib::ustring& s3)
70
const Glib::ustring *const argv[] = { &s1, &s2, &s3 };
71
return compose_argv(format, G_N_ELEMENTS(argv), argv);
47
74
} // namespace Util
49
76
#endif /* REGEXXER_TRANSLATION_H_INCLUDED */