Re: [gtkmm] Button with icon?
- From: Ole Laursen <olau hardworking dk>
- To: gtkmm-list gnome org
- Subject: Re: [gtkmm] Button with icon?
- Date: 24 Jan 2003 20:43:54 +0100
Paul Davis <paul linuxaudiosystems com> writes:
[...]
> the _() macro is part of the gettext internationalization system. its
> not just an include. you need to setup gettext for your application.
In case you are wondering how, here's what I do, mostly grabbed
somewhere else from. I have an i18n.hpp header:
#ifndef GETTEXT_PACKAGE
#error "config.h must be included prior to i18n.hpp"
#endif
#include <libintl.h>
#include <locale.h>
#ifdef _
#undef _
#endif
#ifdef N_
#undef N_
#endif
#define _(x) gettext (x)
#define N_(x) x
In main() you then need something like:
#include <config.h>
#include <libintl.h>
// ...
int main(int argc, char *argv[])
{
// ...
bind_textdomain_codeset(GETTEXT_PACKAGE, "UTF-8");
textdomain(GETTEXT_PACKAGE);
// ...
}
If you want to allow your users to configure the location for the i18n
files, you also need to use bindtextdomain(package_name, directory).
--
Ole Laursen
http://www.cs.auc.dk/~olau/
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]