acp: get i18n interface from support and use it

Save the i18n interface in a global variable. Make acp use the support
interface when translating strings.
This commit is contained in:
Wim Taymans 2021-04-14 18:02:15 +02:00
parent 0b5741e725
commit 3babedec9c
3 changed files with 16 additions and 2 deletions

View file

@ -38,6 +38,7 @@
#include <spa/utils/names.h>
#include <spa/support/loop.h>
#include <spa/support/plugin.h>
#include <spa/support/i18n.h>
#include <spa/monitor/device.h>
#include <spa/monitor/utils.h>
#include <spa/monitor/event.h>
@ -48,6 +49,8 @@
#include "acp/acp.h"
extern struct spa_i18n *acp_i18n;
#define NAME "alsa-device"
#define MAX_POLL 16
@ -927,6 +930,7 @@ impl_init(const struct spa_handle_factory *factory,
this->log = spa_support_find(support, n_support, SPA_TYPE_INTERFACE_Log);
this->loop = spa_support_find(support, n_support, SPA_TYPE_INTERFACE_Loop);
acp_i18n = spa_support_find(support, n_support, SPA_TYPE_INTERFACE_I18N);
if (this->loop == NULL) {
spa_log_error(this->log, "a Loop interface is needed");
return -EINVAL;