~ubuntu-branches/ubuntu/karmic/regexxer/karmic

« back to all changes in this revision

Viewing changes to src/translation.h

  • Committer: Bazaar Package Importer
  • Author(s): Daniel Holbach
  • Date: 2007-02-19 11:28:21 UTC
  • mfrom: (1.1.2 upstream)
  • Revision ID: james.westby@ubuntu.com-20070219112821-3w5j8kdhwiar1uoh
Tags: 0.9-0ubuntu1
* New upstream release:
  - Command line option support
  - Icon theme support
  - Now builds a working executable on systems with newer libglade
  - New GTK+ file chooser button
  - Replaced about dialog with stock GTK+ one
  - Completely revamped build system
  - Lots of new translations: bg ca dz es eu fi fr hu ne pa pl sl sr 
    sr@Latn uk vi zh_CN zh_HK zh_TW
  - Other minor cleanups and fixes

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/* $Id: translation.h,v 1.4 2004/06/09 15:36:28 daniel Exp $
2
 
 *
3
 
 * Copyright (c) 2004  Daniel Elstner  <daniel.elstner@gmx.net>
4
 
 *
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.
10
 
 *
11
 
 * This program is distributed in the hope that it will be useful,
 
1
/*
 
2
 * Copyright (c) 2002-2007  Daniel Elstner  <daniel.kitta@gmail.com>
 
3
 *
 
4
 * This file is part of regexxer.
 
5
 *
 
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.
 
10
 *
 
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.
15
15
 *
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
19
19
 */
20
20
 
21
21
#ifndef REGEXXER_TRANSLATION_H_INCLUDED
35
35
{
36
36
 
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);
39
 
 
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);
 
39
 
 
40
Glib::ustring compose_argv(const char* format, int argc, const Glib::ustring *const * argv);
 
41
 
 
42
/*
 
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.
 
47
 *
 
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().
 
51
 */
 
52
inline
 
53
Glib::ustring compose(const char* format, const Glib::ustring& s1)
 
54
{
 
55
  const Glib::ustring *const argv[] = { &s1 };
 
56
  return compose_argv(format, G_N_ELEMENTS(argv), argv);
 
57
}
 
58
 
 
59
inline
 
60
Glib::ustring compose(const char* format, const Glib::ustring& s1, const Glib::ustring& s2)
 
61
{
 
62
  const Glib::ustring *const argv[] = { &s1, &s2 };
 
63
  return compose_argv(format, G_N_ELEMENTS(argv), argv);
 
64
}
 
65
 
 
66
inline
 
67
Glib::ustring compose(const char* format, const Glib::ustring& s1, const Glib::ustring& s2,
 
68
                                          const Glib::ustring& s3)
 
69
{
 
70
  const Glib::ustring *const argv[] = { &s1, &s2, &s3 };
 
71
  return compose_argv(format, G_N_ELEMENTS(argv), argv);
 
72
}
46
73
 
47
74
} // namespace Util
48
75
 
49
76
#endif /* REGEXXER_TRANSLATION_H_INCLUDED */
50