make profile names translatable

This commit is contained in:
Lennart Poettering 2009-02-20 01:18:37 +01:00
parent d69bd0339f
commit fdca6edf20
5 changed files with 36 additions and 31 deletions

View file

@ -35,6 +35,7 @@
#include <pulse/xmalloc.h> #include <pulse/xmalloc.h>
#include <pulse/util.h> #include <pulse/util.h>
#include <pulse/timeval.h> #include <pulse/timeval.h>
#include <pulse/i18n.h>
#include <pulsecore/core.h> #include <pulsecore/core.h>
#include <pulsecore/module.h> #include <pulsecore/module.h>
@ -254,9 +255,9 @@ static int mmap_write(struct userdata *u, pa_usec_t *sleep_usec, pa_bool_t polle
if (PA_UNLIKELY(n <= u->hwbuf_unused_frames)) { if (PA_UNLIKELY(n <= u->hwbuf_unused_frames)) {
if (polled && pa_log_ratelimit()) if (polled && pa_log_ratelimit())
pa_log("ALSA woke us up to write new data to the device, but there was actually nothing to write! " pa_log(_("ALSA woke us up to write new data to the device, but there was actually nothing to write! "
"Most likely this is an ALSA driver bug. Please report this issue to the ALSA developers. " "Most likely this is an ALSA driver bug. Please report this issue to the ALSA developers. "
"We were woken up with POLLOUT set -- however a subsequent snd_pcm_avail_update() returned 0."); "We were woken up with POLLOUT set -- however a subsequent snd_pcm_avail_update() returned 0."));
break; break;
} }
@ -377,9 +378,9 @@ static int unix_write(struct userdata *u, pa_usec_t *sleep_usec, pa_bool_t polle
if (PA_UNLIKELY(n <= u->hwbuf_unused_frames)) { if (PA_UNLIKELY(n <= u->hwbuf_unused_frames)) {
if (polled && pa_log_ratelimit()) if (polled && pa_log_ratelimit())
pa_log("ALSA woke us up to write new data to the device, but there was actually nothing to write! " pa_log(_("ALSA woke us up to write new data to the device, but there was actually nothing to write! "
"Most likely this is an ALSA driver bug. Please report this issue to the ALSA developers. " "Most likely this is an ALSA driver bug. Please report this issue to the ALSA developers. "
"We were woken up with POLLOUT set -- however a subsequent snd_pcm_avail_update() returned 0."); "We were woken up with POLLOUT set -- however a subsequent snd_pcm_avail_update() returned 0."));
break; break;
} }

View file

@ -35,6 +35,7 @@
#include <pulse/xmalloc.h> #include <pulse/xmalloc.h>
#include <pulse/util.h> #include <pulse/util.h>
#include <pulse/timeval.h> #include <pulse/timeval.h>
#include <pulse/i18n.h>
#include <pulsecore/core-error.h> #include <pulsecore/core-error.h>
#include <pulsecore/core.h> #include <pulsecore/core.h>
@ -240,9 +241,9 @@ static int mmap_read(struct userdata *u, pa_usec_t *sleep_usec, pa_bool_t polled
if (PA_UNLIKELY(n <= 0)) { if (PA_UNLIKELY(n <= 0)) {
if (polled && pa_log_ratelimit()) if (polled && pa_log_ratelimit())
pa_log("ALSA woke us up to read new data from the device, but there was actually nothing to read! " pa_log(_("ALSA woke us up to read new data from the device, but there was actually nothing to read! "
"Most likely this is an ALSA driver bug. Please report this issue to the ALSA developers. " "Most likely this is an ALSA driver bug. Please report this issue to the ALSA developers. "
"We were woken up with POLLIN set -- however a subsequent snd_pcm_avail_update() returned 0."); "We were woken up with POLLIN set -- however a subsequent snd_pcm_avail_update() returned 0."));
break; break;
} }
@ -348,9 +349,9 @@ static int unix_read(struct userdata *u, pa_usec_t *sleep_usec, pa_bool_t polled
if (PA_UNLIKELY(n <= 0)) { if (PA_UNLIKELY(n <= 0)) {
if (polled && pa_log_ratelimit()) if (polled && pa_log_ratelimit())
pa_log("ALSA woke us up to read new data from the device, but there was actually nothing to read! " pa_log(_("ALSA woke us up to read new data from the device, but there was actually nothing to read! "
"Most likely this is an ALSA driver bug. Please report this issue to the ALSA developers. " "Most likely this is an ALSA driver bug. Please report this issue to the ALSA developers. "
"We were woken up with POLLIN set -- however a subsequent snd_pcm_avail_update() returned 0."); "We were woken up with POLLIN set -- however a subsequent snd_pcm_avail_update() returned 0."));
return work_done; return work_done;
} }

View file

@ -32,6 +32,7 @@
#include <pulse/xmalloc.h> #include <pulse/xmalloc.h>
#include <pulse/timeval.h> #include <pulse/timeval.h>
#include <pulse/util.h> #include <pulse/util.h>
#include <pulse/i18n.h>
#include <pulsecore/log.h> #include <pulsecore/log.h>
#include <pulsecore/macro.h> #include <pulsecore/macro.h>
@ -501,39 +502,39 @@ int pa_alsa_set_sw_params(snd_pcm_t *pcm, snd_pcm_uframes_t avail_min) {
static const struct pa_alsa_profile_info device_table[] = { static const struct pa_alsa_profile_info device_table[] = {
{{ 1, { PA_CHANNEL_POSITION_MONO }}, {{ 1, { PA_CHANNEL_POSITION_MONO }},
"hw", "hw",
"Analog Mono", N_("Analog Mono"),
"analog-mono", "analog-mono",
1 }, 1 },
{{ 2, { PA_CHANNEL_POSITION_LEFT, PA_CHANNEL_POSITION_RIGHT }}, {{ 2, { PA_CHANNEL_POSITION_LEFT, PA_CHANNEL_POSITION_RIGHT }},
"front", "front",
"Analog Stereo", N_("Analog Stereo"),
"analog-stereo", "analog-stereo",
10 }, 10 },
{{ 2, { PA_CHANNEL_POSITION_LEFT, PA_CHANNEL_POSITION_RIGHT }}, {{ 2, { PA_CHANNEL_POSITION_LEFT, PA_CHANNEL_POSITION_RIGHT }},
"iec958", "iec958",
"IEC958 Digital Stereo", N_("Digital Stereo (IEC958)"),
"iec958-stereo", "iec958-stereo",
5 }, 5 },
{{ 2, { PA_CHANNEL_POSITION_LEFT, PA_CHANNEL_POSITION_RIGHT }}, {{ 2, { PA_CHANNEL_POSITION_LEFT, PA_CHANNEL_POSITION_RIGHT }},
"hdmi", "hdmi",
"HDMI Digital Stereo", N_("Digital Stereo (HDMI)"),
"hdmi-stereo", "hdmi-stereo",
4 }, 4 },
{{ 4, { PA_CHANNEL_POSITION_FRONT_LEFT, PA_CHANNEL_POSITION_FRONT_RIGHT, {{ 4, { PA_CHANNEL_POSITION_FRONT_LEFT, PA_CHANNEL_POSITION_FRONT_RIGHT,
PA_CHANNEL_POSITION_REAR_LEFT, PA_CHANNEL_POSITION_REAR_RIGHT }}, PA_CHANNEL_POSITION_REAR_LEFT, PA_CHANNEL_POSITION_REAR_RIGHT }},
"surround40", "surround40",
"Analog Surround 4.0", N_("Analog Surround 4.0"),
"analog-surround-40", "analog-surround-40",
7 }, 7 },
{{ 4, { PA_CHANNEL_POSITION_FRONT_LEFT, PA_CHANNEL_POSITION_FRONT_RIGHT, {{ 4, { PA_CHANNEL_POSITION_FRONT_LEFT, PA_CHANNEL_POSITION_FRONT_RIGHT,
PA_CHANNEL_POSITION_REAR_LEFT, PA_CHANNEL_POSITION_REAR_RIGHT }}, PA_CHANNEL_POSITION_REAR_LEFT, PA_CHANNEL_POSITION_REAR_RIGHT }},
"a52", "a52",
"IEC958/AC3 Digital Surround 4.0", N_("Digital Surround 4.0 (IEC958/AC3)"),
"iec958-ac3-surround-40", "iec958-ac3-surround-40",
2 }, 2 },
@ -541,7 +542,7 @@ static const struct pa_alsa_profile_info device_table[] = {
PA_CHANNEL_POSITION_REAR_LEFT, PA_CHANNEL_POSITION_REAR_RIGHT, PA_CHANNEL_POSITION_REAR_LEFT, PA_CHANNEL_POSITION_REAR_RIGHT,
PA_CHANNEL_POSITION_LFE }}, PA_CHANNEL_POSITION_LFE }},
"surround41", "surround41",
"Analog Surround 4.1", N_("Analog Surround 4.1"),
"analog-surround-41", "analog-surround-41",
7 }, 7 },
@ -549,7 +550,7 @@ static const struct pa_alsa_profile_info device_table[] = {
PA_CHANNEL_POSITION_REAR_LEFT, PA_CHANNEL_POSITION_REAR_RIGHT, PA_CHANNEL_POSITION_REAR_LEFT, PA_CHANNEL_POSITION_REAR_RIGHT,
PA_CHANNEL_POSITION_CENTER }}, PA_CHANNEL_POSITION_CENTER }},
"surround50", "surround50",
"Analog Surround 5.0", N_("Analog Surround 5.0"),
"analog-surround-50", "analog-surround-50",
7 }, 7 },
@ -557,7 +558,7 @@ static const struct pa_alsa_profile_info device_table[] = {
PA_CHANNEL_POSITION_REAR_LEFT, PA_CHANNEL_POSITION_REAR_RIGHT, PA_CHANNEL_POSITION_REAR_LEFT, PA_CHANNEL_POSITION_REAR_RIGHT,
PA_CHANNEL_POSITION_CENTER, PA_CHANNEL_POSITION_LFE }}, PA_CHANNEL_POSITION_CENTER, PA_CHANNEL_POSITION_LFE }},
"surround51", "surround51",
"Analog Surround 5.1", N_("Analog Surround 5.1"),
"analog-surround-51", "analog-surround-51",
8 }, 8 },
@ -565,7 +566,7 @@ static const struct pa_alsa_profile_info device_table[] = {
PA_CHANNEL_POSITION_FRONT_RIGHT, PA_CHANNEL_POSITION_REAR_LEFT, PA_CHANNEL_POSITION_FRONT_RIGHT, PA_CHANNEL_POSITION_REAR_LEFT,
PA_CHANNEL_POSITION_REAR_RIGHT, PA_CHANNEL_POSITION_LFE}}, PA_CHANNEL_POSITION_REAR_RIGHT, PA_CHANNEL_POSITION_LFE}},
"a52", "a52",
"IEC958/AC3 Digital Surround 5.1", N_("Digital Surround 5.1 (IEC958/AC3)"),
"iec958-ac3-surround-51", "iec958-ac3-surround-51",
3 }, 3 },
@ -574,7 +575,7 @@ static const struct pa_alsa_profile_info device_table[] = {
PA_CHANNEL_POSITION_CENTER, PA_CHANNEL_POSITION_LFE, PA_CHANNEL_POSITION_CENTER, PA_CHANNEL_POSITION_LFE,
PA_CHANNEL_POSITION_SIDE_LEFT, PA_CHANNEL_POSITION_SIDE_RIGHT }}, PA_CHANNEL_POSITION_SIDE_LEFT, PA_CHANNEL_POSITION_SIDE_RIGHT }},
"surround71", "surround71",
"Analog Surround 7.1", N_("Analog Surround 7.1"),
"analog-surround-71", "analog-surround-71",
7 }, 7 },
@ -1553,8 +1554,8 @@ snd_pcm_sframes_t pa_alsa_safe_avail_update(snd_pcm_t *pcm, size_t hwbuf_size, c
if (k >= hwbuf_size * 3 || if (k >= hwbuf_size * 3 ||
k >= pa_bytes_per_second(ss)*10) k >= pa_bytes_per_second(ss)*10)
pa_log("snd_pcm_avail_update() returned a value that is exceptionally large: %lu bytes (%lu ms). " pa_log(_("snd_pcm_avail_update() returned a value that is exceptionally large: %lu bytes (%lu ms). "
"Most likely this is an ALSA driver bug. Please report this issue to the ALSA developers.", "Most likely this is an ALSA driver bug. Please report this issue to the ALSA developers."),
(unsigned long) k, (unsigned long) (pa_bytes_to_usec(k, ss) / PA_USEC_PER_MSEC)); (unsigned long) k, (unsigned long) (pa_bytes_to_usec(k, ss) / PA_USEC_PER_MSEC));
return n; return n;
@ -1585,8 +1586,8 @@ int pa_alsa_safe_mmap_begin(snd_pcm_t *pcm, const snd_pcm_channel_area_t **areas
k >= hwbuf_size * 3 || k >= hwbuf_size * 3 ||
k >= pa_bytes_per_second(ss)*10) k >= pa_bytes_per_second(ss)*10)
pa_log("snd_pcm_mmap_begin() returned a value that is exceptionally large: %lu bytes (%lu ms). " pa_log(_("snd_pcm_mmap_begin() returned a value that is exceptionally large: %lu bytes (%lu ms). "
"Most likely this is an ALSA driver bug. Please report this issue to the ALSA developers.", "Most likely this is an ALSA driver bug. Please report this issue to the ALSA developers."),
(unsigned long) k, (unsigned long) (pa_bytes_to_usec(k, ss) / PA_USEC_PER_MSEC)); (unsigned long) k, (unsigned long) (pa_bytes_to_usec(k, ss) / PA_USEC_PER_MSEC));
return r; return r;

View file

@ -59,7 +59,7 @@ int pa_alsa_find_mixer_and_elem(snd_pcm_t *pcm, snd_mixer_t **_m, snd_mixer_elem
typedef struct pa_alsa_profile_info { typedef struct pa_alsa_profile_info {
pa_channel_map map; pa_channel_map map;
const char *alsa_name; const char *alsa_name;
const char *description; const char *description; /* internationalized */
const char *name; const char *name;
unsigned priority; unsigned priority;
} pa_alsa_profile_info; } pa_alsa_profile_info;

View file

@ -33,6 +33,8 @@
#include <pulse/xmalloc.h> #include <pulse/xmalloc.h>
#include <pulse/timeval.h> #include <pulse/timeval.h>
#include <pulse/sample.h> #include <pulse/sample.h>
#include <pulse/i18n.h>
#include <pulsecore/module.h> #include <pulsecore/module.h>
#include <pulsecore/modargs.h> #include <pulsecore/modargs.h>
#include <pulsecore/core-util.h> #include <pulsecore/core-util.h>
@ -1655,7 +1657,7 @@ static int add_card(struct userdata *u, const char * default_profile) {
data.profiles = pa_hashmap_new(pa_idxset_string_hash_func, pa_idxset_string_compare_func); data.profiles = pa_hashmap_new(pa_idxset_string_hash_func, pa_idxset_string_compare_func);
if (u->device->audio_sink_info_valid > 0) { if (u->device->audio_sink_info_valid > 0) {
p = pa_card_profile_new("a2dp", "A2DP Advanced Audio Distribution Profile", sizeof(enum profile)); p = pa_card_profile_new("a2dp", _("High Fidelity Playback (A2DP)"), sizeof(enum profile));
p->priority = 10; p->priority = 10;
p->n_sinks = 1; p->n_sinks = 1;
p->n_sources = 0; p->n_sources = 0;
@ -1669,7 +1671,7 @@ static int add_card(struct userdata *u, const char * default_profile) {
} }
if (u->device->headset_info_valid > 0) { if (u->device->headset_info_valid > 0) {
p = pa_card_profile_new("hsp", "HSP/HFP Headset/Hands-Free Profile", sizeof(enum profile)); p = pa_card_profile_new("hsp", _("Telephony Duplex (HSP/HFP)"), sizeof(enum profile));
p->priority = 20; p->priority = 20;
p->n_sinks = 1; p->n_sinks = 1;
p->n_sources = 1; p->n_sources = 1;
@ -1684,7 +1686,7 @@ static int add_card(struct userdata *u, const char * default_profile) {
pa_assert(!pa_hashmap_isempty(data.profiles)); pa_assert(!pa_hashmap_isempty(data.profiles));
p = pa_card_profile_new("off", "Off", sizeof(enum profile)); p = pa_card_profile_new("off", _("Off"), sizeof(enum profile));
d = PA_CARD_PROFILE_DATA(p); d = PA_CARD_PROFILE_DATA(p);
*d = PROFILE_OFF; *d = PROFILE_OFF;
pa_hashmap_put(data.profiles, p->name, p); pa_hashmap_put(data.profiles, p->name, p);