From 86dc32df289663c2e2ba5926f49fdee9c98108fe Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Wed, 23 May 2007 22:12:16 +0000 Subject: Add i18n support git-svn-id: file:///home/lennart/svn/public/paprefs/trunk@15 54a58c19-9419-0410-9bbb-d8fa3e5d54ff --- src/Makefile.am | 16 ++++++++++++---- src/paprefs.cc | 7 +++++++ src/paprefs.desktop | 11 ----------- src/paprefs.desktop.in | 11 +++++++++++ 4 files changed, 30 insertions(+), 15 deletions(-) delete mode 100644 src/paprefs.desktop create mode 100644 src/paprefs.desktop.in (limited to 'src') diff --git a/src/Makefile.am b/src/Makefile.am index 6a54d31..7729bee 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -18,14 +18,22 @@ # USA. desktopdir = $(datadir)/applications +gladedir = $(pkgdatadir) +localedir = $(datadir)/locale bin_PROGRAMS=paprefs - -dist_pkgdata_DATA=paprefs.glade -dist_desktop_DATA=paprefs.desktop +glade_DATA=paprefs.glade +desktop_in_files=paprefs.desktop.in +desktop_DATA=$(desktop_in_files:.desktop.in=.desktop) paprefs_SOURCES=paprefs.cc paprefs_LDADD=$(AM_LDADD) $(GUILIBS_LIBS) paprefs_CXXFLAGS=$(AM_CXXFLAGS) $(GUILIBS_CFLAGS) -paprefs_CXXFLAGS+=-DGLADE_FILE=\"$(pkgdatadir)/paprefs.glade\" +paprefs_CXXFLAGS+=-DGLADE_FILE=\"$(gladedir)/paprefs.glade\" -DLOCALEDIR=\"$(localedir)\" + +EXTRA_DIST = $(glade_DATA) $(desktop_in_files) + +CLEANFILES = $(desktop_DATA) + +@INTLTOOL_DESKTOP_RULE@ diff --git a/src/paprefs.cc b/src/paprefs.cc index 1fa7381..a2abfd5 100644 --- a/src/paprefs.cc +++ b/src/paprefs.cc @@ -304,7 +304,14 @@ void MainWindow::readFromGConf() { } int main(int argc, char *argv[]) { + + /* Initialize the i18n stuff */ + bindtextdomain(GETTEXT_PACKAGE, LOCALEDIR); + bind_textdomain_codeset(GETTEXT_PACKAGE, "UTF-8"); + textdomain(GETTEXT_PACKAGE); + signal(SIGPIPE, SIG_IGN); + Gtk::Main kit(argc, argv); Gnome::Conf::init(); diff --git a/src/paprefs.desktop b/src/paprefs.desktop deleted file mode 100644 index 7de90fb..0000000 --- a/src/paprefs.desktop +++ /dev/null @@ -1,11 +0,0 @@ -[Desktop Entry] -Version=1.0 -Encoding=UTF-8 -Name=PulseAudio Preferences -GenericName=Sound server Preferences -Comment=View and modify the configuration of the local sound server -Exec=paprefs -Icon=preferences-desktop -StartupNotify=true -Type=Application -Categories=Application;AudioVideo;Audio; diff --git a/src/paprefs.desktop.in b/src/paprefs.desktop.in new file mode 100644 index 0000000..5998b87 --- /dev/null +++ b/src/paprefs.desktop.in @@ -0,0 +1,11 @@ +[Desktop Entry] +Version=1.0 +Encoding=UTF-8 +_Name=PulseAudio Preferences +_GenericName=Sound Server Preferences +_Comment=View and modify the configuration of the local sound server +Exec=paprefs +Icon=preferences-desktop +StartupNotify=true +Type=Application +Categories=Application;AudioVideo;Audio; -- cgit