From: Alex Henrie Subject: [PATCH] winealsa: Make string "Unknown sound card" translatable. Message-Id: <1432014265-26372-2-git-send-email-alexhenrie24@gmail.com> Date: Mon, 18 May 2015 23:44:24 -0600 --- dlls/winealsa.drv/Makefile.in | 4 +++- dlls/winealsa.drv/mmdevdrv.c | 9 +++++++-- dlls/winealsa.drv/resource.h | 19 +++++++++++++++++++ dlls/winealsa.drv/winealsa.rc | 29 +++++++++++++++++++++++++++++ 4 files changed, 58 insertions(+), 3 deletions(-) create mode 100644 dlls/winealsa.drv/resource.h create mode 100644 dlls/winealsa.drv/winealsa.rc diff --git a/dlls/winealsa.drv/Makefile.in b/dlls/winealsa.drv/Makefile.in index 3158371..7ca1ce5 100644 --- a/dlls/winealsa.drv/Makefile.in +++ b/dlls/winealsa.drv/Makefile.in @@ -1,8 +1,10 @@ MODULE = winealsa.drv -IMPORTS = uuid ole32 advapi32 +IMPORTS = uuid ole32 advapi32 user32 DELAYIMPORTS = winmm EXTRALIBS = $(ALSA_LIBS) C_SRCS = \ midi.c \ mmdevdrv.c + +RC_SRCS = winealsa.rc diff --git a/dlls/winealsa.drv/mmdevdrv.c b/dlls/winealsa.drv/mmdevdrv.c index 90894b6..aa78037 100644 --- a/dlls/winealsa.drv/mmdevdrv.c +++ b/dlls/winealsa.drv/mmdevdrv.c @@ -46,8 +46,12 @@ #include "audioclient.h" #include "audiopolicy.h" +#include "resource.h" + #include +HINSTANCE ALSADRV_hInstance = 0; + WINE_DEFAULT_DEBUG_CHANNEL(alsa); WINE_DECLARE_DEBUG_CHANNEL(winediag); @@ -239,6 +243,7 @@ BOOL WINAPI DllMain(HINSTANCE dll, DWORD reason, void *reserved) switch (reason) { case DLL_PROCESS_ATTACH: + ALSADRV_hInstance = dll; g_timer_q = CreateTimerQueue(); if(!g_timer_q) return FALSE; @@ -558,8 +563,8 @@ static HRESULT alsa_enum_devices(EDataFlow flow, WCHAR ***ids, GUID **guids, } if(snd_card_get_name(card, &cardname) < 0) { - /* FIXME: Should be localized */ - static const WCHAR nameW[] = {'U','n','k','n','o','w','n',' ','s','o','u','n','d','c','a','r','d',0}; + WCHAR nameW[64]; + LoadStringW(ALSADRV_hInstance, IDS_UNKNOWN_CARD, nameW, sizeof(nameW)/sizeof(WCHAR)); WARN("Unable to get card name for ALSA device %s: %d (%s)\n", cardpath, err, snd_strerror(err)); alsa_get_card_devices(flow, stream, ids, guids, num, ctl, card, nameW); diff --git a/dlls/winealsa.drv/resource.h b/dlls/winealsa.drv/resource.h new file mode 100644 index 0000000..3bfbe82 --- /dev/null +++ b/dlls/winealsa.drv/resource.h @@ -0,0 +1,19 @@ +/* + * Copyright 2015 Alex Henrie + * + * This library 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. + * + * This library 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 this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ + +#define IDS_UNKNOWN_CARD 1000 diff --git a/dlls/winealsa.drv/winealsa.rc b/dlls/winealsa.drv/winealsa.rc new file mode 100644 index 0000000..cdcc86f --- /dev/null +++ b/dlls/winealsa.drv/winealsa.rc @@ -0,0 +1,29 @@ +/* + * Copyright 2015 Alex Henrie + * + * This library 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. + * + * This library 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 this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ + +#include "windef.h" +#include "resource.h" + +#pragma makedep po + +LANGUAGE LANG_ENGLISH, SUBLANG_DEFAULT + +STRINGTABLE +{ + IDS_UNKNOWN_CARD "Unknown sound card" +} -- 2.4.1