From 0fa744241fd9600c970955bb29494fb9f05ee5e2 Mon Sep 17 00:00:00 2001 From: Stanislav Motylkov Date: Wed, 26 Sep 2018 16:15:07 +0300 Subject: [PATCH] [DEVCPUX] Add russian translation Also make MHz string translatable. Addendum to 793e2a3. --- dll/shellext/devcpux/lang/en-US.rc | 5 +++++ dll/shellext/devcpux/lang/ru-RU.rc | 21 +++++++++++++++++++++ dll/shellext/devcpux/processor.c | 8 +++++++- dll/shellext/devcpux/processor.rc | 5 ++++- dll/shellext/devcpux/resource.h | 2 ++ 5 files changed, 39 insertions(+), 2 deletions(-) create mode 100644 dll/shellext/devcpux/lang/ru-RU.rc diff --git a/dll/shellext/devcpux/lang/en-US.rc b/dll/shellext/devcpux/lang/en-US.rc index 4ea9377e0aa..428531e5a83 100644 --- a/dll/shellext/devcpux/lang/en-US.rc +++ b/dll/shellext/devcpux/lang/en-US.rc @@ -15,6 +15,11 @@ BEGIN LTEXT "test", IDC_CORESPEED, 57, 68, 181, 8 END +STRINGTABLE +BEGIN + IDS_MEGAHERTZ "%ld MHz" +END + /* DLG_PROCESSORINFO DIALOGEX 0, 0, 252, 218 STYLE DS_SHELLFONT | WS_POPUP | WS_POPUP | WS_CAPTION | WS_SYSMENU | WS_THICKFRAME diff --git a/dll/shellext/devcpux/lang/ru-RU.rc b/dll/shellext/devcpux/lang/ru-RU.rc new file mode 100644 index 00000000000..6e5217b28fa --- /dev/null +++ b/dll/shellext/devcpux/lang/ru-RU.rc @@ -0,0 +1,21 @@ +LANGUAGE LANG_RUSSIAN, SUBLANG_DEFAULT + +DLG_PROCESSORINFO DIALOGEX 0, 0, 252, 218 +STYLE DS_SHELLFONT | WS_POPUP | WS_POPUP | WS_CAPTION | WS_SYSMENU | WS_THICKFRAME +CAPTION "Процессор" +FONT 8, "MS Shell Dlg" +BEGIN + LTEXT "Возможности:", -1, 7, 23, 50, 8 + LTEXT "test", IDC_FEATURES, 57, 23, 181, 8 + LTEXT "Модель:", -1, 7, 38, 50, 8 + LTEXT "test", IDC_MODEL, 57, 38, 181, 8 + LTEXT "Степпинг:", -1, 7, 53, 50, 51 + LTEXT "test", IDC_STEPPING, 57, 53, 181, 8 + LTEXT "Частота ядра:", -1, 7, 68, 50, 8 + LTEXT "test", IDC_CORESPEED, 57, 68, 181, 8 +END + +STRINGTABLE +BEGIN + IDS_MEGAHERTZ "%ld МГц" +END diff --git a/dll/shellext/devcpux/processor.c b/dll/shellext/devcpux/processor.c index 8544af1c351..06c2667af2c 100644 --- a/dll/shellext/devcpux/processor.c +++ b/dll/shellext/devcpux/processor.c @@ -92,11 +92,17 @@ ProcessorDlgProc (HWND hDlg, UINT uMessage, WPARAM wParam, LPARAM lParam) WCHAR szFeatures[MAX_PATH] = L""; WCHAR szModel[3]; WCHAR szStepping[3]; + WCHAR szMhz[16]; WCHAR szCurrentMhz[10]; BOOL bFirst = TRUE; SYSTEM_INFO SystemInfo; PROCESSOR_POWER_INFORMATION PowerInfo; + if (!LoadStringW(g_hInstance, IDS_MEGAHERTZ, szMhz, ARRAYSIZE(szMhz))) + { + StringCbCopyW(szMhz, sizeof(szMhz), L"%ld MHz"); + } + if (IsProcessorFeaturePresent(PF_MMX_INSTRUCTIONS_AVAILABLE)) AddFeature(szFeatures, sizeof(szFeatures), L"MMX", &bFirst); if (IsProcessorFeaturePresent(PF_XMMI_INSTRUCTIONS_AVAILABLE)) @@ -119,7 +125,7 @@ ProcessorDlgProc (HWND hDlg, UINT uMessage, WPARAM wParam, LPARAM lParam) SetDlgItemTextW(hDlg, IDC_STEPPING, szStepping); CallNtPowerInformation(11, NULL, 0, &PowerInfo, sizeof(PowerInfo)); - StringCbPrintfW(szCurrentMhz, sizeof(szCurrentMhz), L"%ld %s", PowerInfo.CurrentMhz, L"MHz"); + StringCbPrintfW(szCurrentMhz, sizeof(szCurrentMhz), szMhz, PowerInfo.CurrentMhz); SetDlgItemTextW(hDlg, IDC_CORESPEED, szCurrentMhz); return TRUE; diff --git a/dll/shellext/devcpux/processor.rc b/dll/shellext/devcpux/processor.rc index e98f907589a..07714859022 100644 --- a/dll/shellext/devcpux/processor.rc +++ b/dll/shellext/devcpux/processor.rc @@ -14,4 +14,7 @@ #ifdef LANGUAGE_EN_US #include "lang/en-US.rc" -#endif \ No newline at end of file +#endif +#ifdef LANGUAGE_RU_RU + #include "lang/ru-RU.rc" +#endif diff --git a/dll/shellext/devcpux/resource.h b/dll/shellext/devcpux/resource.h index e3543d061e4..2eee3a93e90 100644 --- a/dll/shellext/devcpux/resource.h +++ b/dll/shellext/devcpux/resource.h @@ -6,3 +6,5 @@ #define IDC_MODEL 302 #define IDC_STEPPING 303 #define IDC_CORESPEED 304 + +#define IDS_MEGAHERTZ 400