+ABOUT-NLS
+common/
+intltool-extract.in
+intltool-merge.in
+intltool-update.in
*~
*.tar.gz
*.pc
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
# USA.
+ACLOCAL_AMFLAGS = -I common
+
EXTRA_DIST = bootstrap.sh LICENSE GPL LGPL doxygen/Makefile.am doxygen/Makefile.in doxygen/doxygen.conf.in README todo
-SUBDIRS=src doxygen man
+SUBDIRS=src doxygen man po
MAINTAINERCLEANFILES =
noinst_DATA =
fi
.PHONY: homepage distcleancheck doxygen
+
+DISTCLEANFILES = \
+ po/.intltool-merge-cache
local V
V=$(echo "$2" | sed -e 's,\.,,g')
-
+
if [ -e "`which $1$V 2> /dev/null`" ] ; then
- P="$1$V"
+ P="$1$V"
else
if [ -e "`which $1-$2 2> /dev/null`" ] ; then
- P="$1-$2"
+ P="$1-$2"
else
P="$1"
fi
if [ "x$1" = "xam" ] ; then
run_versioned automake "$VERSION" -a -c --foreign
./config.status
-else
+else
rm -rf autom4te.cache
rm -f config.cache
+ rm -f Makefile.am~ configure.ac~
+ # Evil, evil, evil, evil hack
+ sed 's/read dummy/\#/' `which gettextize` | sh -s -- --copy --force
+ test -f Makefile.am~ && mv Makefile.am~ Makefile.am
+ test -f configure.ac~ && mv configure.ac~ configure.ac
+
touch config.rpath
test "x$LIBTOOLIZE" = "x" && LIBTOOLIZE=libtoolize
+ intltoolize --copy --force --automake
"$LIBTOOLIZE" -c --force --ltdl
- run_versioned aclocal "$VERSION"
+ run_versioned aclocal "$VERSION" -I common
run_versioned autoconf 2.59 -Wall
run_versioned autoheader 2.59
run_versioned automake "$VERSION" --copy --foreign --add-missing
if test "x$NOCONFIGURE" = "x"; then
- CFLAGS="-g -O0" ./configure --sysconfdir=/etc --localstatedir=/var --enable-force-preopen "$@"
+ CFLAGS="-g -O0" ./configure --sysconfdir=/etc --localstatedir=/var --enable-force-preopen "$@"
make clean
fi
fi
AM_ICONV
+AM_GNU_GETTEXT([external])
+
+IT_PROG_INTLTOOL([0.35.0])
+GETTEXT_PACKAGE=pulseaudio
+AC_SUBST([GETTEXT_PACKAGE])
+AC_DEFINE_UNQUOTED([GETTEXT_PACKAGE],["$GETTEXT_PACKAGE"],[Gettext package])
+AM_GLIB_GNU_GETTEXT
+
+pulselocaledir='${prefix}/${DATADIRNAME}/locale'
+AC_SUBST(pulselocaledir)
+
###################################
# External libraries #
###################################
doxygen/Makefile
doxygen/doxygen.conf
src/pulse/version.h
+po/Makefile.in
])
AC_OUTPUT
--- /dev/null
+Makefile.in.in
+Makevars.template
+POTFILES
+Rules-quot
+boldquot.sed
+en@boldquot.header
+en@quot.header
+insert-header.sin
+pulseaudio.pot
+quot.sed
+remove-potcdate.sin
+ChangeLog
--- /dev/null
+src/modules/module-rescue-streams.c
+src/modules/module-tunnel.c
+src/modules/module-native-protocol-fd.c
+src/modules/module-zeroconf-discover.c
+src/modules/module-alsa-source.c
+src/modules/module-device-restore.c
+src/modules/module-match.c
+src/modules/dbus-util.c
+src/modules/module-console-kit.c
+src/modules/module-oss.c
+src/modules/oss-util.c
+src/modules/module-mmkbd-evdev.c
+src/modules/module-position-event-sounds.c
+src/modules/alsa-util.c
+src/modules/module-pipe-source.c
+src/modules/module-solaris.c
+src/modules/module-default-device-restore.c
+src/modules/module-x11-xsmp.c
+src/modules/module-remap-sink.c
+src/modules/module-bt-proximity.c
+src/modules/module-detect.c
+src/modules/module-always-sink.c
+src/modules/module-lirc.c
+src/modules/module-hal-detect.c
+src/modules/module-sine.c
+src/modules/module-zeroconf-publish.c
+src/modules/module-jack-source.c
+src/modules/module-cli.c
+src/modules/gconf/module-gconf.c
+src/modules/gconf/gconf-helper.c
+src/modules/module-esound-sink.c
+src/modules/module-alsa-sink.c
+src/modules/module-volume-restore.c
+src/modules/module-x11-bell.c
+src/modules/module-protocol-stub.c
+src/modules/module-stream-restore.c
+src/modules/module-jack-sink.c
+src/modules/module-esound-compat-spawnfd.c
+src/modules/module-esound-compat-spawnpid.c
+#src/modules/module-waveout.c
+src/modules/module-combine.c
+src/modules/bt-proximity-helper.c
+src/modules/module-x11-publish.c
+src/modules/rtp/module-rtp-recv.c
+src/modules/rtp/sdp.c
+src/modules/rtp/rtp.c
+src/modules/rtp/sap.c
+src/modules/rtp/module-rtp-send.c
+src/modules/module-ladspa-sink.c
+src/modules/module-suspend-on-idle.c
+src/modules/module-pipe-sink.c
+src/modules/module-null-sink.c
+src/pulsecore/memblock.c
+src/pulsecore/queue.c
+src/pulsecore/core.c
+#src/pulsecore/shmasyncq.c
+src/pulsecore/x11wrap.c
+src/pulsecore/rtclock.c
+src/pulsecore/ioline.c
+src/pulsecore/autoload.c
+src/pulsecore/asyncq.c
+src/pulsecore/mutex-posix.c
+src/pulsecore/protocol-esound.c
+src/pulsecore/proplist-util.c
+src/pulsecore/pstream.c
+src/pulsecore/cli-command.c
+src/pulsecore/ltdl-helper.c
+src/pulsecore/ipacl.c
+src/pulsecore/sample-util.c
+src/pulsecore/log.c
+src/pulsecore/auth-cookie.c
+src/pulsecore/protocol-cli.c
+src/pulsecore/resampler.c
+src/pulsecore/pdispatch.c
+src/pulsecore/hook-list.c
+src/pulsecore/conf-parser.c
+src/pulsecore/mcalign.c
+src/pulsecore/core-subscribe.c
+src/pulsecore/protocol-native.c
+src/pulsecore/source-output.c
+src/pulsecore/modargs.c
+src/pulsecore/core-scache.c
+src/pulsecore/iochannel.c
+src/pulsecore/shared.c
+src/pulsecore/socket-client.c
+src/pulsecore/idxset.c
+src/pulsecore/pipe.c
+src/pulsecore/asyncmsgq.c
+src/pulsecore/inet_pton.c
+src/pulsecore/socket-util.c
+src/pulsecore/object.c
+src/pulsecore/sioman.c
+src/pulsecore/sink-input.c
+src/pulsecore/x11prop.c
+src/pulsecore/sconv-s16be.c
+src/pulsecore/thread-posix.c
+src/pulsecore/client.c
+src/pulsecore/inet_ntop.c
+src/pulsecore/strlist.c
+src/pulsecore/msgobject.c
+src/pulsecore/mutex-win32.c
+src/pulsecore/dynarray.c
+src/pulsecore/rtsig.c
+src/pulsecore/once.c
+src/pulsecore/source.c
+src/pulsecore/memchunk.c
+src/pulsecore/protocol-simple.c
+src/pulsecore/sink.c
+src/pulsecore/sconv-s16le.c
+src/pulsecore/sconv.c
+src/pulsecore/core-error.c
+src/pulsecore/strbuf.c
+src/pulsecore/play-memblockq.c
+src/pulsecore/dllmain.c
+src/pulsecore/envelope.c
+src/pulsecore/pid.c
+src/pulsecore/thread-mq.c
+src/pulsecore/shm.c
+src/pulsecore/play-memchunk.c
+src/pulsecore/hashmap.c
+src/pulsecore/avahi-wrap.c
+src/pulsecore/authkey.c
+src/pulsecore/namereg.c
+src/pulsecore/poll.c
+src/pulsecore/tokenizer.c
+src/pulsecore/semaphore-posix.c
+src/pulsecore/cli-text.c
+src/pulsecore/g711.c
+src/pulsecore/core-util.c
+src/pulsecore/thread-win32.c
+src/pulsecore/tagstruct.c
+src/pulsecore/socket-server.c
+src/pulsecore/flist.c
+src/pulsecore/fdsem.c
+src/pulsecore/random.c
+src/pulsecore/modinfo.c
+src/pulsecore/start-child.c
+src/pulsecore/packet.c
+src/pulsecore/pstream-util.c
+src/pulsecore/rtpoll.c
+src/pulsecore/sound-file.c
+src/pulsecore/module.c
+src/pulsecore/ffmpeg/resample2.c
+src/pulsecore/cli.c
+src/pulsecore/time-smoother.c
+src/pulsecore/parseaddr.c
+src/pulsecore/sound-file-stream.c
+src/pulsecore/memblockq.c
+src/pulsecore/protocol-http.c
+src/pulsecore/semaphore-win32.c
+src/daemon/cpulimit.c
+src/daemon/ltdl-bind-now.c
+src/daemon/polkit.c
+src/daemon/main.c
+src/daemon/cmdline.c
+src/daemon/dumpmodules.c
+src/daemon/daemon-conf.c
+src/daemon/caps.c
+src/pulse/channelmap.c
+src/pulse/error.c
+src/pulse/proplist.c
+src/pulse/xmalloc.c
+src/pulse/ext-stream-restore.c
+src/pulse/stream.c
+src/pulse/i18n.c
+src/pulse/util.c
+src/pulse/utf8.c
+src/pulse/mainloop-api.c
+src/pulse/sample.c
+src/pulse/client-conf-x11.c
+src/pulse/client-conf.c
+src/pulse/browser.c
+src/pulse/volume.c
+src/pulse/simple.c
+src/pulse/subscribe.c
+src/pulse/introspect.c
+src/pulse/mainloop.c
+src/pulse/mainloop-signal.c
+src/pulse/operation.c
+src/pulse/context.c
+src/pulse/thread-mainloop.c
+src/pulse/scache.c
+src/pulse/glib-mainloop.c
+src/pulse/timeval.c
+src/utils/pacat.c
+src/utils/pasuspender.c
+src/utils/pabrowse.c
+src/utils/pactl.c
+src/utils/padsp.c
+src/utils/pax11publish.c
+src/utils/pacmd.c
+src/utils/paplay.c
--- /dev/null
+src/pulsecore/atomic.h
AM_CFLAGS += -DPA_SYSTEM_CONFIG_PATH=\"$(PA_SYSTEM_CONFIG_PATH)\"
AM_CFLAGS += -DPA_SYSTEM_STATE_PATH=\"$(PA_SYSTEM_STATE_PATH)\"
AM_CFLAGS += -DAO_REQUIRE_CAS
+AM_CFLAGS += -DPULSE_LOCALEDIR=\"$(pulselocaledir)\"
# This cool debug trap works on i386/gcc only
AM_CFLAGS += '-DDEBUG_TRAP=__asm__("int $$3")'
pulse/volume.c pulse/volume.h \
pulse/xmalloc.c pulse/xmalloc.h \
pulse/proplist.c pulse/proplist.h \
- pulse/ext-stream-restore.c pulse/ext-stream-restore.h
+ pulse/ext-stream-restore.c pulse/ext-stream-restore.h \
+ pulse/i18n.c pulse/i18n.h
# Internal stuff that is shared with libpulsecore
libpulse_la_SOURCES += \
pulse/util.c pulse/util.h \
pulse/volume.c pulse/volume.h \
pulse/xmalloc.c pulse/xmalloc.h \
- pulse/proplist.c pulse/proplist.h
+ pulse/proplist.c pulse/proplist.h \
+ pulse/i18n.c pulse/i18n.h
# Pure core stuff (some are shared in libpulse though).
libpulsecore_la_SOURCES += \
#include <errno.h>
#include <string.h>
#include <sys/types.h>
+
+#include <pulse/i18n.h>
+
#include <pulsecore/macro.h>
+#include <pulsecore/core-error.h>
+#include <pulsecore/log.h>
#ifdef HAVE_SYS_CAPABILITY_H
#include <sys/capability.h>
#include <sys/prctl.h>
#endif
-#include <pulsecore/core-error.h>
-
-#include <pulsecore/log.h>
-
#include "caps.h"
/* Glibc <= 2.2 has broken unistd.h */
if (uid == 0 || geteuid() != 0)
return;
- pa_log_info("Dropping root priviliges.");
+ pa_log_info(_("Dropping root priviliges."));
#if defined(HAVE_SETRESUID)
pa_assert_se(setresuid(uid, uid, uid) >= 0);
* that */
pa_drop_caps();
else
- pa_log_info("Limited capabilities successfully to CAP_SYS_NICE.");
+ pa_log_info(_("Limited capabilities successfully to CAP_SYS_NICE."));
pa_assert_se(cap_free(caps) == 0);
#include <sys/stat.h>
#include <pulse/xmalloc.h>
+#include <pulse/i18n.h>
#include <pulsecore/core-util.h>
#include <pulsecore/strbuf.h>
else
e = argv0;
- printf("%s [options]\n\n"
+ printf(_("%s [options]\n\n"
"COMMANDS:\n"
" -h, --help Show this help\n"
" --version Show version\n"
" -C Open a command line on the running TTY\n"
" after startup\n\n"
- " -n Don't load default script file\n", e);
+ " -n Don't load default script file\n"), e);
}
int pa_cmdline_parse(pa_daemon_conf *conf, int argc, char *const argv [], int *d) {
case ARG_DAEMONIZE:
case 'D':
if ((conf->daemonize = optarg ? pa_parse_boolean(optarg) : TRUE) < 0) {
- pa_log("--daemonize expects boolean argument");
+ pa_log(_("--daemonize expects boolean argument"));
goto fail;
}
break;
case ARG_FAIL:
if ((conf->fail = optarg ? pa_parse_boolean(optarg) : TRUE) < 0) {
- pa_log("--fail expects boolean argument");
+ pa_log(_("--fail expects boolean argument"));
goto fail;
}
break;
if (optarg) {
if (pa_daemon_conf_set_log_level(conf, optarg) < 0) {
- pa_log("--log-level expects log level argument (either numeric in range 0..4 or one of debug, info, notice, warn, error).");
+ pa_log(_("--log-level expects log level argument (either numeric in range 0..4 or one of debug, info, notice, warn, error)."));
goto fail;
}
} else {
case ARG_HIGH_PRIORITY:
if ((conf->high_priority = optarg ? pa_parse_boolean(optarg) : TRUE) < 0) {
- pa_log("--high-priority expects boolean argument");
+ pa_log(_("--high-priority expects boolean argument"));
goto fail;
}
break;
case ARG_REALTIME:
if ((conf->realtime_scheduling = optarg ? pa_parse_boolean(optarg) : TRUE) < 0) {
- pa_log("--realtime expects boolean argument");
+ pa_log(_("--realtime expects boolean argument"));
goto fail;
}
break;
case ARG_DISALLOW_MODULE_LOADING:
if ((conf->disallow_module_loading = optarg ? pa_parse_boolean(optarg) : TRUE) < 0) {
- pa_log("--disallow-module-loading expects boolean argument");
+ pa_log(_("--disallow-module-loading expects boolean argument"));
goto fail;
}
break;
case ARG_USE_PID_FILE:
if ((conf->use_pid_file = optarg ? pa_parse_boolean(optarg) : TRUE) < 0) {
- pa_log("--use-pid-file expects boolean argument");
+ pa_log(_("--use-pid-file expects boolean argument"));
goto fail;
}
break;
case ARG_LOG_TARGET:
if (pa_daemon_conf_set_log_target(conf, optarg) < 0) {
- pa_log("Invalid log target: use either 'syslog', 'stderr' or 'auto'.");
+ pa_log(_("Invalid log target: use either 'syslog', 'stderr' or 'auto'."));
goto fail;
}
break;
case ARG_RESAMPLE_METHOD:
if (pa_daemon_conf_set_resample_method(conf, optarg) < 0) {
- pa_log("Invalid resample method '%s'.", optarg);
+ pa_log(_("Invalid resample method '%s'."), optarg);
goto fail;
}
break;
case ARG_SYSTEM:
if ((conf->system_instance = optarg ? pa_parse_boolean(optarg) : TRUE) < 0) {
- pa_log("--system expects boolean argument");
+ pa_log(_("--system expects boolean argument"));
goto fail;
}
break;
case ARG_NO_CPU_LIMIT:
if ((conf->no_cpu_limit = optarg ? pa_parse_boolean(optarg) : TRUE) < 0) {
- pa_log("--no-cpu-limit expects boolean argument");
+ pa_log(_("--no-cpu-limit expects boolean argument"));
goto fail;
}
break;
case ARG_DISABLE_SHM:
if ((conf->disable_shm = optarg ? pa_parse_boolean(optarg) : TRUE) < 0) {
- pa_log("--disable-shm expects boolean argument");
+ pa_log(_("--disable-shm expects boolean argument"));
goto fail;
}
break;
#include <pulse/xmalloc.h>
#include <pulse/timeval.h>
+#include <pulse/i18n.h>
#include <pulsecore/core-error.h>
#include <pulsecore/core-util.h>
pa_assert(data);
if (pa_daemon_conf_set_log_target(c, rvalue) < 0) {
- pa_log("[%s:%u] Invalid log target '%s'.", filename, line, rvalue);
+ pa_log(_("[%s:%u] Invalid log target '%s'."), filename, line, rvalue);
return -1;
}
pa_assert(data);
if (pa_daemon_conf_set_log_level(c, rvalue) < 0) {
- pa_log("[%s:%u] Invalid log level '%s'.", filename, line, rvalue);
+ pa_log(_("[%s:%u] Invalid log level '%s'."), filename, line, rvalue);
return -1;
}
pa_assert(data);
if (pa_daemon_conf_set_resample_method(c, rvalue) < 0) {
- pa_log("[%s:%u] Invalid resample method '%s'.", filename, line, rvalue);
+ pa_log(_("[%s:%u] Invalid resample method '%s'."), filename, line, rvalue);
return -1;
}
} else {
int32_t k;
if (pa_atoi(rvalue, &k) < 0) {
- pa_log("[%s:%u] Invalid rlimit '%s'.", filename, line, rvalue);
+ pa_log(_("[%s:%u] Invalid rlimit '%s'."), filename, line, rvalue);
return -1;
}
r->is_set = k >= 0;
r->value = k >= 0 ? (rlim_t) k : 0;
}
#else
- pa_log_warn("[%s:%u] rlimit not supported on this platform.", filename, line);
+ pa_log_warn(_("[%s:%u] rlimit not supported on this platform."), filename, line);
#endif
return 0;
pa_assert(data);
if ((f = pa_parse_sample_format(rvalue)) < 0) {
- pa_log("[%s:%u] Invalid sample format '%s'.", filename, line, rvalue);
+ pa_log(_("[%s:%u] Invalid sample format '%s'."), filename, line, rvalue);
return -1;
}
pa_assert(data);
if (pa_atoi(rvalue, &r) < 0 || r > (int32_t) PA_RATE_MAX || r <= 0) {
- pa_log("[%s:%u] Invalid sample rate '%s'.", filename, line, rvalue);
+ pa_log(_("[%s:%u] Invalid sample rate '%s'."), filename, line, rvalue);
return -1;
}
pa_assert(data);
if (pa_atoi(rvalue, &n) < 0 || n > (int32_t) PA_CHANNELS_MAX || n <= 0) {
- pa_log("[%s:%u] Invalid sample channels '%s'.", filename, line, rvalue);
+ pa_log(_("[%s:%u] Invalid sample channels '%s'."), filename, line, rvalue);
return -1;
}
pa_assert(data);
if (pa_atoi(rvalue, &n) < 0 || n < 2) {
- pa_log("[%s:%u] Invalid number of fragments '%s'.", filename, line, rvalue);
+ pa_log(_("[%s:%u] Invalid number of fragments '%s'."), filename, line, rvalue);
return -1;
}
pa_assert(data);
if (pa_atoi(rvalue, &n) < 0 || n < 1) {
- pa_log("[%s:%u] Invalid fragment size '%s'.", filename, line, rvalue);
+ pa_log(_("[%s:%u] Invalid fragment size '%s'."), filename, line, rvalue);
return -1;
}
pa_assert(data);
if (pa_atoi(rvalue, &level) < 0 || level < -20 || level > 19) {
- pa_log("[%s:%u] Invalid nice level '%s'.", filename, line, rvalue);
+ pa_log(_("[%s:%u] Invalid nice level '%s'."), filename, line, rvalue);
return -1;
}
pa_open_config_file(DEFAULT_CONFIG_FILE, DEFAULT_CONFIG_FILE_USER, ENV_CONFIG_FILE, &c->config_file);
if (!f && errno != ENOENT) {
- pa_log_warn("Failed to open configuration file: %s", pa_cstrerror(errno));
+ pa_log_warn(_("Failed to open configuration file: %s"), pa_cstrerror(errno));
goto finish;
}
s = pa_strbuf_new();
if (c->config_file)
- pa_strbuf_printf(s, "### Read from configuration file: %s ###\n", c->config_file);
+ pa_strbuf_printf(s, _("### Read from configuration file: %s ###\n"), c->config_file);
pa_assert(c->log_level <= PA_LOG_LEVEL_MAX);
#include <ltdl.h>
#include <pulse/util.h>
+#include <pulse/i18n.h>
#include <pulsecore/modinfo.h>
#include <pulsecore/core-util.h>
nl = 1;
- printf("Name: %s\n", name);
+ printf(_("Name: %s\n"), name);
if (!i->description && !i->version && !i->author && !i->usage)
- printf("No module information available\n");
+ printf(_("No module information available\n"));
else {
if (i->version)
- printf("Version: %s\n", i->version);
+ printf(_("Version: %s\n"), i->version);
if (i->description)
- printf("Description: %s\n", i->description);
+ printf(_("Description: %s\n"), i->description);
if (i->author)
- printf("Author: %s\n", i->author);
+ printf(_("Author: %s\n"), i->author);
if (i->usage)
- printf("Usage: %s\n", i->usage);
- printf("Load Once: %s\n", pa_yes_no(i->load_once));
+ printf(_("Usage: %s\n"), i->usage);
+ printf(_("Load Once: %s\n"), pa_yes_no(i->load_once));
}
if (path)
- printf("Path: %s\n", path);
+ printf(_("Path: %s\n"), path);
}
static void show_info(const char *name, const char *path, void (*info)(const char *name, const char *path, pa_modinfo*i)) {
#include <sys/dl.h>
#endif
-#ifndef HAVE_STRUCT_LT_USER_DLLOADER
-/* Only used with ltdl 2.2 */
#include <string.h>
-#endif
#include <ltdl.h>
+#include <pulse/i18n.h>
+
#include <pulsecore/macro.h>
#include <pulsecore/mutex.h>
#include <pulsecore/thread.h>
#undef PA_BIND_NOW
#endif
+#ifdef HAVE_LT_DLMUTEX_REGISTER
+
static pa_mutex *libtool_mutex = NULL;
PA_STATIC_TLS_DECLARE_NO_FREE(libtool_tls);
return PA_STATIC_TLS_GET(libtool_tls);
}
+#endif
+
#ifdef PA_BIND_NOW
/*
*/
#ifndef HAVE_LT_DLADVISE
-static lt_module bind_now_open(lt_user_data d, const char *fname) {
+static lt_module bind_now_open(lt_user_data d, const char *fname)
#else
- static lt_module bind_now_open(lt_user_data d, const char *fname, lt_dladvise advise) {
+static lt_module bind_now_open(lt_user_data d, const char *fname, lt_dladvise advise)
#endif
+{
lt_module m;
pa_assert(fname);
#endif
pa_assert_se(lt_dlinit() == 0);
- pa_assert_se(libtool_mutex = pa_mutex_new(TRUE, FALSE));
+
#ifdef HAVE_LT_DLMUTEX_REGISTER
+ pa_assert_se(libtool_mutex = pa_mutex_new(TRUE, FALSE));
pa_assert_se(lt_dlmutex_register(libtool_lock, libtool_unlock, libtool_set_error, libtool_get_error) == 0);
#endif
/* Add our BIND_NOW loader as the default module loader. */
if (lt_dlloader_add(place, &loader, "bind-now-loader") != 0)
- pa_log_warn("Failed to add bind-now-loader.");
+ pa_log_warn(_("Failed to add bind-now-loader."));
# else
/* Already initialised */
- if ( dlopen_loader != NULL ) return;
+ if (dlopen_loader)
+ return;
if (!(dlopen_loader = lt_dlloader_find("dlopen"))) {
- pa_log_warn("Failed to find original dlopen loader.");
- return;
+ pa_log_warn(_("Failed to find original dlopen loader."));
+ return;
}
memcpy(&bindnow_loader, dlopen_loader, sizeof(bindnow_loader));
/* Add our BIND_NOW loader as the default module loader. */
if (lt_dlloader_add(&bindnow_loader) != 0)
- pa_log_warn("Failed to add bind-now-loader.");
+ pa_log_warn(_("Failed to add bind-now-loader."));
# endif
#endif
}
void pa_ltdl_done(void) {
pa_assert_se(lt_dlexit() == 0);
+
+#ifdef HAVE_LT_DLMUTEX_REGISTER
pa_mutex_free(libtool_mutex);
libtool_mutex = NULL;
+#endif
}
-
#include <pulse/mainloop-signal.h>
#include <pulse/timeval.h>
#include <pulse/xmalloc.h>
+#include <pulse/i18n.h>
#include <pulsecore/winsock.h>
#include <pulsecore/core-error.h>
#endif
static void signal_callback(pa_mainloop_api*m, PA_GCC_UNUSED pa_signal_event *e, int sig, void *userdata) {
- pa_log_info("Got signal %s.", pa_sig2str(sig));
+ pa_log_info(_("Got signal %s."), pa_sig2str(sig));
switch (sig) {
#ifdef SIGUSR1
case SIGINT:
case SIGTERM:
default:
- pa_log_info("Exiting.");
+ pa_log_info(_("Exiting."));
m->quit(m, 1);
break;
}
* afterwards. */
if (!(pw = getpwnam(PA_SYSTEM_USER))) {
- pa_log("Failed to find user '%s'.", PA_SYSTEM_USER);
+ pa_log(_("Failed to find user '%s'."), PA_SYSTEM_USER);
return -1;
}
if (!(gr = getgrnam(PA_SYSTEM_GROUP))) {
- pa_log("Failed to find group '%s'.", PA_SYSTEM_GROUP);
+ pa_log(_("Failed to find group '%s'."), PA_SYSTEM_GROUP);
return -1;
}
- pa_log_info("Found user '%s' (UID %lu) and group '%s' (GID %lu).",
+ pa_log_info(_("Found user '%s' (UID %lu) and group '%s' (GID %lu)."),
PA_SYSTEM_USER, (unsigned long) pw->pw_uid,
PA_SYSTEM_GROUP, (unsigned long) gr->gr_gid);
if (pw->pw_gid != gr->gr_gid) {
- pa_log("GID of user '%s' and of group '%s' don't match.", PA_SYSTEM_USER, PA_SYSTEM_GROUP);
+ pa_log(_("GID of user '%s' and of group '%s' don't match."), PA_SYSTEM_USER, PA_SYSTEM_GROUP);
return -1;
}
if (strcmp(pw->pw_dir, PA_SYSTEM_RUNTIME_PATH) != 0)
- pa_log_warn("Warning: home directory of user '%s' is not '%s', ignoring.", PA_SYSTEM_USER, PA_SYSTEM_RUNTIME_PATH);
+ pa_log_warn(_("Home directory of user '%s' is not '%s', ignoring."), PA_SYSTEM_USER, PA_SYSTEM_RUNTIME_PATH);
if (pa_make_secure_dir(PA_SYSTEM_RUNTIME_PATH, 0755, pw->pw_uid, gr->gr_gid) < 0) {
- pa_log("Failed to create '%s': %s", PA_SYSTEM_RUNTIME_PATH, pa_cstrerror(errno));
+ pa_log(_("Failed to create '%s': %s"), PA_SYSTEM_RUNTIME_PATH, pa_cstrerror(errno));
return -1;
}
if (pa_make_secure_dir(PA_SYSTEM_STATE_PATH, 0700, pw->pw_uid, gr->gr_gid) < 0) {
- pa_log("Failed to create '%s': %s", PA_SYSTEM_STATE_PATH, pa_cstrerror(errno));
+ pa_log(_("Failed to create '%s': %s"), PA_SYSTEM_STATE_PATH, pa_cstrerror(errno));
return -1;
}
/* We don't create the config dir here, because we don't need to write to it */
if (initgroups(PA_SYSTEM_USER, gr->gr_gid) != 0) {
- pa_log("Failed to change group list: %s", pa_cstrerror(errno));
+ pa_log(_("Failed to change group list: %s"), pa_cstrerror(errno));
return -1;
}
#endif
if (r < 0) {
- pa_log("Failed to change GID: %s", pa_cstrerror(errno));
+ pa_log(_("Failed to change GID: %s"), pa_cstrerror(errno));
return -1;
}
#endif
if (r < 0) {
- pa_log("Failed to change UID: %s", pa_cstrerror(errno));
+ pa_log(_("Failed to change UID: %s"), pa_cstrerror(errno));
return -1;
}
pa_set_env("PULSE_CONFIG_PATH", PA_SYSTEM_CONFIG_PATH);
pa_set_env("PULSE_STATE_PATH", PA_SYSTEM_STATE_PATH);
- pa_log_info("Successfully dropped root privileges.");
+ pa_log_info(_("Successfully dropped root privileges."));
return 0;
}
#else /* HAVE_PWD_H && HAVE_GRP_H */
static int change_user(void) {
- pa_log("System wide mode unsupported on this platform.");
+ pa_log(_("System wide mode unsupported on this platform."));
return -1;
}
rl.rlim_cur = rl.rlim_max = r->value;
if (setrlimit(resource, &rl) < 0) {
- pa_log_info("setrlimit(%s, (%u, %u)) failed: %s", name, (unsigned) r->value, (unsigned) r->value, pa_cstrerror(errno));
+ pa_log_info(_("setrlimit(%s, (%u, %u)) failed: %s"), name, (unsigned) r->value, (unsigned) r->value, pa_cstrerror(errno));
return -1;
}
* still are normal root. */
setlocale(LC_ALL, "");
+ pa_init_i18n();
+
pa_log_set_maximal_level(PA_LOG_INFO);
pa_log_set_ident("pulseaudio");
goto finish;
if (pa_cmdline_parse(conf, argc, argv, &d) < 0) {
- pa_log("Failed to parse command line.");
+ pa_log(_("Failed to parse command line."));
goto finish;
}
if (conf->high_priority && !allow_high_priority) {
if (pa_own_uid_in_group(PA_REALTIME_GROUP, &gid) > 0) {
- pa_log_info("We're in the group '"PA_REALTIME_GROUP"', allowing high-priority scheduling.");
+ pa_log_info(_("We're in the group '%s', allowing high-priority scheduling."), PA_REALTIME_GROUP);
allow_high_priority = TRUE;
}
}
if (conf->realtime_scheduling && !allow_realtime) {
if (pa_own_uid_in_group(PA_REALTIME_GROUP, &gid) > 0) {
- pa_log_info("We're in the group '"PA_REALTIME_GROUP"', allowing real-time scheduling.");
+ pa_log_info(_("We're in the group '%s', allowing real-time scheduling."), PA_REALTIME_GROUP);
allow_realtime = TRUE;
}
}
#ifdef HAVE_POLKIT
if (conf->high_priority && !allow_high_priority) {
if (pa_polkit_check("org.pulseaudio.acquire-high-priority") > 0) {
- pa_log_info("PolicyKit grants us acquire-high-priority privilege.");
+ pa_log_info(_("PolicyKit grants us acquire-high-priority privilege."));
allow_high_priority = TRUE;
} else
- pa_log_info("PolicyKit refuses acquire-high-priority privilege.");
+ pa_log_info(_("PolicyKit refuses acquire-high-priority privilege."));
}
if (conf->realtime_scheduling && !allow_realtime) {
if (pa_polkit_check("org.pulseaudio.acquire-real-time") > 0) {
- pa_log_info("PolicyKit grants us acquire-real-time privilege.");
+ pa_log_info(_("PolicyKit grants us acquire-real-time privilege."));
allow_realtime = TRUE;
} else
- pa_log_info("PolicyKit refuses acquire-real-time privilege.");
+ pa_log_info(_("PolicyKit refuses acquire-real-time privilege."));
}
#endif
pa_drop_caps();
if (conf->high_priority || conf->realtime_scheduling)
- pa_log_notice("Called SUID root and real-time/high-priority scheduling was requested in the configuration. However, we lack the necessary priviliges:\n"
- "We are not in group '"PA_REALTIME_GROUP"' and PolicyKit refuse to grant us priviliges. Dropping SUID again.\n"
- "For enabling real-time scheduling please acquire the appropriate PolicyKit priviliges, or become a member of '"PA_REALTIME_GROUP"', or increase the RLIMIT_NICE/RLIMIT_RTPRIO resource limits for this user.");
+ pa_log_notice(_("Called SUID root and real-time/high-priority scheduling was requested in the configuration. However, we lack the necessary priviliges:\n"
+ "We are not in group '"PA_REALTIME_GROUP"' and PolicyKit refuse to grant us priviliges. Dropping SUID again.\n"
+ "For enabling real-time scheduling please acquire the appropriate PolicyKit priviliges, or become a member of '"PA_REALTIME_GROUP"', or increase the RLIMIT_NICE/RLIMIT_RTPRIO resource limits for this user."));
}
}
#endif
if (conf->high_priority && !pa_can_high_priority())
- pa_log_warn("High-priority scheduling enabled in configuration but not allowed by policy.");
+ pa_log_warn(_("High-priority scheduling enabled in configuration but not allowed by policy."));
if (conf->high_priority && (conf->cmd == PA_CMD_DAEMON || conf->cmd == PA_CMD_START))
pa_raise_priority(conf->nice_level);
rl.rlim_max = rl.rlim_cur = 9;
if (setrlimit(RLIMIT_RTPRIO, &rl) >= 0) {
- pa_log_info("Successfully increased RLIMIT_RTPRIO");
+ pa_log_info(_("Successfully increased RLIMIT_RTPRIO"));
drop = TRUE;
} else
- pa_log_warn("RLIMIT_RTPRIO failed: %s", pa_cstrerror(errno));
+ pa_log_warn(_("RLIMIT_RTPRIO failed: %s"), pa_cstrerror(errno));
}
}
}
#endif
if (drop) {
- pa_log_info("Giving up CAP_NICE");
+ pa_log_info(_("Giving up CAP_NICE"));
pa_drop_caps();
suid_root = FALSE;
}
}
if (conf->realtime_scheduling && !pa_can_realtime())
- pa_log_warn("Real-time scheduling enabled in configuration but not allowed by policy.");
+ pa_log_warn(_("Real-time scheduling enabled in configuration but not allowed by policy."));
pa_log_debug("Can realtime: %s, can high-priority: %s", pa_yes_no(pa_can_realtime()), pa_yes_no(pa_can_high_priority()));
pid_t pid;
if (pa_pid_file_check_running(&pid, "pulseaudio") < 0)
- pa_log_info("Daemon not running");
+ pa_log_info(_("Daemon not running"));
else {
- pa_log_info("Daemon running as PID %u", pid);
+ pa_log_info(_("Daemon running as PID %u"), pid);
retval = 0;
}
case PA_CMD_KILL:
if (pa_pid_file_kill(SIGINT, NULL, "pulseaudio") < 0)
- pa_log("Failed to kill daemon.");
+ pa_log(_("Failed to kill daemon."));
else
retval = 0;
}
if (real_root && !conf->system_instance)
- pa_log_warn("This program is not intended to be run as root (unless --system is specified).");
+ pa_log_warn(_("This program is not intended to be run as root (unless --system is specified)."));
else if (!real_root && conf->system_instance) {
- pa_log("Root priviliges required.");
+ pa_log(_("Root priviliges required."));
goto finish;
}
if (conf->cmd == PA_CMD_START && conf->system_instance) {
- pa_log("--start not supported for system instances.");
+ pa_log(_("--start not supported for system instances."));
goto finish;
}
int tty_fd;
if (pa_stdio_acquire() < 0) {
- pa_log("Failed to acquire stdio.");
+ pa_log(_("Failed to acquire stdio."));
goto finish;
}
#ifdef HAVE_FORK
if (pipe(daemon_pipe) < 0) {
- pa_log("pipe failed: %s", pa_cstrerror(errno));
+ pa_log(_("pipe failed: %s"), pa_cstrerror(errno));
goto finish;
}
if ((child = fork()) < 0) {
- pa_log("fork() failed: %s", pa_cstrerror(errno));
+ pa_log(_("fork() failed: %s"), pa_cstrerror(errno));
goto finish;
}
if ((n = pa_loop_read(daemon_pipe[0], &retval, sizeof(retval), NULL)) != sizeof(retval)) {
if (n < 0)
- pa_log("read() failed: %s", pa_cstrerror(errno));
+ pa_log(_("read() failed: %s"), pa_cstrerror(errno));
retval = 1;
}
if (retval)
- pa_log("Daemon startup failed.");
+ pa_log(_("Daemon startup failed."));
else
- pa_log_info("Daemon startup successful.");
+ pa_log_info(_("Daemon startup successful."));
goto finish;
}
pa_set_env("PULSE_SYSTEM", conf->system_instance ? "1" : "0");
- pa_log_info("This is PulseAudio " PACKAGE_VERSION);
- pa_log_info("Page size is %lu bytes", (unsigned long) PA_PAGE_SIZE);
+ pa_log_info(_("This is PulseAudio %s"), PACKAGE_VERSION);
+ pa_log_info(_("Page size is %lu bytes"), (unsigned long) PA_PAGE_SIZE);
if (!(s = pa_get_runtime_dir()))
goto finish;
- pa_log_info("Using runtime directory %s.", s);
+ pa_log_info(_("Using runtime directory %s."), s);
pa_xfree(s);
if (!(s = pa_get_state_dir()))
- pa_log_info("Using state directory %s.", s);
+ pa_log_info(_("Using state directory %s."), s);
pa_xfree(s);
- pa_log_info("Running in system mode: %s", pa_yes_no(pa_in_system_mode()));
+ pa_log_info(_("Running in system mode: %s"), pa_yes_no(pa_in_system_mode()));
if (conf->use_pid_file) {
int z;
goto finish;
}
- pa_log("pa_pid_file_create() failed.");
+ pa_log(_("pa_pid_file_create() failed."));
goto finish;
}
#endif
if (pa_rtclock_hrtimer())
- pa_log_info("Fresh high-resolution timers available! Bon appetit!");
+ pa_log_info(_("Fresh high-resolution timers available! Bon appetit!"));
else
- pa_log_info("Dude, your kernel stinks! The chef's recommendation today is Linux with high-resolution timers enabled!");
+ pa_log_info(_("Dude, your kernel stinks! The chef's recommendation today is Linux with high-resolution timers enabled!"));
#ifdef SIGRTMIN
/* Valgrind uses SIGRTMAX. To easy debugging we don't use it here */
pa_assert_se(mainloop = pa_mainloop_new());
if (!(c = pa_core_new(pa_mainloop_get_api(mainloop), !conf->disable_shm))) {
- pa_log("pa_core_new() failed.");
+ pa_log(_("pa_core_new() failed."));
goto finish;
}
c->disallow_module_loading = !!conf->disallow_module_loading;
if (r < 0 && conf->fail) {
- pa_log("Failed to initialize daemon.");
+ pa_log(_("Failed to initialize daemon."));
goto finish;
}
if (!c->modules || pa_idxset_size(c->modules) == 0) {
- pa_log("Daemon startup without any loaded modules, refusing to work.");
+ pa_log(_("Daemon startup without any loaded modules, refusing to work."));
goto finish;
}
if (c->default_sink_name && !pa_namereg_get(c, c->default_sink_name, PA_NAMEREG_SINK, TRUE) && conf->fail) {
- pa_log_error("Default sink name (%s) does not exist in name register.", c->default_sink_name);
+ pa_log_error(_("Default sink name (%s) does not exist in name register."), c->default_sink_name);
goto finish;
}
}
#endif
- pa_log_info("Daemon startup complete.");
+ pa_log_info(_("Daemon startup complete."));
retval = 0;
if (pa_mainloop_run(mainloop, &retval) < 0)
goto finish;
- pa_log_info("Daemon shutdown initiated.");
+ pa_log_info(_("Daemon shutdown initiated."));
finish:
if (c) {
pa_core_unref(c);
- pa_log_info("Daemon terminated.");
+ pa_log_info(_("Daemon terminated."));
}
if (!conf->no_cpu_limit)
#include <dbus/dbus.h>
#include <polkit-dbus/polkit-dbus.h>
+#include <pulse/i18n.h>
+
#include <pulsecore/log.h>
#include <pulsecore/macro.h>
dbus_error_init(&dbus_error);
if (!(bus = dbus_bus_get(DBUS_BUS_SYSTEM, &dbus_error))) {
- pa_log_error("Cannot connect to system bus: %s", dbus_error.message);
+ pa_log_error(_("Cannot connect to system bus: %s"), dbus_error.message);
goto finish;
}
dbus_connection_set_exit_on_disconnect(bus, FALSE);
if (!(caller = polkit_caller_new_from_pid(bus, getpid(), &dbus_error))) {
- pa_log_error("Cannot get caller from PID: %s", dbus_error.message);
+ pa_log_error(_("Cannot get caller from PID: %s"), dbus_error.message);
goto finish;
}
* -- an not the EUID or any other user id. */
if (!(polkit_caller_set_uid(caller, getuid()))) {
- pa_log_error("Cannot set UID on caller object.");
+ pa_log_error(_("Cannot set UID on caller object."));
goto finish;
}
if (!(polkit_caller_get_ck_session(caller, &session))) {
- pa_log_error("Failed to get CK session.");
+ pa_log_error(_("Failed to get CK session."));
goto finish;
}
* object */
if (!(polkit_session_set_uid(session, getuid()))) {
- pa_log_error("Cannot set UID on session object.");
+ pa_log_error(_("Cannot set UID on session object."));
goto finish;
}
if (!(action = polkit_action_new())) {
- pa_log_error("Cannot allocate PolKitAction.");
+ pa_log_error(_("Cannot allocate PolKitAction."));
goto finish;
}
if (!polkit_action_set_action_id(action, action_id)) {
- pa_log_error("Cannot set action_id");
+ pa_log_error(_("Cannot set action_id"));
goto finish;
}
if (!(context = polkit_context_new())) {
- pa_log_error("Cannot allocate PolKitContext.");
+ pa_log_error(_("Cannot allocate PolKitContext."));
goto finish;
}
if (!polkit_context_init(context, &polkit_error)) {
- pa_log_error("Cannot initialize PolKitContext: %s", polkit_error_get_error_message(polkit_error));
+ pa_log_error(_("Cannot initialize PolKitContext: %s"), polkit_error_get_error_message(polkit_error));
goto finish;
}
polkit_result = polkit_context_is_caller_authorized(context, action, caller, TRUE, &polkit_error);
if (polkit_error_is_set(polkit_error)) {
- pa_log_error("Could not determine whether caller is authorized: %s", polkit_error_get_error_message(polkit_error));
+ pa_log_error(_("Could not determine whether caller is authorized: %s"), polkit_error_get_error_message(polkit_error));
goto finish;
}
}
if (dbus_error_is_set(&dbus_error)) {
- pa_log_error("Cannot obtain auth: %s", dbus_error.message);
+ pa_log_error(_("Cannot obtain auth: %s"), dbus_error.message);
goto finish;
}
}
}
if (polkit_result != POLKIT_RESULT_YES && polkit_result != POLKIT_RESULT_NO)
- pa_log_warn("PolicyKit responded with '%s'", polkit_result_to_string_representation(polkit_result));
+ pa_log_warn(_("PolicyKit responded with '%s'"), polkit_result_to_string_representation(polkit_result));
ret = polkit_result == POLKIT_RESULT_YES;
#include <string.h>
#include <pulse/xmalloc.h>
+#include <pulse/i18n.h>
#include <pulsecore/core-util.h>
#include <pulsecore/macro.h>
};
const char *const pretty_table[PA_CHANNEL_POSITION_MAX] = {
- [PA_CHANNEL_POSITION_MONO] = "Mono",
-
- [PA_CHANNEL_POSITION_FRONT_CENTER] = "Front Center",
- [PA_CHANNEL_POSITION_FRONT_LEFT] = "Front Left",
- [PA_CHANNEL_POSITION_FRONT_RIGHT] = "Front Right",
-
- [PA_CHANNEL_POSITION_REAR_CENTER] = "Rear Center",
- [PA_CHANNEL_POSITION_REAR_LEFT] = "Rear Left",
- [PA_CHANNEL_POSITION_REAR_RIGHT] = "Rear Right",
-
- [PA_CHANNEL_POSITION_LFE] = "Low Frequency Emmiter",
-
- [PA_CHANNEL_POSITION_FRONT_LEFT_OF_CENTER] = "Front Left-of-center",
- [PA_CHANNEL_POSITION_FRONT_RIGHT_OF_CENTER] = "Front Right-of-center",
-
- [PA_CHANNEL_POSITION_SIDE_LEFT] = "Side Left",
- [PA_CHANNEL_POSITION_SIDE_RIGHT] = "Side Right",
-
- [PA_CHANNEL_POSITION_AUX0] = "Auxiliary 0",
- [PA_CHANNEL_POSITION_AUX1] = "Auxiliary 1",
- [PA_CHANNEL_POSITION_AUX2] = "Auxiliary 2",
- [PA_CHANNEL_POSITION_AUX3] = "Auxiliary 3",
- [PA_CHANNEL_POSITION_AUX4] = "Auxiliary 4",
- [PA_CHANNEL_POSITION_AUX5] = "Auxiliary 5",
- [PA_CHANNEL_POSITION_AUX6] = "Auxiliary 6",
- [PA_CHANNEL_POSITION_AUX7] = "Auxiliary 7",
- [PA_CHANNEL_POSITION_AUX8] = "Auxiliary 8",
- [PA_CHANNEL_POSITION_AUX9] = "Auxiliary 9",
- [PA_CHANNEL_POSITION_AUX10] = "Auxiliary 10",
- [PA_CHANNEL_POSITION_AUX11] = "Auxiliary 11",
- [PA_CHANNEL_POSITION_AUX12] = "Auxiliary 12",
- [PA_CHANNEL_POSITION_AUX13] = "Auxiliary 13",
- [PA_CHANNEL_POSITION_AUX14] = "Auxiliary 14",
- [PA_CHANNEL_POSITION_AUX15] = "Auxiliary 15",
- [PA_CHANNEL_POSITION_AUX16] = "Auxiliary 16",
- [PA_CHANNEL_POSITION_AUX17] = "Auxiliary 17",
- [PA_CHANNEL_POSITION_AUX18] = "Auxiliary 18",
- [PA_CHANNEL_POSITION_AUX19] = "Auxiliary 19",
- [PA_CHANNEL_POSITION_AUX20] = "Auxiliary 20",
- [PA_CHANNEL_POSITION_AUX21] = "Auxiliary 21",
- [PA_CHANNEL_POSITION_AUX22] = "Auxiliary 22",
- [PA_CHANNEL_POSITION_AUX23] = "Auxiliary 23",
- [PA_CHANNEL_POSITION_AUX24] = "Auxiliary 24",
- [PA_CHANNEL_POSITION_AUX25] = "Auxiliary 25",
- [PA_CHANNEL_POSITION_AUX26] = "Auxiliary 26",
- [PA_CHANNEL_POSITION_AUX27] = "Auxiliary 27",
- [PA_CHANNEL_POSITION_AUX28] = "Auxiliary 28",
- [PA_CHANNEL_POSITION_AUX29] = "Auxiliary 29",
- [PA_CHANNEL_POSITION_AUX30] = "Auxiliary 30",
- [PA_CHANNEL_POSITION_AUX31] = "Auxiliary 31",
-
- [PA_CHANNEL_POSITION_TOP_CENTER] = "Top Center",
-
- [PA_CHANNEL_POSITION_TOP_FRONT_CENTER] = "Top Front Center",
- [PA_CHANNEL_POSITION_TOP_FRONT_LEFT] = "Top Front Left",
- [PA_CHANNEL_POSITION_TOP_FRONT_RIGHT] = "Top Front Right",
-
- [PA_CHANNEL_POSITION_TOP_REAR_CENTER] = "Top Rear Center",
- [PA_CHANNEL_POSITION_TOP_REAR_LEFT] = "Top Rear left",
- [PA_CHANNEL_POSITION_TOP_REAR_RIGHT] = "Top Rear Right"
+ [PA_CHANNEL_POSITION_MONO] = N_("Mono"),
+
+ [PA_CHANNEL_POSITION_FRONT_CENTER] = N_("Front Center"),
+ [PA_CHANNEL_POSITION_FRONT_LEFT] = N_("Front Left"),
+ [PA_CHANNEL_POSITION_FRONT_RIGHT] = N_("Front Right"),
+
+ [PA_CHANNEL_POSITION_REAR_CENTER] = N_("Rear Center"),
+ [PA_CHANNEL_POSITION_REAR_LEFT] = N_("Rear Left"),
+ [PA_CHANNEL_POSITION_REAR_RIGHT] = N_("Rear Right"),
+
+ [PA_CHANNEL_POSITION_LFE] = N_("Low Frequency Emmiter"),
+
+ [PA_CHANNEL_POSITION_FRONT_LEFT_OF_CENTER] = N_("Front Left-of-center"),
+ [PA_CHANNEL_POSITION_FRONT_RIGHT_OF_CENTER] = N_("Front Right-of-center"),
+
+ [PA_CHANNEL_POSITION_SIDE_LEFT] = N_("Side Left"),
+ [PA_CHANNEL_POSITION_SIDE_RIGHT] = N_("Side Right"),
+
+ [PA_CHANNEL_POSITION_AUX0] = N_("Auxiliary 0"),
+ [PA_CHANNEL_POSITION_AUX1] = N_("Auxiliary 1"),
+ [PA_CHANNEL_POSITION_AUX2] = N_("Auxiliary 2"),
+ [PA_CHANNEL_POSITION_AUX3] = N_("Auxiliary 3"),
+ [PA_CHANNEL_POSITION_AUX4] = N_("Auxiliary 4"),
+ [PA_CHANNEL_POSITION_AUX5] = N_("Auxiliary 5"),
+ [PA_CHANNEL_POSITION_AUX6] = N_("Auxiliary 6"),
+ [PA_CHANNEL_POSITION_AUX7] = N_("Auxiliary 7"),
+ [PA_CHANNEL_POSITION_AUX8] = N_("Auxiliary 8"),
+ [PA_CHANNEL_POSITION_AUX9] = N_("Auxiliary 9"),
+ [PA_CHANNEL_POSITION_AUX10] = N_("Auxiliary 10"),
+ [PA_CHANNEL_POSITION_AUX11] = N_("Auxiliary 11"),
+ [PA_CHANNEL_POSITION_AUX12] = N_("Auxiliary 12"),
+ [PA_CHANNEL_POSITION_AUX13] = N_("Auxiliary 13"),
+ [PA_CHANNEL_POSITION_AUX14] = N_("Auxiliary 14"),
+ [PA_CHANNEL_POSITION_AUX15] = N_("Auxiliary 15"),
+ [PA_CHANNEL_POSITION_AUX16] = N_("Auxiliary 16"),
+ [PA_CHANNEL_POSITION_AUX17] = N_("Auxiliary 17"),
+ [PA_CHANNEL_POSITION_AUX18] = N_("Auxiliary 18"),
+ [PA_CHANNEL_POSITION_AUX19] = N_("Auxiliary 19"),
+ [PA_CHANNEL_POSITION_AUX20] = N_("Auxiliary 20"),
+ [PA_CHANNEL_POSITION_AUX21] = N_("Auxiliary 21"),
+ [PA_CHANNEL_POSITION_AUX22] = N_("Auxiliary 22"),
+ [PA_CHANNEL_POSITION_AUX23] = N_("Auxiliary 23"),
+ [PA_CHANNEL_POSITION_AUX24] = N_("Auxiliary 24"),
+ [PA_CHANNEL_POSITION_AUX25] = N_("Auxiliary 25"),
+ [PA_CHANNEL_POSITION_AUX26] = N_("Auxiliary 26"),
+ [PA_CHANNEL_POSITION_AUX27] = N_("Auxiliary 27"),
+ [PA_CHANNEL_POSITION_AUX28] = N_("Auxiliary 28"),
+ [PA_CHANNEL_POSITION_AUX29] = N_("Auxiliary 29"),
+ [PA_CHANNEL_POSITION_AUX30] = N_("Auxiliary 30"),
+ [PA_CHANNEL_POSITION_AUX31] = N_("Auxiliary 31"),
+
+ [PA_CHANNEL_POSITION_TOP_CENTER] = N_("Top Center"),
+
+ [PA_CHANNEL_POSITION_TOP_FRONT_CENTER] = N_("Top Front Center"),
+ [PA_CHANNEL_POSITION_TOP_FRONT_LEFT] = N_("Top Front Left"),
+ [PA_CHANNEL_POSITION_TOP_FRONT_RIGHT] = N_("Top Front Right"),
+
+ [PA_CHANNEL_POSITION_TOP_REAR_CENTER] = N_("Top Rear Center"),
+ [PA_CHANNEL_POSITION_TOP_REAR_LEFT] = N_("Top Rear left"),
+ [PA_CHANNEL_POSITION_TOP_REAR_RIGHT] = N_("Top Rear Right")
};
pa_channel_map* pa_channel_map_init(pa_channel_map *m) {
}
const char* pa_channel_position_to_pretty_string(pa_channel_position_t pos) {
+
+ pa_init_i18n();
+
if (pos < 0 || pos >= PA_CHANNEL_POSITION_MAX)
return NULL;
- return pretty_table[pos];
+ return _(pretty_table[pos]);
}
int pa_channel_map_equal(const pa_channel_map *a, const pa_channel_map *b) {
if (map->map[c] < 0 ||map->map[c] >= PA_CHANNEL_POSITION_MAX)
return 0;
-
}
return 1;
#include <X11/Xatom.h>
#include <pulse/xmalloc.h>
+#include <pulse/i18n.h>
#include <pulsecore/x11prop.h>
#include <pulsecore/log.h>
goto finish;
if (!(d = XOpenDisplay(dname))) {
- pa_log("XOpenDisplay() failed");
+ pa_log(_("XOpenDisplay() failed"));
goto finish;
}
uint8_t cookie[PA_NATIVE_COOKIE_LENGTH];
if (pa_parsehex(t, cookie, sizeof(cookie)) != sizeof(cookie)) {
- pa_log("failed to parse cookie data");
+ pa_log(_("Failed to parse cookie data"));
goto finish;
}
#include <string.h>
#include <pulse/xmalloc.h>
+#include <pulse/i18n.h>
#include <pulsecore/macro.h>
#include <pulsecore/core-error.h>
if (filename) {
if (!(f = fopen(filename, "r"))) {
- pa_log("Failed to open configuration file '%s': %s", fn, pa_cstrerror(errno));
+ pa_log(_("Failed to open configuration file '%s': %s"), fn, pa_cstrerror(errno));
goto finish;
}
#include <pulse/xmalloc.h>
#include <pulse/utf8.h>
#include <pulse/util.h>
+#include <pulse/i18n.h>
#include <pulsecore/winsock.h>
#include <pulsecore/core-error.h>
char *lf;
if (!(lf = pa_runtime_path(AUTOSPAWN_LOCK)))
- pa_log_warn("Cannot unlock autospawn because runtime path is no more.");
+ pa_log_warn(_("Cannot unlock autospawn because runtime path is no more."));
pa_unlock_lockfile(lf, c->autospawn_lock_fd);
pa_xfree(lf);
pa_assert(mainloop);
+ pa_init_i18n();
+
if (!name && !pa_proplist_contains(p, PA_PROP_APPLICATION_NAME))
return NULL;
c->pdispatch = pa_pdispatch_new(c->mainloop, command_table, PA_COMMAND_MAX);
if (!c->conf->cookie_valid)
- pa_log_info("No cookie loaded. Attempting to connect without.");
+ pa_log_info(_("No cookie loaded. Attempting to connect without."));
t = pa_tagstruct_command(c, PA_COMMAND_AUTH, &tag);
pa_context_ref(c);
if (socketpair(AF_UNIX, SOCK_STREAM, 0, fds) < 0) {
- pa_log_error("socketpair(): %s", pa_cstrerror(errno));
+ pa_log_error(_("socketpair(): %s"), pa_cstrerror(errno));
pa_context_fail(c, PA_ERR_INTERNAL);
goto fail;
}
c->spawn_api.prefork();
if ((pid = fork()) < 0) {
- pa_log_error("fork(): %s", pa_cstrerror(errno));
+ pa_log_error(_("fork(): %s"), pa_cstrerror(errno));
pa_context_fail(c, PA_ERR_INTERNAL);
if (c->spawn_api.postfork)
c->spawn_api.postfork();
if (r < 0) {
- pa_log("waitpid(): %s", pa_cstrerror(errno));
+ pa_log(_("waitpid(): %s"), pa_cstrerror(errno));
pa_context_fail(c, PA_ERR_INTERNAL);
goto fail;
} else if (!WIFEXITED(status) || WEXITSTATUS(status) != 0) {
if (!strcmp(name, "module-stream-restore"))
pa_ext_stream_restore_command(c, tag, t);
else
- pa_log("Received message for unknown extension '%s'", name);
+ pa_log(_("Received message for unknown extension '%s'"), name);
finish:
pa_context_unref(c);
#include <string.h>
#include <pulse/xmalloc.h>
+#include <pulse/i18n.h>
#include <pulsecore/core-util.h>
#include <pulsecore/native-common.h>
const char*pa_strerror(int error) {
static const char* const errortab[PA_ERR_MAX] = {
- [PA_OK] = "OK",
- [PA_ERR_ACCESS] = "Access denied",
- [PA_ERR_COMMAND] = "Unknown command",
- [PA_ERR_INVALID] = "Invalid argument",
- [PA_ERR_EXIST] = "Entity exists",
- [PA_ERR_NOENTITY] = "No such entity",
- [PA_ERR_CONNECTIONREFUSED] = "Connection refused",
- [PA_ERR_PROTOCOL] = "Protocol error",
- [PA_ERR_TIMEOUT] = "Timeout",
- [PA_ERR_AUTHKEY] = "No authorization key",
- [PA_ERR_INTERNAL] = "Internal error",
- [PA_ERR_CONNECTIONTERMINATED] = "Connection terminated",
- [PA_ERR_KILLED] = "Entity killed",
- [PA_ERR_INVALIDSERVER] = "Invalid server",
- [PA_ERR_MODINITFAILED] = "Module initalization failed",
- [PA_ERR_BADSTATE] = "Bad state",
- [PA_ERR_NODATA] = "No data",
- [PA_ERR_VERSION] = "Incompatible protocol version",
- [PA_ERR_TOOLARGE] = "Too large",
- [PA_ERR_NOTSUPPORTED] = "Not supported",
- [PA_ERR_UNKNOWN] = "Unknown error code",
- [PA_ERR_NOEXTENSION] = "No such extension"
+ [PA_OK] = N_("OK"),
+ [PA_ERR_ACCESS] = N_("Access denied"),
+ [PA_ERR_COMMAND] = N_("Unknown command"),
+ [PA_ERR_INVALID] = N_("Invalid argument"),
+ [PA_ERR_EXIST] = N_("Entity exists"),
+ [PA_ERR_NOENTITY] = N_("No such entity"),
+ [PA_ERR_CONNECTIONREFUSED] = N_("Connection refused"),
+ [PA_ERR_PROTOCOL] = N_("Protocol error"),
+ [PA_ERR_TIMEOUT] = N_("Timeout"),
+ [PA_ERR_AUTHKEY] = N_("No authorization key"),
+ [PA_ERR_INTERNAL] = N_("Internal error"),
+ [PA_ERR_CONNECTIONTERMINATED] = N_("Connection terminated"),
+ [PA_ERR_KILLED] = N_("Entity killed"),
+ [PA_ERR_INVALIDSERVER] = N_("Invalid server"),
+ [PA_ERR_MODINITFAILED] = N_("Module initalization failed"),
+ [PA_ERR_BADSTATE] = N_("Bad state"),
+ [PA_ERR_NODATA] = N_("No data"),
+ [PA_ERR_VERSION] = N_("Incompatible protocol version"),
+ [PA_ERR_TOOLARGE] = N_("Too large"),
+ [PA_ERR_NOTSUPPORTED] = N_("Not supported"),
+ [PA_ERR_UNKNOWN] = N_("Unknown error code"),
+ [PA_ERR_NOEXTENSION] = N_("No such extension")
};
+ pa_init_i18n();
+
if (error < 0 || error >= PA_ERR_MAX)
return NULL;
- return errortab[error];
+ return _(errortab[error]);
}
--- /dev/null
+/***
+ This file is part of PulseAudio.
+
+ Copyright 2008 Lennart Poettering
+
+ PulseAudio is free software; you can redistribute it and/or modify
+ it under the terms of the GNU Lesser General Public License as
+ published by the Free Software Foundation; either version 2.1 of the
+ License, or (at your option) any later version.
+
+ PulseAudio is distributed in the hope that it will be useful, but
+ WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with PulseAudio; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+ USA.
+***/
+
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include <pulsecore/once.h>
+
+#include "i18n.h"
+
+void pa_init_i18n(void) {
+
+ PA_ONCE_BEGIN {
+
+ bindtextdomain(GETTEXT_PACKAGE, PULSE_LOCALEDIR);
+ bind_textdomain_codeset(GETTEXT_PACKAGE, "UTF-8");
+
+ } PA_ONCE_END;
+}
--- /dev/null
+#ifndef foopulsei18nhfoo
+#define foopulsei18nhfoo
+
+/***
+ This file is part of PulseAudio.
+
+ Copyright 2008 Lennart Poettering
+
+ PulseAudio is free software; you can redistribute it and/or modify
+ it under the terms of the GNU Lesser General Public License as
+ published by the Free Software Foundation; either version 2.1 of the
+ License, or (at your option) any later version.
+
+ PulseAudio is distributed in the hope that it will be useful, but
+ WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with PulseAudio; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+ USA.
+***/
+
+#include <pulse/cdecl.h>
+#include <pulse/gccmacro.h>
+
+PA_C_DECL_BEGIN
+
+#if !defined(GETTEXT_PACKAGE)
+#error "Something is very wrong here, config.h needs to be included first"
+#endif
+
+#ifdef ENABLE_NLS
+
+#include <libintl.h>
+
+#define _(String) dgettext(GETTEXT_PACKAGE, String)
+#ifdef gettext_noop
+#define N_(String) gettext_noop(String)
+#else
+#define N_(String) (String)
+#endif
+
+#else /* NLS is disabled */
+
+#define _(String) (String)
+#define N_(String) (String)
+#define textdomain(String) (String)
+#define gettext(String) (String)
+#define dgettext(Domain,String) (String)
+#define dcgettext(Domain,String,Type) (String)
+#define bindtextdomain(Domain,Directory) (Domain)
+#define bind_textdomain_codeset(Domain,Codeset) (Codeset)
+
+#endif /* ENABLE_NLS */
+
+void pa_init_i18n(void);
+
+PA_C_DECL_END
+
+#endif
#include <pulse/xmalloc.h>
#include <pulse/gccmacro.h>
+#include <pulse/i18n.h>
#include <pulsecore/macro.h>
pa_assert(m);
pa_assert(callback);
+ pa_init_i18n();
+
i = pa_xnew(struct once_info, 1);
i->callback = callback;
i->userdata = userdata;
#include <pulse/xmalloc.h>
#include <pulse/gccmacro.h>
+#include <pulse/i18n.h>
#include <pulsecore/core-error.h>
#include <pulsecore/core-util.h>
pa_assert(sig > 0);
pa_assert(_callback);
+ pa_init_i18n();
+
for (e = signals; e; e = e->next)
if (e->sig == sig)
goto fail;
#include <pulse/timeval.h>
#include <pulse/xmalloc.h>
+#include <pulse/i18n.h>
#include <pulsecore/core-util.h>
#include <pulsecore/llist.h>
pa_mainloop *pa_mainloop_new(void) {
pa_mainloop *m;
+ pa_init_i18n();
+
m = pa_xnew(pa_mainloop, 1);
m->wakeup_pipe_type = 0;
#include <pulse/xmalloc.h>
#include <pulse/utf8.h>
+#include <pulse/i18n.h>
#include <pulsecore/hashmap.h>
#include <pulsecore/strbuf.h>
}
pa_proplist* pa_proplist_new(void) {
+ pa_init_i18n();
+
return MAKE_PROPLIST(pa_hashmap_new(pa_idxset_string_hash_func, pa_idxset_string_compare_func));
}
#include <math.h>
#include <string.h>
+#include <pulse/timeval.h>
+#include <pulse/i18n.h>
+
#include <pulsecore/core-util.h>
#include <pulsecore/macro.h>
-#include <pulse/timeval.h>
#include "sample.h"
pa_assert(l);
pa_assert(spec);
+ pa_init_i18n();
+
if (!pa_sample_spec_valid(spec))
- pa_snprintf(s, l, "Invalid");
+ pa_snprintf(s, l, _("Invalid"));
else
pa_snprintf(s, l, "%s %uch %uHz", pa_sample_format_to_string(spec->format), spec->channels, spec->rate);
pa_threaded_mainloop_unlock(p->mainloop);
return (pa_usec_t) -1;
}
-
#include <pulse/xmalloc.h>
#include <pulse/mainloop.h>
+#include <pulse/i18n.h>
#include <pulsecore/log.h>
#include <pulsecore/hashmap.h>
pa_threaded_mainloop *pa_threaded_mainloop_new(void) {
pa_threaded_mainloop *m;
+ pa_init_i18n();
+
m = pa_xnew(pa_threaded_mainloop, 1);
if (!(m->real_mainloop = pa_mainloop_new())) {
#include <stdlib.h>
#include <getopt.h>
#include <fcntl.h>
+#include <locale.h>
+#include <pulse/i18n.h>
#include <pulse/pulseaudio.h>
#define TIME_EVENT_USEC 50000
-#if PA_API_VERSION < 10
-#error Invalid PulseAudio API version
-#endif
-
#define CLEAR_LINE "\x1B[K"
static enum { RECORD, PLAYBACK } mode = PLAYBACK;
l = buffer_length;
if (pa_stream_write(stream, (uint8_t*) buffer + buffer_index, l, NULL, 0, PA_SEEK_RELATIVE) < 0) {
- fprintf(stderr, "pa_stream_write() failed: %s\n", pa_strerror(pa_context_errno(context)));
+ fprintf(stderr, _("pa_stream_write() failed: %s\n"), pa_strerror(pa_context_errno(context)));
quit(1);
return;
}
mainloop_api->io_enable(stdio_event, PA_IO_EVENT_OUTPUT);
if (pa_stream_peek(s, &data, &length) < 0) {
- fprintf(stderr, "pa_stream_peek() failed: %s\n", pa_strerror(pa_context_errno(context)));
+ fprintf(stderr, _("pa_stream_peek() failed: %s\n"), pa_strerror(pa_context_errno(context)));
quit(1);
return;
}
assert(length > 0);
if (buffer) {
- fprintf(stderr, "Buffer overrun, dropping incoming data\n");
+ fprintf(stderr, _("Buffer overrun, dropping incoming data\n"));
if (pa_stream_drop(s) < 0) {
- fprintf(stderr, "pa_stream_drop() failed: %s\n", pa_strerror(pa_context_errno(context)));
+ fprintf(stderr, _("pa_stream_drop() failed: %s\n"), pa_strerror(pa_context_errno(context)));
quit(1);
}
return;
const pa_buffer_attr *a;
char cmt[PA_CHANNEL_MAP_SNPRINT_MAX], sst[PA_SAMPLE_SPEC_SNPRINT_MAX];
- fprintf(stderr, "Stream successfully created.\n");
+ fprintf(stderr, _("Stream successfully created.\n"));
if (!(a = pa_stream_get_buffer_attr(s)))
- fprintf(stderr, "pa_stream_get_buffer_attr() failed: %s\n", pa_strerror(pa_context_errno(pa_stream_get_context(s))));
+ fprintf(stderr, _("pa_stream_get_buffer_attr() failed: %s\n"), pa_strerror(pa_context_errno(pa_stream_get_context(s))));
else {
if (mode == PLAYBACK)
- fprintf(stderr, "Buffer metrics: maxlength=%u, tlength=%u, prebuf=%u, minreq=%u\n", a->maxlength, a->tlength, a->prebuf, a->minreq);
+ fprintf(stderr, _("Buffer metrics: maxlength=%u, tlength=%u, prebuf=%u, minreq=%u\n"), a->maxlength, a->tlength, a->prebuf, a->minreq);
else {
assert(mode == RECORD);
- fprintf(stderr, "Buffer metrics: maxlength=%u, fragsize=%u\n", a->maxlength, a->fragsize);
+ fprintf(stderr, _("Buffer metrics: maxlength=%u, fragsize=%u\n"), a->maxlength, a->fragsize);
}
}
- fprintf(stderr, "Using sample spec '%s', channel map '%s'.\n",
+ fprintf(stderr, _("Using sample spec '%s', channel map '%s'.\n"),
pa_sample_spec_snprint(sst, sizeof(sst), pa_stream_get_sample_spec(s)),
pa_channel_map_snprint(cmt, sizeof(cmt), pa_stream_get_channel_map(s)));
- fprintf(stderr, "Connected to device %s (%u, %ssuspended).\n",
+ fprintf(stderr, _("Connected to device %s (%u, %ssuspended).\n"),
pa_stream_get_device_name(s),
pa_stream_get_device_index(s),
pa_stream_is_suspended(s) ? "" : "not ");
case PA_STREAM_FAILED:
default:
- fprintf(stderr, "Stream error: %s\n", pa_strerror(pa_context_errno(pa_stream_get_context(s))));
+ fprintf(stderr, _("Stream error: %s\n"), pa_strerror(pa_context_errno(pa_stream_get_context(s))));
quit(1);
}
}
if (verbose) {
if (pa_stream_is_suspended(s))
- fprintf(stderr, "Stream device suspended." CLEAR_LINE " \n");
+ fprintf(stderr, _("Stream device suspended.%s \n"), CLEAR_LINE);
else
- fprintf(stderr, "Stream device resumed." CLEAR_LINE " \n");
+ fprintf(stderr, _("Stream device resumed.%s \n"), CLEAR_LINE);
}
}
assert(s);
if (verbose)
- fprintf(stderr, "Stream underrun." CLEAR_LINE " \n");
+ fprintf(stderr, _("Stream underrun.%s \n"), CLEAR_LINE);
}
static void stream_overflow_callback(pa_stream *s, void *userdata) {
assert(s);
if (verbose)
- fprintf(stderr, "Stream overrun." CLEAR_LINE " \n");
+ fprintf(stderr, _("Stream overrun.%s \n"), CLEAR_LINE);
}
static void stream_started_callback(pa_stream *s, void *userdata) {
assert(s);
if (verbose)
- fprintf(stderr, "Stream started." CLEAR_LINE " \n");
+ fprintf(stderr, _("Stream started.%s \n"), CLEAR_LINE);
}
static void stream_moved_callback(pa_stream *s, void *userdata) {
assert(s);
if (verbose)
- fprintf(stderr, "Stream moved to device %s (%u, %ssuspended)." CLEAR_LINE " \n", pa_stream_get_device_name(s), pa_stream_get_device_index(s), pa_stream_is_suspended(s) ? "" : "not ");
+ fprintf(stderr, _("Stream moved to device %s (%u, %ssuspended).%s \n"), pa_stream_get_device_name(s), pa_stream_get_device_index(s), pa_stream_is_suspended(s) ? "" : _("not "), CLEAR_LINE);
}
/* This is called whenever the context status changes */
assert(!stream);
if (verbose)
- fprintf(stderr, "Connection established." CLEAR_LINE " \n");
+ fprintf(stderr, _("Connection established.%s \n"), CLEAR_LINE);
if (!(stream = pa_stream_new(c, stream_name, &sample_spec, channel_map_set ? &channel_map : NULL))) {
- fprintf(stderr, "pa_stream_new() failed: %s\n", pa_strerror(pa_context_errno(c)));
+ fprintf(stderr, _("pa_stream_new() failed: %s\n"), pa_strerror(pa_context_errno(c)));
goto fail;
}
if (mode == PLAYBACK) {
pa_cvolume cv;
if ((r = pa_stream_connect_playback(stream, device, latency > 0 ? &buffer_attr : NULL, flags, pa_cvolume_set(&cv, sample_spec.channels, volume), NULL)) < 0) {
- fprintf(stderr, "pa_stream_connect_playback() failed: %s\n", pa_strerror(pa_context_errno(c)));
+ fprintf(stderr, _("pa_stream_connect_playback() failed: %s\n"), pa_strerror(pa_context_errno(c)));
goto fail;
}
} else {
if ((r = pa_stream_connect_record(stream, device, latency > 0 ? &buffer_attr : NULL, flags)) < 0) {
- fprintf(stderr, "pa_stream_connect_record() failed: %s\n", pa_strerror(pa_context_errno(c)));
+ fprintf(stderr, _("pa_stream_connect_record() failed: %s\n"), pa_strerror(pa_context_errno(c)));
goto fail;
}
}
case PA_CONTEXT_FAILED:
default:
- fprintf(stderr, "Connection failure: %s\n", pa_strerror(pa_context_errno(c)));
+ fprintf(stderr, _("Connection failure: %s\n"), pa_strerror(pa_context_errno(c)));
goto fail;
}
pa_operation *o;
if (!success) {
- fprintf(stderr, "Failed to drain stream: %s\n", pa_strerror(pa_context_errno(context)));
+ fprintf(stderr, _("Failed to drain stream: %s\n"), pa_strerror(pa_context_errno(context)));
quit(1);
}
if (verbose)
- fprintf(stderr, "Playback stream drained.\n");
+ fprintf(stderr, _("Playback stream drained.\n"));
pa_stream_disconnect(stream);
pa_stream_unref(stream);
pa_context_disconnect(context);
else {
if (verbose)
- fprintf(stderr, "Draining connection to server.\n");
+ fprintf(stderr, _("Draining connection to server.\n"));
}
}
if ((r = read(fd, buffer, l)) <= 0) {
if (r == 0) {
if (verbose)
- fprintf(stderr, "Got EOF.\n");
+ fprintf(stderr, _("Got EOF.\n"));
if (stream) {
pa_operation *o;
if (!(o = pa_stream_drain(stream, stream_drain_complete, NULL))) {
- fprintf(stderr, "pa_stream_drain(): %s\n", pa_strerror(pa_context_errno(context)));
+ fprintf(stderr, _("pa_stream_drain(): %s\n"), pa_strerror(pa_context_errno(context)));
quit(1);
return;
}
quit(0);
} else {
- fprintf(stderr, "read() failed: %s\n", strerror(errno));
+ fprintf(stderr, _("read() failed: %s\n"), strerror(errno));
quit(1);
}
assert(buffer_length);
if ((r = write(fd, (uint8_t*) buffer+buffer_index, buffer_length)) <= 0) {
- fprintf(stderr, "write() failed: %s\n", strerror(errno));
+ fprintf(stderr, _("write() failed: %s\n"), strerror(errno));
quit(1);
mainloop_api->io_free(stdio_event);
/* UNIX signal to quit recieved */
static void exit_signal_callback(pa_mainloop_api*m, pa_signal_event *e, int sig, void *userdata) {
if (verbose)
- fprintf(stderr, "Got signal, exiting.\n");
+ fprintf(stderr, _("Got signal, exiting.\n"));
quit(0);
}
if (!success ||
pa_stream_get_time(s, &usec) < 0 ||
pa_stream_get_latency(s, &l, &negative) < 0) {
- fprintf(stderr, "Failed to get latency: %s\n", pa_strerror(pa_context_errno(context)));
+ fprintf(stderr, _("Failed to get latency: %s\n"), pa_strerror(pa_context_errno(context)));
quit(1);
return;
}
- fprintf(stderr, "Time: %0.3f sec; Latency: %0.0f usec. \r",
+ fprintf(stderr, _("Time: %0.3f sec; Latency: %0.0f usec. \r"),
(float) usec / 1000000,
(float) l * (negative?-1:1));
}
if (stream && pa_stream_get_state(stream) == PA_STREAM_READY) {
pa_operation *o;
if (!(o = pa_stream_update_timing_info(stream, stream_update_timing_callback, NULL)))
- fprintf(stderr, "pa_stream_update_timing_info() failed: %s\n", pa_strerror(pa_context_errno(context)));
+ fprintf(stderr, _("pa_stream_update_timing_info() failed: %s\n"), pa_strerror(pa_context_errno(context)));
else
pa_operation_unref(o);
}
static void help(const char *argv0) {
- printf("%s [options]\n\n"
+ printf(_("%s [options]\n\n"
" -h, --help Show this help\n"
" --version Show version\n\n"
" -r, --record Create a connection for recording\n"
" --no-remix Don't upmix or downmix channels.\n"
" --no-remap Map channels by index instead of name.\n"
" --latency=BYTES Request the specified latency in bytes.\n"
- " --process-time=BYTES Request the specified process time per request in bytes.\n"
+ " --process-time=BYTES Request the specified process time per request in bytes.\n")
,
argv0);
}
{NULL, 0, NULL, 0}
};
+ setlocale(LC_ALL, "");
+ bindtextdomain(GETTEXT_PACKAGE, PULSE_LOCALEDIR);
+
if (!(bn = strrchr(argv[0], '/')))
bn = argv[0];
else
goto quit;
case ARG_VERSION:
- printf("pacat "PACKAGE_VERSION"\nCompiled with libpulse %s\nLinked with libpulse %s\n", pa_get_headers_version(), pa_get_library_version());
+ printf(_("pacat %s\nCompiled with libpulse %s\nLinked with libpulse %s\n"), PACKAGE_VERSION, pa_get_headers_version(), pa_get_library_version());
ret = 0;
goto quit;
case ARG_CHANNELMAP:
if (!pa_channel_map_parse(&channel_map, optarg)) {
- fprintf(stderr, "Invalid channel map '%s'\n", optarg);
+ fprintf(stderr, _("Invalid channel map '%s'\n"), optarg);
goto quit;
}
case ARG_LATENCY:
if (((latency = atoi(optarg))) <= 0) {
- fprintf(stderr, "Invalid latency specification '%s'\n", optarg);
+ fprintf(stderr, _("Invalid latency specification '%s'\n"), optarg);
goto quit;
}
break;
case ARG_PROCESS_TIME:
if (((process_time = atoi(optarg))) <= 0) {
- fprintf(stderr, "Invalid process time specification '%s'\n", optarg);
+ fprintf(stderr, _("Invalid process time specification '%s'\n"), optarg);
goto quit;
}
break;
}
if (!pa_sample_spec_valid(&sample_spec)) {
- fprintf(stderr, "Invalid sample specification\n");
+ fprintf(stderr, _("Invalid sample specification\n"));
goto quit;
}
if (channel_map_set && channel_map.channels != sample_spec.channels) {
- fprintf(stderr, "Channel map doesn't match sample specification\n");
+ fprintf(stderr, _("Channel map doesn't match sample specification\n"));
goto quit;
}
if (verbose) {
char t[PA_SAMPLE_SPEC_SNPRINT_MAX];
pa_sample_spec_snprint(t, sizeof(t), &sample_spec);
- fprintf(stderr, "Opening a %s stream with sample specification '%s'.\n", mode == RECORD ? "recording" : "playback", t);
+ fprintf(stderr, _("Opening a %s stream with sample specification '%s'.\n"), mode == RECORD ? _("recording") : _("playback"), t);
}
if (!(optind >= argc)) {
int fd;
if ((fd = open(argv[optind], mode == PLAYBACK ? O_RDONLY : O_WRONLY|O_TRUNC|O_CREAT, 0666)) < 0) {
- fprintf(stderr, "open(): %s\n", strerror(errno));
+ fprintf(stderr, _("open(): %s\n"), strerror(errno));
goto quit;
}
if (dup2(fd, mode == PLAYBACK ? 0 : 1) < 0) {
- fprintf(stderr, "dup2(): %s\n", strerror(errno));
+ fprintf(stderr, _("dup2(): %s\n"), strerror(errno));
goto quit;
}
stream_name = pa_xstrdup(argv[optind]);
} else {
- fprintf(stderr, "Too many arguments.\n");
+ fprintf(stderr, _("Too many arguments.\n"));
goto quit;
}
}
/* Set up a new main loop */
if (!(m = pa_mainloop_new())) {
- fprintf(stderr, "pa_mainloop_new() failed.\n");
+ fprintf(stderr, _("pa_mainloop_new() failed.\n"));
goto quit;
}
mode == PLAYBACK ? STDIN_FILENO : STDOUT_FILENO,
mode == PLAYBACK ? PA_IO_EVENT_INPUT : PA_IO_EVENT_OUTPUT,
mode == PLAYBACK ? stdin_callback : stdout_callback, NULL))) {
- fprintf(stderr, "io_new() failed.\n");
+ fprintf(stderr, _("io_new() failed.\n"));
goto quit;
}
/* Create a new connection context */
if (!(context = pa_context_new(mainloop_api, client_name))) {
- fprintf(stderr, "pa_context_new() failed.\n");
+ fprintf(stderr, _("pa_context_new() failed.\n"));
goto quit;
}
pa_timeval_add(&tv, TIME_EVENT_USEC);
if (!(time_event = mainloop_api->time_new(mainloop_api, &tv, time_event_callback, NULL))) {
- fprintf(stderr, "time_new() failed.\n");
+ fprintf(stderr, _("time_new() failed.\n"));
goto quit;
}
}
/* Run the main loop */
if (pa_mainloop_run(m, &ret) < 0) {
- fprintf(stderr, "pa_mainloop_run() failed.\n");
+ fprintf(stderr, _("pa_mainloop_run() failed.\n"));
goto quit;
}
#include <errno.h>
#include <string.h>
#include <sys/un.h>
+#include <locale.h>
#include <pulse/error.h>
#include <pulse/util.h>
#include <pulse/xmalloc.h>
+#include <pulse/i18n.h>
#include <pulsecore/core-util.h>
#include <pulsecore/log.h>
fd_set ifds, ofds;
char *cli;
+ setlocale(LC_ALL, "");
+ bindtextdomain(GETTEXT_PACKAGE, PULSE_LOCALEDIR);
+
if (pa_pid_file_check_running(&pid, "pulseaudio") < 0) {
- pa_log("no PulseAudio daemon running");
+ pa_log("No PulseAudio daemon running");
goto fail;
}
if ((fd = socket(PF_UNIX, SOCK_STREAM, 0)) < 0) {
- pa_log("socket(PF_UNIX, SOCK_STREAM, 0): %s", strerror(errno));
+ pa_log(_("socket(PF_UNIX, SOCK_STREAM, 0): %s"), strerror(errno));
goto fail;
}
int r;
if ((r = connect(fd, (struct sockaddr*) &sa, sizeof(sa))) < 0 && (errno != ECONNREFUSED && errno != ENOENT)) {
- pa_log("connect(): %s", strerror(errno));
+ pa_log(_("connect(): %s"), strerror(errno));
goto fail;
}
break;
if (pa_pid_file_kill(SIGUSR2, NULL, "pulseaudio") < 0) {
- pa_log("failed to kill PulseAudio daemon.");
+ pa_log(_("Failed to kill PulseAudio daemon."));
goto fail;
}
}
if (i >= 5) {
- pa_log("daemon not responding.");
+ pa_log(_("Daemon not responding."));
goto fail;
}
for (;;) {
if (select(FD_SETSIZE, &ifds, &ofds, NULL, NULL) < 0) {
- pa_log("select(): %s", strerror(errno));
+ pa_log(_("select(): %s"), strerror(errno));
goto fail;
}
if (r == 0)
break;
- pa_log("read(): %s", strerror(errno));
+ pa_log(_("read(): %s"), strerror(errno));
goto fail;
}
if (r == 0)
break;
- pa_log("read(): %s", strerror(errno));
+ pa_log(_("read(): %s"), strerror(errno));
goto fail;
}
assert(obuf_length);
if ((r = write(1, obuf + obuf_index, obuf_length)) < 0) {
- pa_log("write(): %s", strerror(errno));
+ pa_log(_("write(): %s"), strerror(errno));
goto fail;
}
assert(ibuf_length);
if ((r = write(fd, ibuf + ibuf_index, ibuf_length)) < 0) {
- pa_log("write(): %s", strerror(errno));
+ pa_log(_("write(): %s"), strerror(errno));
goto fail;
}
FD_SET(fd, &ofds);
}
-
ret = 0;
fail:
#include <stdlib.h>
#include <limits.h>
#include <getopt.h>
+#include <locale.h>
#include <sndfile.h>
+#include <pulse/i18n.h>
#include <pulse/pulseaudio.h>
#include <pulsecore/core-util.h>
-#if PA_API_VERSION < 10
-#error Invalid PulseAudio API version
-#endif
-
#define BUFSIZE 1024
static pa_context *context = NULL;
static void stat_callback(pa_context *c, const pa_stat_info *i, void *userdata) {
char s[128];
if (!i) {
- fprintf(stderr, "Failed to get statistics: %s\n", pa_strerror(pa_context_errno(c)));
+ fprintf(stderr, _("Failed to get statistics: %s\n"), pa_strerror(pa_context_errno(c)));
quit(1);
return;
}
pa_bytes_snprint(s, sizeof(s), i->memblock_total_size);
- printf("Currently in use: %u blocks containing %s bytes total.\n", i->memblock_total, s);
+ printf(_("Currently in use: %u blocks containing %s bytes total.\n"), i->memblock_total, s);
pa_bytes_snprint(s, sizeof(s), i->memblock_allocated_size);
- printf("Allocated during whole lifetime: %u blocks containing %s bytes total.\n", i->memblock_allocated, s);
+ printf(_("Allocated during whole lifetime: %u blocks containing %s bytes total.\n"), i->memblock_allocated, s);
pa_bytes_snprint(s, sizeof(s), i->scache_size);
- printf("Sample cache size: %s\n", s);
+ printf(_("Sample cache size: %s\n"), s);
complete_action();
}
char s[PA_SAMPLE_SPEC_SNPRINT_MAX];
if (!i) {
- fprintf(stderr, "Failed to get server information: %s\n", pa_strerror(pa_context_errno(c)));
+ fprintf(stderr, _("Failed to get server information: %s\n"), pa_strerror(pa_context_errno(c)));
quit(1);
return;
}
pa_sample_spec_snprint(s, sizeof(s), &i->sample_spec);
- printf("User name: %s\n"
+ printf(_("User name: %s\n"
"Host Name: %s\n"
"Server Name: %s\n"
"Server Version: %s\n"
"Default Sample Specification: %s\n"
"Default Sink: %s\n"
"Default Source: %s\n"
- "Cookie: %08x\n",
+ "Cookie: %08x\n"),
i->user_name,
i->host_name,
i->server_name,
char *pl;
if (is_last < 0) {
- fprintf(stderr, "Failed to get sink information: %s\n", pa_strerror(pa_context_errno(c)));
+ fprintf(stderr, _("Failed to get sink information: %s\n"), pa_strerror(pa_context_errno(c)));
quit(1);
return;
}
printf("\n");
nl = 1;
- printf("*** Sink #%u ***\n"
+ printf(_("*** Sink #%u ***\n"
"Name: %s\n"
"Driver: %s\n"
"Sample Specification: %s\n"
"Monitor Source: %s\n"
"Latency: %0.0f usec, configured %0.0f usec\n"
"Flags: %s%s%s%s%s%s\n"
- "Properties:\n%s",
+ "Properties:\n%s"),
i->index,
i->name,
pa_strnull(i->driver),
pa_sample_spec_snprint(s, sizeof(s), &i->sample_spec),
pa_channel_map_snprint(cm, sizeof(cm), &i->channel_map),
i->owner_module,
- i->mute ? "muted" : pa_cvolume_snprint(cv, sizeof(cv), &i->volume),
+ i->mute ? _("muted") : pa_cvolume_snprint(cv, sizeof(cv), &i->volume),
pa_strnull(i->monitor_source_name),
(double) i->latency, (double) i->configured_latency,
i->flags & PA_SINK_HARDWARE ? "HARDWARE " : "",
char *pl;
if (is_last < 0) {
- fprintf(stderr, "Failed to get source information: %s\n", pa_strerror(pa_context_errno(c)));
+ fprintf(stderr, _("Failed to get source information: %s\n"), pa_strerror(pa_context_errno(c)));
quit(1);
return;
}
printf("\n");
nl = 1;
- printf("*** Source #%u ***\n"
+ printf(_("*** Source #%u ***\n"
"Name: %s\n"
"Driver: %s\n"
"Sample Specification: %s\n"
"Monitor of Sink: %s\n"
"Latency: %0.0f usec, configured %0.0f usec\n"
"Flags: %s%s%s%s%s%s\n"
- "Properties:\n%s",
+ "Properties:\n%s"),
i->index,
i->name,
pa_strnull(i->driver),
pa_channel_map_snprint(cm, sizeof(cm), &i->channel_map),
i->owner_module,
i->mute ? "muted" : pa_cvolume_snprint(cv, sizeof(cv), &i->volume),
- i->monitor_of_sink_name ? i->monitor_of_sink_name : "n/a",
+ i->monitor_of_sink_name ? i->monitor_of_sink_name : _("n/a"),
(double) i->latency, (double) i->configured_latency,
i->flags & PA_SOURCE_HARDWARE ? "HARDWARE " : "",
i->flags & PA_SOURCE_NETWORK ? "NETWORK " : "",
char t[32];
if (is_last < 0) {
- fprintf(stderr, "Failed to get module information: %s\n", pa_strerror(pa_context_errno(c)));
+ fprintf(stderr, _("Failed to get module information: %s\n"), pa_strerror(pa_context_errno(c)));
quit(1);
return;
}
snprintf(t, sizeof(t), "%u", i->n_used);
- printf("*** Module #%u ***\n"
+ printf(_("*** Module #%u ***\n"
"Name: %s\n"
"Argument: %s\n"
"Usage counter: %s\n"
- "Auto unload: %s\n",
+ "Auto unload: %s\n"),
i->index,
i->name,
i->argument ? i->argument : "",
- i->n_used != PA_INVALID_INDEX ? t : "n/a",
+ i->n_used != PA_INVALID_INDEX ? t : _("n/a"),
pa_yes_no(i->auto_unload));
}
char *pl;
if (is_last < 0) {
- fprintf(stderr, "Failed to get client information: %s\n", pa_strerror(pa_context_errno(c)));
+ fprintf(stderr, _("Failed to get client information: %s\n"), pa_strerror(pa_context_errno(c)));
quit(1);
return;
}
snprintf(t, sizeof(t), "%u", i->owner_module);
- printf("*** Client #%u ***\n"
+ printf(_("*** Client #%u ***\n"
"Driver: %s\n"
"Owner Module: %s\n"
- "Properties:\n%s",
+ "Properties:\n%s"),
i->index,
pa_strnull(i->driver),
- i->owner_module != PA_INVALID_INDEX ? t : "n/a",
+ i->owner_module != PA_INVALID_INDEX ? t : _("n/a"),
pl = pa_proplist_to_string(i->proplist));
pa_xfree(pl);
char *pl;
if (is_last < 0) {
- fprintf(stderr, "Failed to get sink input information: %s\n", pa_strerror(pa_context_errno(c)));
+ fprintf(stderr, _("Failed to get sink input information: %s\n"), pa_strerror(pa_context_errno(c)));
quit(1);
return;
}
snprintf(t, sizeof(t), "%u", i->owner_module);
snprintf(k, sizeof(k), "%u", i->client);
- printf("*** Sink Input #%u ***\n"
+ printf(_("*** Sink Input #%u ***\n"
"Driver: %s\n"
"Owner Module: %s\n"
"Client: %s\n"
"Buffer Latency: %0.0f usec\n"
"Sink Latency: %0.0f usec\n"
"Resample method: %s\n"
- "Properties:\n%s",
+ "Properties:\n%s"),
i->index,
pa_strnull(i->driver),
- i->owner_module != PA_INVALID_INDEX ? t : "n/a",
- i->client != PA_INVALID_INDEX ? k : "n/a",
+ i->owner_module != PA_INVALID_INDEX ? t : _("n/a"),
+ i->client != PA_INVALID_INDEX ? k : _("n/a"),
i->sink,
pa_sample_spec_snprint(s, sizeof(s), &i->sample_spec),
pa_channel_map_snprint(cm, sizeof(cm), &i->channel_map),
- i->mute ? "muted" : pa_cvolume_snprint(cv, sizeof(cv), &i->volume),
+ i->mute ? _("muted") : pa_cvolume_snprint(cv, sizeof(cv), &i->volume),
(double) i->buffer_usec,
(double) i->sink_usec,
- i->resample_method ? i->resample_method : "n/a",
+ i->resample_method ? i->resample_method : _("n/a"),
pl = pa_proplist_to_string(i->proplist));
pa_xfree(pl);
char *pl;
if (is_last < 0) {
- fprintf(stderr, "Failed to get source output information: %s\n", pa_strerror(pa_context_errno(c)));
+ fprintf(stderr, _("Failed to get source output information: %s\n"), pa_strerror(pa_context_errno(c)));
quit(1);
return;
}
snprintf(t, sizeof(t), "%u", i->owner_module);
snprintf(k, sizeof(k), "%u", i->client);
- printf("*** Source Output #%u ***\n"
+ printf(_("*** Source Output #%u ***\n"
"Driver: %s\n"
"Owner Module: %s\n"
"Client: %s\n"
"Buffer Latency: %0.0f usec\n"
"Source Latency: %0.0f usec\n"
"Resample method: %s\n"
- "Properties:\n%s",
+ "Properties:\n%s"),
i->index,
pa_strnull(i->driver),
- i->owner_module != PA_INVALID_INDEX ? t : "n/a",
- i->client != PA_INVALID_INDEX ? k : "n/a",
+ i->owner_module != PA_INVALID_INDEX ? t : _("n/a"),
+ i->client != PA_INVALID_INDEX ? k : _("n/a"),
i->source,
pa_sample_spec_snprint(s, sizeof(s), &i->sample_spec),
pa_channel_map_snprint(cm, sizeof(cm), &i->channel_map),
(double) i->buffer_usec,
(double) i->source_usec,
- i->resample_method ? i->resample_method : "n/a",
+ i->resample_method ? i->resample_method : _("n/a"),
pl = pa_proplist_to_string(i->proplist));
pa_xfree(pl);
char *pl;
if (is_last < 0) {
- fprintf(stderr, "Failed to get sample information: %s\n", pa_strerror(pa_context_errno(c)));
+ fprintf(stderr, _("Failed to get sample information: %s\n"), pa_strerror(pa_context_errno(c)));
quit(1);
return;
}
pa_bytes_snprint(t, sizeof(t), i->bytes);
- printf("*** Sample #%u ***\n"
+ printf(_("*** Sample #%u ***\n"
"Name: %s\n"
"Volume: %s\n"
"Sample Specification: %s\n"
"Size: %s\n"
"Lazy: %s\n"
"Filename: %s\n"
- "Properties:\n%s",
+ "Properties:\n%s"),
i->index,
i->name,
pa_cvolume_snprint(cv, sizeof(cv), &i->volume),
- pa_sample_spec_valid(&i->sample_spec) ? pa_sample_spec_snprint(s, sizeof(s), &i->sample_spec) : "n/a",
- pa_sample_spec_valid(&i->sample_spec) ? pa_channel_map_snprint(cm, sizeof(cm), &i->channel_map) : "n/a",
+ pa_sample_spec_valid(&i->sample_spec) ? pa_sample_spec_snprint(s, sizeof(s), &i->sample_spec) : _("n/a"),
+ pa_sample_spec_valid(&i->sample_spec) ? pa_channel_map_snprint(cm, sizeof(cm), &i->channel_map) : _("n/a"),
(double) i->duration/1000000,
t,
pa_yes_no(i->lazy),
- i->filename ? i->filename : "n/a",
+ i->filename ? i->filename : _("n/a"),
pl = pa_proplist_to_string(i->proplist));
pa_xfree(pl);
static void get_autoload_info_callback(pa_context *c, const pa_autoload_info *i, int is_last, void *userdata) {
if (is_last < 0) {
- fprintf(stderr, "Failed to get autoload information: %s\n", pa_strerror(pa_context_errno(c)));
+ fprintf(stderr, _("Failed to get autoload information: %s\n"), pa_strerror(pa_context_errno(c)));
quit(1);
return;
}
printf("\n");
nl = 1;
- printf("*** Autoload Entry #%u ***\n"
+ printf(_("*** Autoload Entry #%u ***\n"
"Name: %s\n"
"Type: %s\n"
"Module: %s\n"
- "Argument: %s\n",
+ "Argument: %s\n"),
i->index,
i->name,
- i->type == PA_AUTOLOAD_SINK ? "sink" : "source",
+ i->type == PA_AUTOLOAD_SINK ? _("sink") : _("source"),
i->module,
i->argument ? i->argument : "");
}
static void simple_callback(pa_context *c, int success, void *userdata) {
if (!success) {
- fprintf(stderr, "Failure: %s\n", pa_strerror(pa_context_errno(c)));
+ fprintf(stderr, _("Failure: %s\n"), pa_strerror(pa_context_errno(c)));
quit(1);
return;
}
static void index_callback(pa_context *c, uint32_t idx, void *userdata) {
if (idx == PA_INVALID_INDEX) {
- fprintf(stderr, "Failure: %s\n", pa_strerror(pa_context_errno(c)));
+ fprintf(stderr, _("Failure: %s\n"), pa_strerror(pa_context_errno(c)));
quit(1);
return;
}
case PA_STREAM_FAILED:
default:
- fprintf(stderr, "Failed to upload sample: %s\n", pa_strerror(pa_context_errno(pa_stream_get_context(s))));
+ fprintf(stderr, _("Failed to upload sample: %s\n"), pa_strerror(pa_context_errno(pa_stream_get_context(s))));
quit(1);
}
}
if ((sf_readf_float(sndfile, d, l)) != l) {
pa_xfree(d);
- fprintf(stderr, "Premature end of file\n");
+ fprintf(stderr, _("Premature end of file\n"));
quit(1);
}
case PA_CONTEXT_FAILED:
default:
- fprintf(stderr, "Connection failure: %s\n", pa_strerror(pa_context_errno(c)));
+ fprintf(stderr, _("Connection failure: %s\n"), pa_strerror(pa_context_errno(c)));
quit(1);
}
}
static void exit_signal_callback(pa_mainloop_api *m, pa_signal_event *e, int sig, void *userdata) {
- fprintf(stderr, "Got SIGINT, exiting.\n");
+ fprintf(stderr, _("Got SIGINT, exiting.\n"));
quit(0);
}
static void help(const char *argv0) {
- printf("%s [options] stat\n"
+ printf(_("%s [options] stat\n"
"%s [options] list\n"
"%s [options] exit\n"
"%s [options] upload-sample FILENAME [NAME]\n"
" -h, --help Show this help\n"
" --version Show version\n\n"
" -s, --server=SERVER The name of the server to connect to\n"
- " -n, --client-name=NAME How to call this client on the server\n",
+ " -n, --client-name=NAME How to call this client on the server\n"),
argv0, argv0, argv0, argv0, argv0, argv0, argv0, argv0, argv0, argv0, argv0, argv0);
}
{NULL, 0, NULL, 0}
};
+ setlocale(LC_ALL, "");
+ bindtextdomain(GETTEXT_PACKAGE, PULSE_LOCALEDIR);
+
if (!(bn = strrchr(argv[0], '/')))
bn = argv[0];
else
goto quit;
case ARG_VERSION:
- printf("pactl "PACKAGE_VERSION"\nCompiled with libpulse %s\nLinked with libpulse %s\n", pa_get_headers_version(), pa_get_library_version());
+ printf(_("pactl %s\n"
+ "Compiled with libpulse %s\n"
+ "Linked with libpulse %s\n"),
+ PACKAGE_VERSION,
+ pa_get_headers_version(),
+ pa_get_library_version());
ret = 0;
goto quit;
action = UPLOAD_SAMPLE;
if (optind+1 >= argc) {
- fprintf(stderr, "Please specify a sample file to load\n");
+ fprintf(stderr, _("Please specify a sample file to load\n"));
goto quit;
}
memset(&sfinfo, 0, sizeof(sfinfo));
if (!(sndfile = sf_open(argv[optind+1], SFM_READ, &sfinfo))) {
- fprintf(stderr, "Failed to open sound file.\n");
+ fprintf(stderr, _("Failed to open sound file.\n"));
goto quit;
}
} else if (!strcmp(argv[optind], "play-sample")) {
action = PLAY_SAMPLE;
if (argc != optind+2 && argc != optind+3) {
- fprintf(stderr, "You have to specify a sample name to play\n");
+ fprintf(stderr, _("You have to specify a sample name to play\n"));
goto quit;
}
} else if (!strcmp(argv[optind], "remove-sample")) {
action = REMOVE_SAMPLE;
if (argc != optind+2) {
- fprintf(stderr, "You have to specify a sample name to remove\n");
+ fprintf(stderr, _("You have to specify a sample name to remove\n"));
goto quit;
}
} else if (!strcmp(argv[optind], "move-sink-input")) {
action = MOVE_SINK_INPUT;
if (argc != optind+3) {
- fprintf(stderr, "You have to specify a sink input index and a sink\n");
+ fprintf(stderr, _("You have to specify a sink input index and a sink\n"));
goto quit;
}
} else if (!strcmp(argv[optind], "move-source-output")) {
action = MOVE_SOURCE_OUTPUT;
if (argc != optind+3) {
- fprintf(stderr, "You have to specify a source output index and a source\n");
+ fprintf(stderr, _("You have to specify a source output index and a source\n"));
goto quit;
}
action = LOAD_MODULE;
if (argc <= optind+1) {
- fprintf(stderr, "You have to specify a module name and arguments.\n");
+ fprintf(stderr, _("You have to specify a module name and arguments.\n"));
goto quit;
}
action = UNLOAD_MODULE;
if (argc != optind+2) {
- fprintf(stderr, "You have to specify a module index\n");
+ fprintf(stderr, _("You have to specify a module index\n"));
goto quit;
}
action = SUSPEND_SINK;
if (argc > optind+3 || optind+1 >= argc) {
- fprintf(stderr, "You may not specify more than one sink. You have to specify at least one boolean value.\n");
+ fprintf(stderr, _("You may not specify more than one sink. You have to specify at least one boolean value.\n"));
goto quit;
}
action = SUSPEND_SOURCE;
if (argc > optind+3 || optind+1 >= argc) {
- fprintf(stderr, "You may not specify more than one source. You have to specify at least one boolean value.\n");
+ fprintf(stderr, _("You may not specify more than one source. You have to specify at least one boolean value.\n"));
goto quit;
}
}
if (action == NONE) {
- fprintf(stderr, "No valid command specified.\n");
+ fprintf(stderr, _("No valid command specified.\n"));
goto quit;
}
if (!(m = pa_mainloop_new())) {
- fprintf(stderr, "pa_mainloop_new() failed.\n");
+ fprintf(stderr, _("pa_mainloop_new() failed.\n"));
goto quit;
}
#endif
if (!(context = pa_context_new(mainloop_api, client_name))) {
- fprintf(stderr, "pa_context_new() failed.\n");
+ fprintf(stderr, _("pa_context_new() failed.\n"));
goto quit;
}
pa_context_connect(context, server, 0, NULL);
if (pa_mainloop_run(m, &ret) < 0) {
- fprintf(stderr, "pa_mainloop_run() failed.\n");
+ fprintf(stderr, _("pa_mainloop_run() failed.\n"));
goto quit;
}
#include <sndfile.h>
#include <pulse/pulseaudio.h>
-
-#if PA_API_VERSION < 9
-#error Invalid PulseAudio API version
-#endif
+#include <pulse/i18n.h>
static pa_context *context = NULL;
static pa_stream *stream = NULL;
pa_operation *o;
if (!success) {
- fprintf(stderr, "Failed to drain stream: %s\n", pa_strerror(pa_context_errno(context)));
+ fprintf(stderr, _("Failed to drain stream: %s\n"), pa_strerror(pa_context_errno(context)));
quit(1);
}
if (verbose)
- fprintf(stderr, "Playback stream drained.\n");
+ fprintf(stderr, _("Playback stream drained.\n"));
pa_stream_disconnect(stream);
pa_stream_unref(stream);
pa_operation_unref(o);
if (verbose)
- fprintf(stderr, "Draining connection to server.\n");
+ fprintf(stderr, _("Draining connection to server.\n"));
}
}
case PA_STREAM_READY:
if (verbose)
- fprintf(stderr, "Stream successfully created\n");
+ fprintf(stderr, _("Stream successfully created\n"));
break;
case PA_STREAM_FAILED:
default:
- fprintf(stderr, "Stream errror: %s\n", pa_strerror(pa_context_errno(pa_stream_get_context(s))));
+ fprintf(stderr, _("Stream errror: %s\n"), pa_strerror(pa_context_errno(pa_stream_get_context(s))));
quit(1);
}
}
assert(c && !stream);
if (verbose)
- fprintf(stderr, "Connection established.\n");
+ fprintf(stderr, _("Connection established.\n"));
stream = pa_stream_new(c, stream_name, &sample_spec, channel_map_set ? &channel_map : NULL);
assert(stream);
case PA_CONTEXT_FAILED:
default:
- fprintf(stderr, "Connection failure: %s\n", pa_strerror(pa_context_errno(c)));
+ fprintf(stderr, _("Connection failure: %s\n"), pa_strerror(pa_context_errno(c)));
quit(1);
}
}
/* UNIX signal to quit recieved */
static void exit_signal_callback(pa_mainloop_api*m, pa_signal_event *e, int sig, void *userdata) {
if (verbose)
- fprintf(stderr, "Got SIGINT, exiting.\n");
+ fprintf(stderr, _("Got SIGINT, exiting.\n"));
quit(0);
}
static void help(const char *argv0) {
- printf("%s [options] [FILE]\n\n"
+ printf(_("%s [options] [FILE]\n\n"
" -h, --help Show this help\n"
" --version Show version\n\n"
" -v, --verbose Enable verbose operation\n\n"
" -n, --client-name=NAME How to call this client on the server\n"
" --stream-name=NAME How to call this stream on the server\n"
" --volume=VOLUME Specify the initial (linear) volume in range 0...65536\n"
- " --channel-map=CHANNELMAP Set the channel map to the use\n",
+ " --channel-map=CHANNELMAP Set the channel map to the use\n"),
argv0);
}
};
setlocale(LC_ALL, "");
+ bindtextdomain(GETTEXT_PACKAGE, PULSE_LOCALEDIR);
if (!(bn = strrchr(argv[0], '/')))
bn = argv[0];
goto quit;
case ARG_VERSION:
- printf("paplay "PACKAGE_VERSION"\nCompiled with libpulse %s\nLinked with libpulse %s\n", pa_get_headers_version(), pa_get_library_version());
+ printf(_("paplay %s\nCompiled with libpulse %s\n"
+ "Linked with libpulse %s\n"), PACKAGE_VERSION, pa_get_headers_version(), pa_get_library_version());
ret = 0;
goto quit;
case ARG_CHANNELMAP:
if (!pa_channel_map_parse(&channel_map, optarg)) {
- fprintf(stderr, "Invalid channel map\n");
+ fprintf(stderr, _("Invalid channel map\n"));
goto quit;
}
sndfile = sf_open_fd(STDIN_FILENO, SFM_READ, &sfinfo, 0);
if (!sndfile) {
- fprintf(stderr, "Failed to open file '%s'\n", filename);
+ fprintf(stderr, _("Failed to open file '%s'\n"), filename);
goto quit;
}
assert(pa_sample_spec_valid(&sample_spec));
if (channel_map_set && channel_map.channels != sample_spec.channels) {
- fprintf(stderr, "Channel map doesn't match file.\n");
+ fprintf(stderr, _("Channel map doesn't match file.\n"));
goto quit;
}
if (verbose) {
char t[PA_SAMPLE_SPEC_SNPRINT_MAX];
pa_sample_spec_snprint(t, sizeof(t), &sample_spec);
- fprintf(stderr, "Using sample spec '%s'\n", t);
+ fprintf(stderr, _("Using sample spec '%s'\n"), t);
}
/* Set up a new main loop */
if (!(m = pa_mainloop_new())) {
- fprintf(stderr, "pa_mainloop_new() failed.\n");
+ fprintf(stderr, _("pa_mainloop_new() failed.\n"));
goto quit;
}
/* Create a new connection context */
if (!(context = pa_context_new(mainloop_api, client_name))) {
- fprintf(stderr, "pa_context_new() failed.\n");
+ fprintf(stderr, _("pa_context_new() failed.\n"));
goto quit;
}
/* Run the main loop */
if (pa_mainloop_run(m, &ret) < 0) {
- fprintf(stderr, "pa_mainloop_run() failed.\n");
+ fprintf(stderr, _("pa_mainloop_run() failed.\n"));
goto quit;
}
#include <stdlib.h>
#include <limits.h>
#include <getopt.h>
-
-#include <sndfile.h>
+#include <locale.h>
#ifdef __linux__
#include <sys/prctl.h>
#endif
+#include <pulse/i18n.h>
#include <pulse/pulseaudio.h>
#include <pulsecore/macro.h>
-#if PA_API_VERSION < 10
-#error Invalid PulseAudio API version
-#endif
-
#define BUFSIZE 1024
static pa_context *context = NULL;
if ((child_pid = fork()) < 0) {
- fprintf(stderr, "fork(): %s\n", strerror(errno));
+ fprintf(stderr, _("fork(): %s\n"), strerror(errno));
quit(1);
} else if (child_pid == 0) {
#endif
if (execvp(child_argv[0], child_argv) < 0)
- fprintf(stderr, "execvp(): %s\n", strerror(errno));
+ fprintf(stderr, _("execvp(): %s\n"), strerror(errno));
_exit(1);
n++;
if (!success) {
- fprintf(stderr, "Failure to suspend: %s\n", pa_strerror(pa_context_errno(c)));
+ fprintf(stderr, _("Failure to suspend: %s\n"), pa_strerror(pa_context_errno(c)));
quit(1);
return;
}
n++;
if (!success) {
- fprintf(stderr, "Failure to resume: %s\n", pa_strerror(pa_context_errno(c)));
+ fprintf(stderr, _("Failure to resume: %s\n"), pa_strerror(pa_context_errno(c)));
quit(1);
return;
}
pa_operation_unref(pa_context_suspend_sink_by_index(c, PA_INVALID_INDEX, 1, suspend_complete, NULL));
pa_operation_unref(pa_context_suspend_source_by_index(c, PA_INVALID_INDEX, 1, suspend_complete, NULL));
} else {
- fprintf(stderr, "WARNING: Sound server is not local, not suspending.\n");
+ fprintf(stderr, _("WARNING: Sound server is not local, not suspending.\n"));
start_child();
}
case PA_CONTEXT_FAILED:
default:
- fprintf(stderr, "Connection failure: %s\n", pa_strerror(pa_context_errno(c)));
+ fprintf(stderr, _("Connection failure: %s\n"), pa_strerror(pa_context_errno(c)));
pa_context_unref(context);
context = NULL;
}
static void sigint_callback(pa_mainloop_api *m, pa_signal_event *e, int sig, void *userdata) {
- fprintf(stderr, "Got SIGINT, exiting.\n");
+ fprintf(stderr, _("Got SIGINT, exiting.\n"));
quit(0);
}
if (WIFEXITED(status))
child_ret = WEXITSTATUS(status);
else if (WIFSIGNALED(status)) {
- fprintf(stderr, "WARNING: Child process terminated by signal %u\n", WTERMSIG(status));
+ fprintf(stderr, _("WARNING: Child process terminated by signal %u\n"), WTERMSIG(status));
child_ret = 1;
}
static void help(const char *argv0) {
- printf("%s [options] ... \n\n"
+ printf(_("%s [options] ... \n\n"
" -h, --help Show this help\n"
" --version Show version\n"
- " -s, --server=SERVER The name of the server to connect to\n\n",
+ " -s, --server=SERVER The name of the server to connect to\n\n"),
argv0);
}
{NULL, 0, NULL, 0}
};
+ setlocale(LC_ALL, "");
+ bindtextdomain(GETTEXT_PACKAGE, PULSE_LOCALEDIR);
+
if (!(bn = strrchr(argv[0], '/')))
bn = argv[0];
else
goto quit;
case ARG_VERSION:
- printf("pasuspender "PACKAGE_VERSION"\nCompiled with libpulse %s\nLinked with libpulse %s\n", pa_get_headers_version(), pa_get_library_version());
+ printf(_("pasuspender %s\n"
+ "Compiled with libpulse %s\n"
+ "Linked with libpulse %s\n"),
+ PACKAGE_VERSION,
+ pa_get_headers_version(),
+ pa_get_library_version());
ret = 0;
goto quit;
}
if (!(m = pa_mainloop_new())) {
- fprintf(stderr, "pa_mainloop_new() failed.\n");
+ fprintf(stderr, _("pa_mainloop_new() failed.\n"));
goto quit;
}
#endif
if (!(context = pa_context_new(mainloop_api, bn))) {
- fprintf(stderr, "pa_context_new() failed.\n");
+ fprintf(stderr, _("pa_context_new() failed.\n"));
goto quit;
}
pa_context_connect(context, server, PA_CONTEXT_NOAUTOSPAWN, NULL);
if (pa_mainloop_run(m, &ret) < 0) {
- fprintf(stderr, "pa_mainloop_run() failed.\n");
+ fprintf(stderr, _("pa_mainloop_run() failed.\n"));
goto quit;
}
#include <getopt.h>
#include <string.h>
#include <assert.h>
+#include <locale.h>
#include <X11/Xlib.h>
#include <X11/Xatom.h>
#include <pulse/util.h>
+#include <pulse/i18n.h>
#include <pulsecore/core-util.h>
#include <pulsecore/log.h>
Display *d = NULL;
enum { DUMP, EXPORT, IMPORT, REMOVE } mode = DUMP;
+ setlocale(LC_ALL, "");
+ bindtextdomain(GETTEXT_PACKAGE, PULSE_LOCALEDIR);
+
while ((c = getopt(argc, argv, "deiD:S:O:I:c:hr")) != -1) {
switch (c) {
case 'D' :
dname = optarg;
break;
case 'h':
- printf("%s [-D display] [-S server] [-O sink] [-I source] [-c file] [-d|-e|-i|-r]\n\n"
+ printf(_("%s [-D display] [-S server] [-O sink] [-I source] [-c file] [-d|-e|-i|-r]\n\n"
" -d Show current PulseAudio data attached to X11 display (default)\n"
" -e Export local PulseAudio data to X11 display\n"
" -i Import PulseAudio data from X11 display to local environment variables and cookie file.\n"
- " -r Remove PulseAudio data from X11 display\n",
+ " -r Remove PulseAudio data from X11 display\n"),
pa_path_get_filename(argv[0]));
ret = 0;
goto finish;
server = optarg;
break;
default:
- fprintf(stderr, "Failed to parse command line.\n");
+ fprintf(stderr, _("Failed to parse command line.\n"));
goto finish;
}
}
if (!(d = XOpenDisplay(dname))) {
- pa_log("XOpenDisplay() failed");
+ pa_log(_("XOpenDisplay() failed"));
goto finish;
}
case DUMP: {
char t[1024];
if (pa_x11_get_prop(d, "PULSE_SERVER", t, sizeof(t)))
- printf("Server: %s\n", t);
+ printf(_("Server: %s\n"), t);
if (pa_x11_get_prop(d, "PULSE_SOURCE", t, sizeof(t)))
- printf("Source: %s\n", t);
+ printf(_("Source: %s\n"), t);
if (pa_x11_get_prop(d, "PULSE_SINK", t, sizeof(t)))
- printf("Sink: %s\n", t);
+ printf(_("Sink: %s\n"), t);
if (pa_x11_get_prop(d, "PULSE_COOKIE", t, sizeof(t)))
- printf("Cookie: %s\n", t);
+ printf(_("Cookie: %s\n"), t);
break;
}
uint8_t cookie[PA_NATIVE_COOKIE_LENGTH];
size_t l;
if ((l = pa_parsehex(t, cookie, sizeof(cookie))) != sizeof(cookie)) {
- fprintf(stderr, "Failed to parse cookie data\n");
+ fprintf(stderr, _("Failed to parse cookie data\n"));
goto finish;
}
if (pa_authkey_save(cookie_file, cookie, l) < 0) {
- fprintf(stderr, "Failed to save cookie data\n");
+ fprintf(stderr, _("Failed to save cookie data\n"));
goto finish;
}
}
assert(conf);
if (pa_client_conf_load(conf, NULL) < 0) {
- fprintf(stderr, "Failed to load client configuration file.\n");
+ fprintf(stderr, _("Failed to load client configuration file.\n"));
goto finish;
}
if (pa_client_conf_env(conf) < 0) {
- fprintf(stderr, "Failed to read environment configuration data.\n");
+ fprintf(stderr, _("Failed to read environment configuration data.\n"));
goto finish;
}
else {
char hn[256];
if (!pa_get_fqdn(hn, sizeof(hn))) {
- fprintf(stderr, "Failed to get FQDN.\n");
+ fprintf(stderr, _("Failed to get FQDN.\n"));
goto finish;
}
pa_client_conf_free(conf);
if (pa_authkey_load_auto(cookie_file, cookie, sizeof(cookie)) < 0) {
- fprintf(stderr, "Failed to load cookie data\n");
+ fprintf(stderr, _("Failed to load cookie data\n"));
goto finish;
}
break;
default:
- fprintf(stderr, "No yet implemented.\n");
+ fprintf(stderr, _("Not yet implemented.\n"));
goto finish;
}