alternative to assert
[gtkD.git] / src / glib / Internationalization.d
blobcfdda47782abd09ca4555fbfb44d0568e7524005
1 /*
2 * This file is part of duit.
4 * duit is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU Lesser General Public License as published by
6 * the Free Software Foundation; either version 2.1 of the License, or
7 * (at your option) any later version.
9 * duit is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU Lesser General Public License for more details.
14 * You should have received a copy of the GNU Lesser General Public License
15 * along with duit; if not, write to the Free Software
16 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 // generated automatically - do not change
20 // find conversion definition on APILookup.txt
21 // implement new conversion functionalities on the wrap.utils pakage
24 * Conversion parameters:
25 * inFile = glib-I18N.html
26 * outPack = glib
27 * outFile = Internationalization
28 * strct =
29 * realStrct=
30 * ctorStrct=
31 * clss = Internationalization
32 * interf =
33 * class Code: No
34 * interface Code: No
35 * template for:
36 * extend =
37 * implements:
38 * prefixes:
39 * - g_
40 * omit structs:
41 * omit prefixes:
42 * omit code:
43 * imports:
44 * - glib.Str
45 * structWrap:
46 * local aliases:
49 module glib.Internationalization;
51 private import glib.glibtypes;
53 private import lib.glib;
55 private import glib.Str;
57 /**
58 * Description
59 * GLib doesn't force any particular localization method upon its users.
60 * But since GLib itself is localized using the gettext() mechanism, it seems
61 * natural to offer the de-facto standard gettext() support macros in an
62 * easy-to-use form.
63 * In order to use these macros in an application, you must include
64 * glib/gi18n.h. For use in a library, must include
65 * glib/gi18n-lib.h after defining
66 * the GETTEXT_PACKAGE macro suitably for your library:
67 * #define GETTEXT_PACKAGE "gtk20"
68 * #include <glib/gi18n-lib.h>
70 public class Internationalization
73 /**
79 /**
80 * An auxiliary function for gettext() support (see Q_()).
81 * msgid:
82 * a string
83 * msgval:
84 * another string
85 * Returns:
86 * msgval, unless msgval is identical to msgid and contains
87 * a '|' character, in which case a pointer to the substring of msgid after
88 * the first '|' character is returned.
89 * Since 2.4
91 public static char[] stripContext(char[] msgid, char[] msgval)
93 // const gchar* g_strip_context (const gchar *msgid, const gchar *msgval);
94 return Str.toString(g_strip_context(Str.toStringz(msgid), Str.toStringz(msgval)) );
97 /**
98 * Computes a list of applicable locale names, which can be used to
99 * e.g. construct locale-dependent filenames or search paths. The returned
100 * list is sorted from most desirable to least desirable and always contains
101 * the default locale "C".
102 * For example, if LANGUAGE=de:en_US, then the returned list is
103 * "de", "en_US", "en", "C".
104 * This function consults the environment variables LANGUAGE,
105 * LC_ALL, LC_MESSAGES and LANG
106 * to find the list of locales specified by the user.
107 * Returns:
108 * a NULL-terminated array of strings owned by GLib
109 * that must not be modified or freed.
110 * Since 2.6
111 * See Also
112 * The gettext manual.
114 public static char** getLanguageNames()
116 // const gchar* const * g_get_language_names (void);
117 return g_get_language_names();