# HG changeset patch # User ib # Date 1319550403 0 # Node ID 95c396eb89ab890db6cc3301f106827cfa526f0e # Parent 9b1b7d46b8d00557a88036bcba8f9beb72473283 Internationalize and localize the Win32 GUI. Replace string constants by symbolic constants and add new symbolic constants where necessary. diff -r 9b1b7d46b8d0 -r 95c396eb89ab gui/win32/dialogs.c --- a/gui/win32/dialogs.c Tue Oct 25 13:40:30 2011 +0000 +++ b/gui/win32/dialogs.c Tue Oct 25 13:46:43 2011 +0000 @@ -110,7 +110,7 @@ "Avisynth Scripts (*.avs)\0*.avs\0" "Audio Files (*.mp3;*.wav;*.ra)\0*.mp3;*.wav;*.ra\000"; fileopen.nFilterIndex = 0; - fileopen.lpstrTitle = "Add file(s)..."; + fileopen.lpstrTitle = acp(MSGTR_FileSelect); fileopen.Flags = OFN_ALLOWMULTISELECT | OFN_FILEMUSTEXIST| OFN_LONGNAMES | OFN_EXPLORER| OFN_READONLY | OFN_HIDEREADONLY; fileopen.lpstrFile = filelist; fileopen.lpstrCustomFilter = NULL; @@ -171,7 +171,7 @@ subtitleopen.lpstrFilter = "All Files (*.*)\0*.*\0" "Subtitle Files (*.srt;*.txt;*.vob)\0*.srt;*.txt;*.vob\0"; subtitleopen.nFilterIndex = 0; - subtitleopen.lpstrTitle = "Add Subtitle..."; + subtitleopen.lpstrTitle = acp(MSGTR_SubtitleSelect); subtitleopen.Flags = OFN_FILEMUSTEXIST | OFN_LONGNAMES | OFN_EXPLORER | OFN_READONLY | OFN_HIDEREADONLY; subtitleopen.lpstrFile = subtitlefile; subtitleopen.lpstrCustomFilter = NULL; @@ -195,7 +195,7 @@ playlistopen.lpstrFilter = "All Files (*.*)\0*.*\0" "Playlist Files (*.m3u;*.pls;*.txt)\0*.m3u;*.pls;*.txt\0"; playlistopen.nFilterIndex = 0; - playlistopen.lpstrTitle = "Load Playlist..."; + playlistopen.lpstrTitle = acp(MSGTR_PlaylistSelect); playlistopen.Flags = OFN_FILEMUSTEXIST | OFN_LONGNAMES | OFN_EXPLORER | OFN_READONLY | OFN_HIDEREADONLY; playlistopen.lpstrFile = playlistfile; playlistopen.lpstrCustomFilter = NULL; @@ -222,7 +222,7 @@ playlistsave.hInstance = GetModuleHandle(NULL); playlistsave.lpstrFilter = "Playlist Files (*.pls)\0*.pls\0"; playlistsave.nFilterIndex = 0; - playlistsave.lpstrTitle = "Save Playlist..."; + playlistsave.lpstrTitle = acp(MSGTR_PlaylistSave); playlistsave.Flags = OFN_LONGNAMES | OFN_EXPLORER | OFN_OVERWRITEPROMPT | OFN_HIDEREADONLY; playlistsave.lpstrFile = playlistname; playlistsave.lpstrCustomFilter = NULL; @@ -270,7 +270,7 @@ switch (iMsg) { case WM_CREATE: - wdg = CreateWindow("button", "Ok", + wdg = CreateWindow("button", acp(MSGTR_Ok), WS_CHILD | WS_VISIBLE | BS_PUSHBUTTON, 4, 43, 80, 25, hwnd, (HMENU) ID_OK, @@ -278,7 +278,7 @@ NULL); SendMessage(wdg, WM_SETFONT, (WPARAM) GetStockObject(DEFAULT_GUI_FONT), 0); - wdg = CreateWindow("button", "Cancel", + wdg = CreateWindow("button", acp(MSGTR_Cancel), WS_CHILD | WS_VISIBLE | BS_PUSHBUTTON, 90, 43, 80, 25, hwnd, (HMENU) ID_CANCEL, @@ -360,7 +360,7 @@ switch (LOWORD(wParam)) { case VK_RETURN: - SendMessage(FindWindow(NULL, "MPlayer - Open URL..."), WM_COMMAND, (WPARAM) ID_OK, 0); + SendMessage(FindWindow(NULL, acp(MSGTR_Network)), WM_COMMAND, (WPARAM) ID_OK, 0); break; } } @@ -375,7 +375,7 @@ int x, y; if(add) addurl = 1; - if(FindWindow(NULL, "MPlayer - Open URL...")) return; + if(FindWindow(NULL, acp(MSGTR_Network))) return; wc.style = CS_HREDRAW | CS_VREDRAW; wc.lpfnWndProc = OpenUrlWndProc; wc.cbClsExtra = 0; @@ -384,13 +384,13 @@ wc.hCursor = LoadCursor(NULL,IDC_ARROW); wc.hIcon = gui->icon; wc.hbrBackground = SOLID_GREY2; - wc.lpszClassName = "MPlayer - URL"; + wc.lpszClassName = acp(MSGTR_Network); wc.lpszMenuName = NULL; RegisterClass(&wc); x = (GetSystemMetrics(SM_CXSCREEN) / 2) - (320 / 2); y = (GetSystemMetrics(SM_CYSCREEN) / 2) - (100 / 2); - hWnd = CreateWindow("MPlayer - URL", - "MPlayer - Open URL...", + hWnd = CreateWindow(acp(MSGTR_Network), + acp(MSGTR_Network), WS_POPUPWINDOW | WS_CAPTION, x, y, @@ -408,13 +408,13 @@ static void create_playlistmenu(gui_t *gui) { gui->playlistmenu = CreatePopupMenu(); - AppendMenu(gui->playlistmenu, MF_STRING, ID_ADDFILE, "Add File..."); - AppendMenu(gui->playlistmenu, MF_STRING, ID_ADDURL, "Add Url..."); + AppendMenu(gui->playlistmenu, MF_STRING, ID_ADDFILE, acp(MSGTR_PLAYLIST_AddFile)); + AppendMenu(gui->playlistmenu, MF_STRING, ID_ADDURL, acp(MSGTR_PLAYLIST_AddURL)); AppendMenu(gui->playlistmenu, MF_SEPARATOR, 0, 0); - AppendMenu(gui->playlistmenu, MF_STRING, ID_REMOVE, "Remove Selected"); - AppendMenu(gui->playlistmenu, MF_STRING, ID_CLEAR, "Clear Playlist"); + AppendMenu(gui->playlistmenu, MF_STRING, ID_REMOVE, acp(MSGTR_Remove)); + AppendMenu(gui->playlistmenu, MF_STRING, ID_CLEAR, acp(MSGTR_Clear)); AppendMenu(gui->playlistmenu, MF_SEPARATOR, 0, 0); - AppendMenu(gui->playlistmenu, MF_STRING, ID_CLOSE, "Close"); + AppendMenu(gui->playlistmenu, MF_STRING, ID_CLOSE, acp(MSGTR_Close)); } static void updatetracklist(HWND hwnd) @@ -440,7 +440,7 @@ { case WM_CREATE: { - wdg = CreateWindow("button", "Play", + wdg = CreateWindow("button", acp(MSGTR_MENU_Play), WS_CHILD | WS_VISIBLE | BS_PUSHBUTTON, 4, 10, 80, 25, hwnd, (HMENU) ID_PLAY, @@ -448,7 +448,7 @@ NULL); SendMessage(wdg, WM_SETFONT, (WPARAM) GetStockObject(DEFAULT_GUI_FONT), 0); - wdg = CreateWindow ("button", "Up", + wdg = CreateWindow ("button", acp(MSGTR_Up), WS_CHILD | WS_VISIBLE | BS_PUSHBUTTON, 4, 37, 80, 25, hwnd, (HMENU) ID_UP, @@ -456,7 +456,7 @@ NULL); SendMessage(wdg, WM_SETFONT,(WPARAM) GetStockObject(DEFAULT_GUI_FONT), 0); - wdg = CreateWindow ("button", "Down", + wdg = CreateWindow ("button", acp(MSGTR_Down), WS_CHILD | WS_VISIBLE | BS_PUSHBUTTON, 4, 64, 80, 25, hwnd, (HMENU) ID_DOWN, @@ -464,7 +464,7 @@ NULL); SendMessage(wdg, WM_SETFONT, (WPARAM) GetStockObject(DEFAULT_GUI_FONT),0); - wdg = CreateWindow ("button", "Remove", + wdg = CreateWindow ("button", acp(MSGTR_Remove), WS_CHILD | WS_VISIBLE | BS_PUSHBUTTON, 4, 91, 80, 25, hwnd, (HMENU) ID_REMOVE, @@ -472,7 +472,7 @@ NULL); SendMessage(wdg, WM_SETFONT, (WPARAM) GetStockObject(DEFAULT_GUI_FONT),0); - wdg = CreateWindow ("button", "Load", + wdg = CreateWindow ("button", acp(MSGTR_Load), WS_CHILD | WS_VISIBLE | BS_PUSHBUTTON, 4, 118, 80, 25, hwnd, (HMENU) ID_PLAYLISTLOAD, @@ -480,7 +480,7 @@ NULL); SendMessage(wdg, WM_SETFONT, (WPARAM) GetStockObject(DEFAULT_GUI_FONT),0); - wdg = CreateWindow ("button", "Save", + wdg = CreateWindow ("button", acp(MSGTR_Save), WS_CHILD | WS_VISIBLE | BS_PUSHBUTTON, 4, 145, 80, 25, hwnd, (HMENU) ID_PLAYLISTSAVE, @@ -488,7 +488,7 @@ NULL); SendMessage(wdg, WM_SETFONT, (WPARAM) GetStockObject(DEFAULT_GUI_FONT),0); - wdg = CreateWindow ("button", "Close", + wdg = CreateWindow ("button", acp(MSGTR_Close), WS_CHILD | WS_VISIBLE | BS_PUSHBUTTON, 4, 193, 80, 25, hwnd, (HMENU) ID_CLOSE, @@ -610,13 +610,13 @@ void update_playlistwindow(void) { - HWND hWnd = FindWindow(NULL, "MPlayer Playlist"); + HWND hWnd = FindWindow(NULL, acp(MSGTR_PlayList)); if (hWnd) updatetracklist(hWnd); } void display_playlistwindow(gui_t *gui) { - HWND hWnd = FindWindow(NULL, "MPlayer Playlist"); + HWND hWnd = FindWindow(NULL, acp(MSGTR_PlayList)); HINSTANCE hInstance = GetModuleHandle(NULL); WNDCLASS wc; int x, y; @@ -635,14 +635,14 @@ wc.hCursor = LoadCursor(NULL,IDC_ARROW); wc.hIcon = gui->icon; wc.hbrBackground = SOLID_GREY2; - wc.lpszClassName = "MPlayer - Playlist"; + wc.lpszClassName = acp(MSGTR_PlayList); wc.lpszMenuName = NULL; RegisterClass(&wc); create_playlistmenu(gui); x = (GetSystemMetrics(SM_CXSCREEN) / 2) - (400 / 2); /* Erik: center popup window on screen */ y = (GetSystemMetrics(SM_CYSCREEN) / 2) - (254 / 2); - hWnd = CreateWindow("MPlayer - Playlist", - "MPlayer Playlist", + hWnd = CreateWindow(acp(MSGTR_PlayList), + acp(MSGTR_PlayList), WS_POPUPWINDOW | WS_CAPTION | WS_MINIMIZEBOX, x, y, @@ -734,7 +734,7 @@ void display_skinbrowser(gui_t* gui) { - HWND hWnd = FindWindow(NULL, "Skin Browser"); + HWND hWnd = FindWindow(NULL, acp(MSGTR_SkinBrowser)); HINSTANCE hInstance = GetModuleHandle(NULL); WNDCLASS wc; int x, y; @@ -753,13 +753,13 @@ wc.hCursor = LoadCursor(NULL, IDC_ARROW); wc.hIcon = gui->icon; wc.hbrBackground = SOLID_GREY2; - wc.lpszClassName = "Skin Browser"; + wc.lpszClassName = acp(MSGTR_SkinBrowser); wc.lpszMenuName = NULL; RegisterClass(&wc); x = (GetSystemMetrics(SM_CXSCREEN) / 2) - (180 / 2); y = (GetSystemMetrics(SM_CYSCREEN) / 2) - (102 / 2); - hWnd = CreateWindow("Skin Browser", - "Skin Browser", + hWnd = CreateWindow(acp(MSGTR_SkinBrowser), + acp(MSGTR_SkinBrowser), WS_POPUPWINDOW |WS_CAPTION, x, y, @@ -787,7 +787,7 @@ switch (iMsg) { case WM_CREATE: - wdg = CreateWindow("button", "Ok", + wdg = CreateWindow("button", acp(MSGTR_Ok), WS_CHILD | WS_VISIBLE | BS_PUSHBUTTON, 4, 43, 80, 25, hwnd, (HMENU) ID_OK, @@ -795,7 +795,7 @@ NULL); SendMessage(wdg, WM_SETFONT, (WPARAM) GetStockObject(DEFAULT_GUI_FONT), 0); - wdg = CreateWindow("button", "Cancel", + wdg = CreateWindow("button", acp(MSGTR_Cancel), WS_CHILD | WS_VISIBLE | BS_PUSHBUTTON, 90, 43, 80, 25, hwnd, (HMENU) ID_CANCEL, @@ -872,7 +872,7 @@ int x, y; if (guiInfo.StreamType != STREAMTYPE_DVD) return; - if (FindWindow(NULL, "Select Title/Chapter...")) return; + if (FindWindow(NULL, acp(MSGTR_SelectChapter))) return; wc.style = CS_HREDRAW | CS_VREDRAW; wc.lpfnWndProc = TitleChapterWndProc; @@ -882,13 +882,13 @@ wc.hCursor = LoadCursor(NULL,IDC_ARROW); wc.hIcon = gui->icon; wc.hbrBackground = SOLID_GREY2; - wc.lpszClassName = "Select Title/Chapter..."; + wc.lpszClassName = acp(MSGTR_SelectChapter); wc.lpszMenuName = NULL; RegisterClass(&wc); x = (GetSystemMetrics(SM_CXSCREEN) / 2) - (180 / 2); y = (GetSystemMetrics(SM_CYSCREEN) / 2) - (100 / 2); - hWnd = CreateWindow("Select Title/Chapter...", - "Select Title/Chapter...", + hWnd = CreateWindow(acp(MSGTR_SelectChapter), + acp(MSGTR_SelectChapter), WS_POPUPWINDOW | WS_CAPTION, x, y, @@ -912,7 +912,7 @@ { case WM_CREATE: { - btn = CreateWindow("button", "Reset", + btn = CreateWindow("button", acp(MSGTR_Clear), WS_CHILD | WS_VISIBLE | BS_PUSHBUTTON, 157, 143, 80, 25, hwnd, (HMENU) ID_DEFAULTS, @@ -920,7 +920,7 @@ NULL); SendMessage(btn, WM_SETFONT, (WPARAM) GetStockObject(DEFAULT_GUI_FONT), 0); - btn = CreateWindow("button", "Close", + btn = CreateWindow("button", acp(MSGTR_Close), WS_CHILD | WS_VISIBLE | BS_PUSHBUTTON, 243, 143, 80, 25, hwnd, (HMENU) ID_CLOSE, @@ -928,7 +928,7 @@ NULL); SendMessage(btn, WM_SETFONT, (WPARAM) GetStockObject(DEFAULT_GUI_FONT), 0); - label = CreateWindow("static", "Brightness", + label = CreateWindow("static", acp(MSGTR_EQU_Brightness), WS_CHILD | WS_VISIBLE, 12, 122, 70, 15, hwnd, NULL, @@ -936,7 +936,7 @@ NULL); SendMessage(label, WM_SETFONT, (WPARAM) GetStockObject(DEFAULT_GUI_FONT), 0); - label = CreateWindow("static", "Contrast", + label = CreateWindow("static", acp(MSGTR_EQU_Contrast), WS_CHILD | WS_VISIBLE, 99, 122, 70, 15, hwnd, NULL, @@ -944,14 +944,14 @@ NULL); SendMessage(label, WM_SETFONT, (WPARAM) GetStockObject(DEFAULT_GUI_FONT), 0); - label = CreateWindow("static", "Hue", + label = CreateWindow("static", acp(MSGTR_EQU_Hue), WS_CHILD | WS_VISIBLE, 191, 122, 70, 15, hwnd, NULL, ((LPCREATESTRUCT) lParam) -> hInstance, NULL); SendMessage(label, WM_SETFONT, (WPARAM) GetStockObject(DEFAULT_GUI_FONT), 0); - label = CreateWindow("static", "Saturation", + label = CreateWindow("static", acp(MSGTR_EQU_Saturation), WS_CHILD | WS_VISIBLE, 260, 122, 70, 15, hwnd, NULL, @@ -1087,7 +1087,7 @@ int x, y; if(!guiInfo.sh_video) return; - if(FindWindow(NULL, "MPlayer - Equalizer")) return; + if(FindWindow(NULL, acp(MSGTR_Equalizer))) return; wc.style = CS_HREDRAW | CS_VREDRAW; wc.lpfnWndProc = EqWndProc; wc.cbClsExtra = 0; @@ -1096,13 +1096,13 @@ wc.hCursor = LoadCursor(NULL,IDC_ARROW); wc.hIcon = gui->icon; wc.hbrBackground = SOLID_GREY2; - wc.lpszClassName = "MPlayer - Equalizer"; + wc.lpszClassName = acp(MSGTR_Equalizer); wc.lpszMenuName = NULL; RegisterClass(&wc); x = (GetSystemMetrics(SM_CXSCREEN) / 2) - (332 / 2); y = (GetSystemMetrics(SM_CYSCREEN) / 2) - (200 / 2); - hWnd = CreateWindow("MPlayer - Equalizer", - "MPlayer - Equalizer", + hWnd = CreateWindow(acp(MSGTR_Equalizer), + acp(MSGTR_Equalizer), WS_POPUPWINDOW | WS_CAPTION, x, y, diff -r 9b1b7d46b8d0 -r 95c396eb89ab gui/win32/gui.c --- a/gui/win32/gui.c Tue Oct 25 13:40:30 2011 +0000 +++ b/gui/win32/gui.c Tue Oct 25 13:46:43 2011 +0000 @@ -69,6 +69,53 @@ static HBRUSH colorbrush = NULL; //Handle to colorkey brush static COLORREF windowcolor = RGB(255,0,255); //Windowcolor == colorkey +/** + * @brief Convert an UTF-8 encoded string into ANSI codepage encoding. + * + * @param utf8 UTF-8 encoded string + * + * @return string containing ANSI codepage encoding of @a utf8 (or, in case + * of error, a string containing the question mark character) + */ +LPSTR acp (LPCSTR utf8) +{ + static LPSTR acp_str = NULL; + int chars; + LPWSTR uc_str; + + chars = MultiByteToWideChar(CP_UTF8, 0, utf8, -1, NULL, 0); + + if (chars) + { + uc_str = malloc(sizeof(*uc_str) * (chars + 1)); + + if (uc_str) + { + MultiByteToWideChar(CP_UTF8, 0, utf8, -1, uc_str, chars); + + chars = WideCharToMultiByte(CP_ACP, 0, uc_str, -1, NULL, 0, NULL, 0); + + if (chars) + { + free(acp_str); + acp_str = malloc(sizeof(*acp_str) * (chars + 1)); + + if (acp_str) + { + WideCharToMultiByte(CP_ACP, 0, uc_str, -1, acp_str, chars, NULL, 0); + free(uc_str); + + return acp_str; + } + } + + free(uc_str); + } + } + + return "?"; +} + static void console_toggle(void) { if (console_state) @@ -133,7 +180,7 @@ { char about_msg[512]; snprintf(about_msg, sizeof(about_msg), MP_TITLE "\n" COPYRIGHT, "MPlayer"); - MessageBox(hWnd, about_msg, "About", MB_OK); + MessageBox(hWnd, about_msg, acp(MSGTR_About), MB_OK); } static image *get_drawground(HWND hwnd) @@ -376,7 +423,7 @@ BROWSEINFO bi; LPITEMIDLIST pidl; memset(&bi, 0, sizeof(BROWSEINFO)); - bi.lpszTitle = "Choose a Directory..."; + bi.lpszTitle = acp(MSGTR_DirectorySelect); pidl = SHBrowseForFolder(&bi); if (SHGetPathFromIDList(pidl, path)) { @@ -927,7 +974,7 @@ BROWSEINFO bi; LPITEMIDLIST pidl; memset(&bi, 0, sizeof(BROWSEINFO)); - bi.lpszTitle = "Choose a Directory..."; + bi.lpszTitle = acp(MSGTR_DirectorySelect); pidl = SHBrowseForFolder(&bi); if (SHGetPathFromIDList(pidl, path)) { @@ -1144,51 +1191,51 @@ gui->diskmenu = CreatePopupMenu(); gui->menu=CreatePopupMenu(); gui->trayplaymenu = CreatePopupMenu(); - AppendMenu(gui->menu, MF_STRING | MF_POPUP, (UINT_PTR) gui->trayplaymenu, "Open..."); - AppendMenu(gui->trayplaymenu, MF_STRING, IDFILE_OPEN, "File..."); - AppendMenu(gui->trayplaymenu, MF_STRING, IDURL_OPEN, "Url..."); - AppendMenu(gui->trayplaymenu, MF_STRING, IDDIR_OPEN, "Directory..."); + AppendMenu(gui->menu, MF_STRING | MF_POPUP, (UINT_PTR) gui->trayplaymenu, acp(MSGTR_MENU_Open)); + AppendMenu(gui->trayplaymenu, MF_STRING, IDFILE_OPEN, acp(MSGTR_MENU_PlayFile)); + AppendMenu(gui->trayplaymenu, MF_STRING, IDURL_OPEN, acp(MSGTR_MENU_PlayURL)); + AppendMenu(gui->trayplaymenu, MF_STRING, IDDIR_OPEN, acp(MSGTR_MENU_PlayDirectory)); AppendMenu(gui->menu, MF_SEPARATOR, 0, 0); - AppendMenu(gui->menu, MF_STRING | MF_POPUP, (UINT_PTR) gui->diskmenu, "Play &CD/DVD/VCD/SVCD"); + AppendMenu(gui->menu, MF_STRING | MF_POPUP, (UINT_PTR) gui->diskmenu, acp(MSGTR_MENU_PlayDisc)); AppendMenu(gui->menu, MF_SEPARATOR, 0, 0); - AppendMenu(gui->menu, MF_STRING, IDSUBTITLE_OPEN, "Open Subtitle"); - AppendMenu(gui->menu, MF_STRING, ID_SKINBROWSER, "Skin Browser"); + AppendMenu(gui->menu, MF_STRING, IDSUBTITLE_OPEN, acp(MSGTR_MENU_LoadSubtitle)); + AppendMenu(gui->menu, MF_STRING, ID_SKINBROWSER, acp(MSGTR_MENU_SkinBrowser)); AppendMenu(gui->menu, MF_SEPARATOR, 0, 0); - AppendMenu(gui->menu, MF_STRING, ID_PREFS, "Preferences"); - AppendMenu(gui->menu, MF_STRING, ID_CONSOLE, "Debug Console"); - AppendMenu(gui->menu, MF_STRING, ID_ONLINEHELP, "Online Help"); - AppendMenu(gui->menu, MF_STRING, IDHELP_ABOUT, "About"); + AppendMenu(gui->menu, MF_STRING, ID_PREFS, acp(MSGTR_MENU_Preferences)); + AppendMenu(gui->menu, MF_STRING, ID_CONSOLE, acp(MSGTR_MENU_DebugConsole)); + AppendMenu(gui->menu, MF_STRING, ID_ONLINEHELP, acp(MSGTR_MENU_OnlineHelp)); + AppendMenu(gui->menu, MF_STRING, IDHELP_ABOUT, acp(MSGTR_MENU_AboutMPlayer)); AppendMenu(gui->menu, MF_SEPARATOR, 0, 0); - AppendMenu(gui->menu, MF_STRING, IDEXIT, "&Exit"); + AppendMenu(gui->menu, MF_STRING, IDEXIT, acp(MSGTR_MENU_Exit)); } static void create_traymenu(gui_t *gui) { gui->traymenu = CreatePopupMenu(); gui->trayplaybackmenu = CreatePopupMenu(); - AppendMenu(gui->traymenu, MF_STRING | MF_POPUP, (UINT_PTR) gui->trayplaymenu, "Open..."); + AppendMenu(gui->traymenu, MF_STRING | MF_POPUP, (UINT_PTR) gui->trayplaymenu, acp(MSGTR_MENU_Open)); AppendMenu(gui->traymenu, MF_SEPARATOR, 0, 0); - AppendMenu(gui->traymenu, MF_STRING | MF_POPUP, (UINT_PTR) gui->trayplaybackmenu, "Playback"); - AppendMenu(gui->trayplaybackmenu, MF_STRING, ID_SEEKB, "Seek Backwards"); - AppendMenu(gui->trayplaybackmenu, MF_STRING, ID_PTRACK, "Previous Track"); - AppendMenu(gui->trayplaybackmenu, MF_STRING, ID_PLAY, "Play/Pause"); - AppendMenu(gui->trayplaybackmenu, MF_STRING, ID_STOP, "Stop"); - AppendMenu(gui->trayplaybackmenu, MF_STRING, ID_NTRACK, "Next Track"); - AppendMenu(gui->trayplaybackmenu, MF_STRING, ID_SEEKF, "Seek Forwards"); + AppendMenu(gui->traymenu, MF_STRING | MF_POPUP, (UINT_PTR) gui->trayplaybackmenu, acp(MSGTR_MENU_Playing)); + AppendMenu(gui->trayplaybackmenu, MF_STRING, ID_SEEKB, acp(MSGTR_MENU_SeekBack)); + AppendMenu(gui->trayplaybackmenu, MF_STRING, ID_PTRACK, acp(MSGTR_MENU_PrevStream)); + AppendMenu(gui->trayplaybackmenu, MF_STRING, ID_PLAY, acp(MSGTR_MENU_Play "/" MSGTR_MENU_Pause)); + AppendMenu(gui->trayplaybackmenu, MF_STRING, ID_STOP, acp(MSGTR_MENU_Stop)); + AppendMenu(gui->trayplaybackmenu, MF_STRING, ID_NTRACK, acp(MSGTR_MENU_NextStream)); + AppendMenu(gui->trayplaybackmenu, MF_STRING, ID_SEEKF, acp(MSGTR_MENU_SeekForw)); AppendMenu(gui->traymenu, MF_SEPARATOR, 0, 0); - AppendMenu(gui->traymenu, MF_STRING, ID_MUTE, "Toggle Mute"); + AppendMenu(gui->traymenu, MF_STRING, ID_MUTE, acp(MSGTR_MENU_Mute)); AppendMenu(gui->traymenu, MF_SEPARATOR, 0, 0); - AppendMenu(gui->traymenu, MF_STRING, IDSUBTITLE_OPEN, "Open Subtitle"); - AppendMenu(gui->traymenu, MF_STRING, ID_PLAYLIST, "Playlist"); + AppendMenu(gui->traymenu, MF_STRING, IDSUBTITLE_OPEN, acp(MSGTR_MENU_LoadSubtitle)); + AppendMenu(gui->traymenu, MF_STRING, ID_PLAYLIST, acp(MSGTR_MENU_PlayList)); AppendMenu(gui->traymenu, MF_SEPARATOR, 0, 0); - AppendMenu(gui->traymenu, MF_STRING, ID_SHOWHIDE, "Show/Hide"); + AppendMenu(gui->traymenu, MF_STRING, ID_SHOWHIDE, acp(MSGTR_MENU_ShowHide)); AppendMenu(gui->traymenu, MF_SEPARATOR, 0, 0); - AppendMenu(gui->traymenu, MF_STRING, ID_PREFS, "Preferences"); - AppendMenu(gui->traymenu, MF_STRING, ID_CONSOLE, "Debug Console"); - AppendMenu(gui->traymenu, MF_STRING, ID_ONLINEHELP, "Online Help"); - AppendMenu(gui->traymenu, MF_STRING, IDHELP_ABOUT, "About"); + AppendMenu(gui->traymenu, MF_STRING, ID_PREFS, acp(MSGTR_MENU_Preferences)); + AppendMenu(gui->traymenu, MF_STRING, ID_CONSOLE, acp(MSGTR_MENU_DebugConsole)); + AppendMenu(gui->traymenu, MF_STRING, ID_ONLINEHELP, acp(MSGTR_MENU_OnlineHelp)); + AppendMenu(gui->traymenu, MF_STRING, IDHELP_ABOUT, acp(MSGTR_MENU_AboutMPlayer)); AppendMenu(gui->traymenu, MF_SEPARATOR, 0, 0); - AppendMenu(gui->traymenu, MF_STRING, IDEXIT, "&Exit"); + AppendMenu(gui->traymenu, MF_STRING, IDEXIT, acp(MSGTR_MENU_Exit)); } static void create_submenu(gui_t *gui) @@ -1197,33 +1244,33 @@ gui->dvdmenu = CreatePopupMenu(); gui->aspectmenu = CreatePopupMenu(); gui->subtitlemenu = CreatePopupMenu(); - AppendMenu(gui->submenu, MF_STRING | MF_POPUP, (UINT_PTR) gui->trayplaymenu, "Open..."); + AppendMenu(gui->submenu, MF_STRING | MF_POPUP, (UINT_PTR) gui->trayplaymenu, acp(MSGTR_MENU_Open)); AppendMenu(gui->submenu, MF_SEPARATOR, 0, 0); - AppendMenu(gui->submenu, MF_STRING, ID_SEEKB, "Seek Backwards"); - AppendMenu(gui->submenu, MF_STRING, ID_PTRACK, "Previous Track"); - AppendMenu(gui->submenu, MF_STRING, ID_PLAY, "Play/Pause"); - AppendMenu(gui->submenu, MF_STRING, ID_STOP, "Stop"); - AppendMenu(gui->submenu, MF_STRING, ID_NTRACK, "Next Track"); - AppendMenu(gui->submenu, MF_STRING, ID_SEEKF, "Seek Forwards"); + AppendMenu(gui->submenu, MF_STRING, ID_SEEKB, acp(MSGTR_MENU_SeekBack)); + AppendMenu(gui->submenu, MF_STRING, ID_PTRACK, acp(MSGTR_MENU_PrevStream)); + AppendMenu(gui->submenu, MF_STRING, ID_PLAY, acp(MSGTR_MENU_Play "/" MSGTR_MENU_Pause)); + AppendMenu(gui->submenu, MF_STRING, ID_STOP, acp(MSGTR_MENU_Stop)); + AppendMenu(gui->submenu, MF_STRING, ID_NTRACK, acp(MSGTR_MENU_NextStream)); + AppendMenu(gui->submenu, MF_STRING, ID_SEEKF, acp(MSGTR_MENU_SeekForw)); AppendMenu(gui->submenu, MF_SEPARATOR, 0, 0); - AppendMenu(gui->submenu, MF_STRING, ID_FULLSCREEN, "Toggle Fullscreen"); - AppendMenu(gui->submenu, MF_STRING, ID_MUTE, "Toggle Mute"); + AppendMenu(gui->submenu, MF_STRING, ID_FULLSCREEN, acp(MSGTR_MENU_FullScreen)); + AppendMenu(gui->submenu, MF_STRING, ID_MUTE, acp(MSGTR_MENU_Mute)); AppendMenu(gui->submenu, MF_SEPARATOR, 0, 0); - AppendMenu(gui->submenu, MF_STRING | MF_POPUP, (UINT_PTR) gui->aspectmenu, "Aspect Ratio"); - AppendMenu(gui->submenu, MF_STRING | MF_POPUP, (UINT_PTR) gui->subtitlemenu, "Subtitle Options"); - AppendMenu(gui->submenu, MF_STRING | MF_POPUP, (UINT_PTR) gui->dvdmenu, "DVD Options"); + AppendMenu(gui->submenu, MF_STRING | MF_POPUP, (UINT_PTR) gui->aspectmenu, acp(MSGTR_MENU_AspectRatio)); + AppendMenu(gui->submenu, MF_STRING | MF_POPUP, (UINT_PTR) gui->subtitlemenu, acp(MSGTR_MENU_Subtitles)); + AppendMenu(gui->submenu, MF_STRING | MF_POPUP, (UINT_PTR) gui->dvdmenu, acp(MSGTR_MENU_DVD)); #ifdef CONFIG_DVDREAD - AppendMenu(gui->dvdmenu, MF_STRING | MF_GRAYED, ID_CHAPTERSEL, "Select Title/Chapter..."); + AppendMenu(gui->dvdmenu, MF_STRING | MF_GRAYED, ID_CHAPTERSEL, acp(MSGTR_SelectChapter)); #endif - AppendMenu(gui->subtitlemenu, MF_STRING, IDSUB_TOGGLE, "Subtitle Visibility On/Off"); - AppendMenu(gui->subtitlemenu, MF_STRING, IDSUB_CYCLE, "Cycle Subtitle Languages"); - AppendMenu(gui->aspectmenu, MF_STRING, ID_ASPECT1, "Set 16:9"); - AppendMenu(gui->aspectmenu, MF_STRING, ID_ASPECT2, "Set 4:3"); - AppendMenu(gui->aspectmenu, MF_STRING, ID_ASPECT3, "Set 2.35"); + AppendMenu(gui->subtitlemenu, MF_STRING, IDSUB_TOGGLE, acp(MSGTR_MENU_SubtitlesOnOff)); + AppendMenu(gui->subtitlemenu, MF_STRING, IDSUB_CYCLE, acp(MSGTR_MENU_SubtitleLanguages)); + AppendMenu(gui->aspectmenu, MF_STRING, ID_ASPECT1, "16:9"); + AppendMenu(gui->aspectmenu, MF_STRING, ID_ASPECT2, "4:3"); + AppendMenu(gui->aspectmenu, MF_STRING, ID_ASPECT3, "2.35"); AppendMenu(gui->aspectmenu, MF_SEPARATOR, 0, 0); - AppendMenu(gui->aspectmenu, MF_STRING, ID_ASPECT4, "Original Aspect"); + AppendMenu(gui->aspectmenu, MF_STRING, ID_ASPECT4, acp(MSGTR_MENU_Original)); AppendMenu(gui->submenu, MF_SEPARATOR, 0, 0); - AppendMenu(gui->submenu, MF_STRING, IDEXIT, "&Exit"); + AppendMenu(gui->submenu, MF_STRING, IDEXIT, acp(MSGTR_MENU_Exit)); } static void maketransparent(HWND hwnd, COLORREF crTransparent) diff -r 9b1b7d46b8d0 -r 95c396eb89ab gui/win32/gui.h --- a/gui/win32/gui.h Tue Oct 25 13:40:30 2011 +0000 +++ b/gui/win32/gui.h Tue Oct 25 13:46:43 2011 +0000 @@ -104,6 +104,7 @@ int create_subwindow(gui_t *gui); int parse_filename(char *file, play_tree_t *playtree, m_config_t *mconfig, int clear); void capitalize(char *filename); +LPSTR acp(LPCSTR utf8); void renderinfobox(skin_t *skin, window_priv_t *priv); void renderwidget(skin_t *skin, image *dest, widget *item, int state); diff -r 9b1b7d46b8d0 -r 95c396eb89ab gui/win32/preferences.c --- a/gui/win32/preferences.c Tue Oct 25 13:40:30 2011 +0000 +++ b/gui/win32/preferences.c Tue Oct 25 13:46:43 2011 +0000 @@ -76,56 +76,56 @@ case WM_CREATE: { /* video and audio drivers */ - label = CreateWindow("static", "Video Driver:", + label = CreateWindow("static", acp(MSGTR_PREFERENCES_Video), WS_CHILD | WS_VISIBLE, 10, 13, 70, 15, hwnd, NULL, ((LPCREATESTRUCT) lParam) -> hInstance, NULL); SendMessage(label, WM_SETFONT, (WPARAM) GetStockObject(DEFAULT_GUI_FONT), 0); - label = CreateWindow("static", "Audio Driver:", + label = CreateWindow("static", acp(MSGTR_PREFERENCES_Audio), WS_CHILD | WS_VISIBLE, 190, 13, 70, 15, hwnd, NULL, ((LPCREATESTRUCT) lParam) -> hInstance, NULL); SendMessage(label, WM_SETFONT, (WPARAM) GetStockObject(DEFAULT_GUI_FONT), 0); - label = CreateWindow("static", "Extra stereo coefficient:", + label = CreateWindow("static", acp(MSGTR_PREFERENCES_Coefficient), WS_CHILD | WS_VISIBLE, 10, 148, 115, 15, hwnd, NULL, ((LPCREATESTRUCT) lParam) -> hInstance, NULL); SendMessage(label, WM_SETFONT, (WPARAM) GetStockObject(DEFAULT_GUI_FONT), 0); - label = CreateWindow("static", "Audio delay:", + label = CreateWindow("static", acp(MSGTR_PREFERENCES_AudioDelay), WS_CHILD | WS_VISIBLE, 36, 187, 115, 15, hwnd, NULL, ((LPCREATESTRUCT) lParam) -> hInstance, NULL); SendMessage(label, WM_SETFONT, (WPARAM) GetStockObject(DEFAULT_GUI_FONT), 0); - label = CreateWindow("static", "OSD level:", + label = CreateWindow("static", acp(MSGTR_PREFERENCES_FRAME_OSD_Level), WS_CHILD | WS_VISIBLE, 10, 286, 115, 15, hwnd, NULL, ((LPCREATESTRUCT) lParam) -> hInstance, NULL); SendMessage(label, WM_SETFONT, (WPARAM) GetStockObject(DEFAULT_GUI_FONT), 0); - label = CreateWindow("static", "DVD device:", + label = CreateWindow("static", acp(MSGTR_PREFERENCES_DVDDevice), WS_CHILD | WS_VISIBLE, 80, 385, 115, 15, hwnd, NULL, ((LPCREATESTRUCT) lParam) -> hInstance, NULL); SendMessage(label, WM_SETFONT, (WPARAM) GetStockObject(DEFAULT_GUI_FONT), 0); - label = CreateWindow("static", "CD device:", + label = CreateWindow("static", acp(MSGTR_PREFERENCES_CDROMDevice), WS_CHILD | WS_VISIBLE, 202, 385, 115, 15, hwnd, NULL, ((LPCREATESTRUCT) lParam) -> hInstance, NULL); SendMessage(label, WM_SETFONT, (WPARAM) GetStockObject(DEFAULT_GUI_FONT), 0); - label = CreateWindow("static", "Priority:", + label = CreateWindow("static", acp(MSGTR_PREFERENCES_Priority), WS_CHILD | WS_VISIBLE, 217, 286, 115, 15, hwnd, NULL, ((LPCREATESTRUCT) lParam) -> hInstance, @@ -163,7 +163,7 @@ NULL); /* checkboxes */ - btn = CreateWindow("button", "Enable double buffering", + btn = CreateWindow("button", acp(MSGTR_PREFERENCES_DoubleBuffer), WS_CHILD | WS_VISIBLE | BS_AUTOCHECKBOX, 25, 35, 150, 25, hwnd, (HMENU) ID_DOUBLE, @@ -171,7 +171,7 @@ NULL); SendMessage(btn, WM_SETFONT, (WPARAM) GetStockObject(DEFAULT_GUI_FONT), 0); - btn = CreateWindow("button", "Enable direct rendering", + btn = CreateWindow("button", acp(MSGTR_PREFERENCES_DirectRender), WS_CHILD | WS_VISIBLE | BS_AUTOCHECKBOX, 25, 57, 150, 25, hwnd, (HMENU) ID_DIRECT, @@ -179,7 +179,7 @@ NULL); SendMessage(btn, WM_SETFONT, (WPARAM) GetStockObject(DEFAULT_GUI_FONT), 0); - btn = CreateWindow("button", "Enable framedropping", + btn = CreateWindow("button", acp(MSGTR_PREFERENCES_FrameDrop), WS_CHILD | WS_VISIBLE | BS_AUTOCHECKBOX, 25, 79, 150, 25, hwnd, (HMENU) ID_FRAMEDROP, @@ -187,7 +187,7 @@ NULL); SendMessage(btn, WM_SETFONT, (WPARAM) GetStockObject(DEFAULT_GUI_FONT), 0); - btn = CreateWindow("button", "Quit after playing", + btn = CreateWindow("button", acp(MSGTR_PREFERENCES_NoIdle), WS_CHILD | WS_VISIBLE | BS_AUTOCHECKBOX, 25, 101, 150, 25, hwnd, (HMENU) ID_IDLE, @@ -195,7 +195,7 @@ NULL); SendMessage(btn, WM_SETFONT, (WPARAM) GetStockObject(DEFAULT_GUI_FONT), 0); - btn = CreateWindow("button", "Normalize sound", + btn = CreateWindow("button", acp(MSGTR_PREFERENCES_NormalizeSound), WS_CHILD | WS_VISIBLE | BS_AUTOCHECKBOX, 205, 35, 150, 25, hwnd, (HMENU) ID_NORMALIZE, @@ -203,7 +203,7 @@ NULL); SendMessage(btn, WM_SETFONT, (WPARAM) GetStockObject(DEFAULT_GUI_FONT), 0); - btn = CreateWindow("button", "Enable software mixer", + btn = CreateWindow("button", acp(MSGTR_PREFERENCES_SoftwareMixer), WS_CHILD | WS_VISIBLE | BS_AUTOCHECKBOX, 205, 57, 150, 25, hwnd, (HMENU) ID_SOFTMIX, @@ -211,7 +211,7 @@ NULL); SendMessage(btn, WM_SETFONT, (WPARAM) GetStockObject(DEFAULT_GUI_FONT), 0); - btn = CreateWindow("button", "Enable extra stereo", + btn = CreateWindow("button", acp(MSGTR_PREFERENCES_ExtraStereo), WS_CHILD | WS_VISIBLE | BS_AUTOCHECKBOX, 205, 79, 150, 25, hwnd, (HMENU) ID_EXTRASTEREO, @@ -219,7 +219,7 @@ NULL); SendMessage(btn, WM_SETFONT, (WPARAM) GetStockObject(DEFAULT_GUI_FONT), 0); - btn = CreateWindow("button", "Enable cache", + btn = CreateWindow("button", acp(MSGTR_PREFERENCES_Cache), WS_CHILD | WS_VISIBLE | BS_AUTOCHECKBOX, 10, 222, 90, 25, hwnd, (HMENU) ID_CACHE, @@ -227,7 +227,7 @@ NULL); SendMessage(btn, WM_SETFONT, (WPARAM) GetStockObject(DEFAULT_GUI_FONT), 0); - btn = CreateWindow("button", "Enable autosync", + btn = CreateWindow("button", acp(MSGTR_PREFERENCES_AutoSync), WS_CHILD | WS_VISIBLE | BS_AUTOCHECKBOX, 192, 222, 100, 25, hwnd, (HMENU) ID_AUTOSYNC, @@ -235,7 +235,7 @@ NULL); SendMessage(btn, WM_SETFONT, (WPARAM) GetStockObject(DEFAULT_GUI_FONT), 0); - btn = CreateWindow("button", "Display videos in the sub window (DirectX only)", + btn = CreateWindow("button", acp(MSGTR_PREFERENCES_VideoInSubwin), WS_CHILD | WS_VISIBLE | BS_AUTOCHECKBOX, 85, 249, 250, 25, hwnd, (HMENU) ID_SUBWINDOW, @@ -244,7 +244,7 @@ SendMessage(btn, WM_SETFONT, (WPARAM) GetStockObject(DEFAULT_GUI_FONT), 0); /* osd level */ - btn = CreateWindow("button", "Subtitles only", + btn = CreateWindow("button", acp(MSGTR_PREFERENCES_OSD_LEVEL0), WS_CHILD | WS_VISIBLE | BS_AUTORADIOBUTTON, 95, 282, 100, 25, hwnd, (HMENU) ID_NONE, @@ -252,7 +252,7 @@ NULL); SendMessage(btn, WM_SETFONT, (WPARAM) GetStockObject(DEFAULT_GUI_FONT), 0); - btn = CreateWindow("button", "Volume and seek", + btn = CreateWindow("button", acp(MSGTR_PREFERENCES_OSD_LEVEL1), WS_CHILD | WS_VISIBLE | BS_AUTORADIOBUTTON, 95, 302, 180, 25, hwnd, (HMENU) ID_OSD1, @@ -260,7 +260,7 @@ NULL); SendMessage(btn, WM_SETFONT, (WPARAM) GetStockObject(DEFAULT_GUI_FONT), 0); - btn = CreateWindow("button", "Volume, seek, timer and percentage", + btn = CreateWindow("button", acp(MSGTR_PREFERENCES_OSD_LEVEL2), WS_CHILD | WS_VISIBLE | BS_AUTORADIOBUTTON, 95, 322, 250, 25, hwnd, (HMENU) ID_OSD2, @@ -268,7 +268,7 @@ NULL); SendMessage(btn, WM_SETFONT, (WPARAM) GetStockObject(DEFAULT_GUI_FONT), 0); - btn = CreateWindow("button", "Volume, seek, timer, percentage and total time", + btn = CreateWindow("button", acp(MSGTR_PREFERENCES_OSD_LEVEL3), WS_CHILD | WS_VISIBLE | BS_AUTORADIOBUTTON, 95, 342, 250, 25, hwnd, (HMENU) ID_OSD3, @@ -276,7 +276,7 @@ NULL); SendMessage(btn, WM_SETFONT, (WPARAM) GetStockObject(DEFAULT_GUI_FONT), 0); - btn = CreateWindow("button", "Apply", + btn = CreateWindow("button", acp(MSGTR_Ok), WS_CHILD | WS_VISIBLE | BS_PUSHBUTTON, 199, 417, 80, 25, hwnd, (HMENU) ID_APPLY, @@ -284,7 +284,7 @@ NULL); SendMessage(btn, WM_SETFONT, (WPARAM) GetStockObject(DEFAULT_GUI_FONT), 0); - btn = CreateWindow("button", "Cancel", + btn = CreateWindow("button", acp(MSGTR_Cancel), WS_CHILD | WS_VISIBLE | BS_PUSHBUTTON, 285, 417, 80, 25, hwnd, (HMENU) ID_CANCEL, @@ -292,7 +292,7 @@ NULL); SendMessage(btn, WM_SETFONT, (WPARAM) GetStockObject(DEFAULT_GUI_FONT), 0); - btn = CreateWindow("button", "Defaults", + btn = CreateWindow("button", acp(MSGTR_Default), WS_CHILD | WS_VISIBLE | BS_PUSHBUTTON, 4, 417, 80, 25, hwnd, (HMENU) ID_DEFAULTS, @@ -403,11 +403,11 @@ SendMessage(ao_driver, WM_SETFONT, (WPARAM) GetStockObject(DEFAULT_GUI_FONT), 0); /* priority list, i'm leaving out realtime for safety's sake */ - SendDlgItemMessage(hwnd, ID_PRIO, CB_INSERTSTRING, 0, (LPARAM) "low"); - SendDlgItemMessage(hwnd, ID_PRIO, CB_INSERTSTRING, 0, (LPARAM) "belownormal"); - SendDlgItemMessage(hwnd, ID_PRIO, CB_INSERTSTRING, 0, (LPARAM) "normal"); - SendDlgItemMessage(hwnd, ID_PRIO, CB_INSERTSTRING, 0, (LPARAM) "abovenormal"); - SendDlgItemMessage(hwnd, ID_PRIO, CB_INSERTSTRING, 0, (LPARAM) "high"); + SendDlgItemMessage(hwnd, ID_PRIO, CB_INSERTSTRING, 0, (LPARAM) acp(MSGTR_PREFERENCES_PriorityLow)); + SendDlgItemMessage(hwnd, ID_PRIO, CB_INSERTSTRING, 0, (LPARAM) acp(MSGTR_PREFERENCES_PriorityNormalBelow)); + SendDlgItemMessage(hwnd, ID_PRIO, CB_INSERTSTRING, 0, (LPARAM) acp(MSGTR_PREFERENCES_PriorityNormal)); + SendDlgItemMessage(hwnd, ID_PRIO, CB_INSERTSTRING, 0, (LPARAM) acp(MSGTR_PREFERENCES_PriorityNormalAbove)); + SendDlgItemMessage(hwnd, ID_PRIO, CB_INSERTSTRING, 0, (LPARAM) acp(MSGTR_PREFERENCES_PriorityHigh)); SendMessage(prio, WM_SETFONT, (WPARAM) GetStockObject(DEFAULT_GUI_FONT), 0); /* set our preferences on what we already have */ @@ -683,7 +683,7 @@ SendDlgItemMessage(hwnd, ID_CDDEVICE, WM_GETTEXT, MAX_PATH, (LPARAM)cdromdevice); cdrom_device = strdup(cdromdevice); - MessageBox(hwnd, "You must restart MPlayer for the changes to take effect.", "MPlayer - Info:", MB_OK); + MessageBox(hwnd, acp(MSGTR_PREFERENCES_Message), acp(MSGTR_MSGBOX_LABEL_Warning), MB_OK); DestroyWindow(hwnd); break; } @@ -700,7 +700,7 @@ HINSTANCE hInstance = GetModuleHandle(NULL); WNDCLASS wc; int x, y; - if(FindWindow(NULL, "MPlayer - Preferences")) return; + if(FindWindow(NULL, acp(MSGTR_Preferences))) return; wc.style = CS_HREDRAW | CS_VREDRAW; wc.lpfnWndProc = PrefsWndProc; wc.cbClsExtra = 0; @@ -709,13 +709,13 @@ wc.hCursor = LoadCursor(NULL,IDC_ARROW); wc.hIcon = gui->icon; wc.hbrBackground = SOLID_GREY; - wc.lpszClassName = "MPlayer - Preferences"; + wc.lpszClassName = acp(MSGTR_Preferences); wc.lpszMenuName = NULL; RegisterClass(&wc); x = (GetSystemMetrics(SM_CXSCREEN) / 2) - (375 / 2); y = (GetSystemMetrics(SM_CYSCREEN) / 2) - (474 / 2); - hWnd = CreateWindow("MPlayer - Preferences", - "MPlayer - Preferences", + hWnd = CreateWindow(acp(MSGTR_Preferences), + acp(MSGTR_Preferences), WS_POPUPWINDOW | WS_CAPTION, x, y, diff -r 9b1b7d46b8d0 -r 95c396eb89ab gui/win32/widgetrender.c --- a/gui/win32/widgetrender.c Tue Oct 25 13:40:30 2011 +0000 +++ b/gui/win32/widgetrender.c Tue Oct 25 13:46:43 2011 +0000 @@ -29,6 +29,7 @@ #include "gui/interface.h" #include "gui.h" +#include "help_mp.h" #include "libavutil/avstring.h" #define MAX_LABELSIZE 250 @@ -138,7 +139,7 @@ else if (len > 4 && tmp[len - 4] == '.') tmp[len - 4] = 0; else if (len > 5 && tmp[len - 5] == '.') tmp[len - 5] = 0; } - else av_strlcpy(tmp, "No file loaded.", tmplen); + else av_strlcpy(tmp, MSGTR_NoFileLoaded, tmplen); break; case STREAMTYPE_STREAM: @@ -147,13 +148,13 @@ #ifdef CONFIG_DVDREAD case STREAMTYPE_DVD: - if (guiInfo.Chapter) snprintf(tmp, tmplen, "Chapter %d", guiInfo.Chapter); - else av_strlcat(tmp, "No chapter", tmplen); + if (guiInfo.Chapter) snprintf(tmp, tmplen, MSGTR_Chapter, guiInfo.Chapter); + else av_strlcat(tmp, MSGTR_NoChapter, tmplen); break; #endif default: - av_strlcpy(tmp, "No media opened.", tmplen); + av_strlcpy(tmp, MSGTR_NoMediaOpened, tmplen); break; } @@ -205,7 +206,7 @@ stringreplace(text, "$b", "%3.2f", guiInfo.Balance); stringreplace(text, "$B", "%3.1f", guiInfo.Balance); stringreplace(text, "$t", "%.2i", guiInfo.Track); - stringreplace(text, "$o", "%s", TranslateFilename(0, tmp, sizeof(tmp))); + stringreplace(text, "$o", "%s", acp(TranslateFilename(0, tmp, sizeof(tmp)))); stringreplace(text, "$x", "%i", guiInfo.VideoWidth); stringreplace(text, "$y", "%i", guiInfo.VideoHeight); stringreplace(text, "$C", "%s", guiInfo.sh_video ? codecname : ""); @@ -230,8 +231,8 @@ #endif else stringreplace(text, "$T", "u"); - stringreplace(text, "$f", TranslateFilename(1, tmp, sizeof(tmp))); - stringreplace(text, "$F", TranslateFilename(2, tmp, sizeof(tmp))); + stringreplace(text, "$f", acp(TranslateFilename(1, tmp, sizeof(tmp)))); + stringreplace(text, "$F", acp(TranslateFilename(2, tmp, sizeof(tmp)))); return text; } diff -r 9b1b7d46b8d0 -r 95c396eb89ab help/help_mp-de.h --- a/help/help_mp-de.h Tue Oct 25 13:40:30 2011 +0000 +++ b/help/help_mp-de.h Tue Oct 25 13:46:43 2011 +0000 @@ -1005,6 +1005,33 @@ #define MSGTR_WS_NotAFile "Dies scheint keine Datei zu sein...\n" #define MSGTR_WS_DDNothing "D&D: Nichts zurückgegeben!\n" +// Win32 GUI +#define MSGTR_Close "Schließen" +#define MSGTR_Default "Standard" +#define MSGTR_Down "Runter" +#define MSGTR_Load "Laden" +#define MSGTR_Save "Speichern" +#define MSGTR_Up "Hoch" +#define MSGTR_DirectorySelect "Wähle ein Verzeichnis ..." +#define MSGTR_PlaylistSave "Speichere Wiedergabeliste ..." +#define MSGTR_PlaylistSelect "Wähle Wiedergabeliste ..." +#define MSGTR_SelectChapter "Wähle Kapitel ..." +#define MSGTR_MENU_DebugConsole "Debugging-Konsole" +#define MSGTR_MENU_OnlineHelp "Online-Hilfe" +#define MSGTR_MENU_PlayDirectory "Spiele ein Verzeichnis..." +#define MSGTR_MENU_SeekBack "Springe zurück" +#define MSGTR_MENU_SeekForw "Springe vor" +#define MSGTR_MENU_ShowHide "Zeigen/Verbergen" +#define MSGTR_MENU_SubtitlesOnOff "Untertitel-Anzeige ein/aus" +#define MSGTR_PLAYLIST_AddFile "Datei hinzufügen..." +#define MSGTR_PLAYLIST_AddURL "URL hinzufügen..." +#define MSGTR_PREFERENCES_Priority "Priorität:" +#define MSGTR_PREFERENCES_PriorityHigh "hoch" +#define MSGTR_PREFERENCES_PriorityLow "niedrig" +#define MSGTR_PREFERENCES_PriorityNormal "normal" +#define MSGTR_PREFERENCES_PriorityNormalAbove "höher als normal" +#define MSGTR_PREFERENCES_PriorityNormalBelow "niedriger als normal" +#define MSGTR_PREFERENCES_VideoInSubwin "Video in Unterfenster anzeigen (nur DirectX)" // ======================= Videoausgabetreiber ======================== diff -r 9b1b7d46b8d0 -r 95c396eb89ab help/help_mp-en.h --- a/help/help_mp-en.h Tue Oct 25 13:40:30 2011 +0000 +++ b/help/help_mp-en.h Tue Oct 25 13:46:43 2011 +0000 @@ -810,6 +810,35 @@ #define MSGTR_WS_NotAFile "This does not seem to be a file...\n" #define MSGTR_WS_DDNothing "D&D: Nothing returned!\n" +// Win32 GUI +#define MSGTR_Close "Close" +#define MSGTR_Default "Defaults" +#define MSGTR_Down "Down" +#define MSGTR_Load "Load" +#define MSGTR_Save "Save" +#define MSGTR_Up "Up" +#define MSGTR_DirectorySelect "Select directory..." +#define MSGTR_PlaylistSave "Save playlist..." +#define MSGTR_PlaylistSelect "Select playlist..." +#define MSGTR_SelectChapter "Select chapter..." +#define MSGTR_MENU_DebugConsole "Debug Console" +#define MSGTR_MENU_OnlineHelp "Online Help" +#define MSGTR_MENU_PlayDirectory "Play directory..." +#define MSGTR_MENU_SeekBack "Seek Backwards" +#define MSGTR_MENU_SeekForw "Seek Forwards" +#define MSGTR_MENU_ShowHide "Show/Hide" +#define MSGTR_MENU_SubtitlesOnOff "Subtitle Visibility On/Off" +#define MSGTR_PLAYLIST_AddFile "Add File..." +#define MSGTR_PLAYLIST_AddURL "Add URL..." +#define MSGTR_PREFERENCES_Priority "Priority:" +#define MSGTR_PREFERENCES_PriorityHigh "high" +#define MSGTR_PREFERENCES_PriorityLow "low" +#define MSGTR_PREFERENCES_PriorityNormal "normal" +#define MSGTR_PREFERENCES_PriorityNormalAbove "above normal" +#define MSGTR_PREFERENCES_PriorityNormalBelow "below normal" +#define MSGTR_PREFERENCES_VideoInSubwin "Display videos in the sub window (DirectX only)" + + // ======================= video output drivers ======================== #define MSGTR_VOincompCodec "The selected video_out device is incompatible with this codec.\n"\