diff --git a/Localization.sln b/Localization.sln index 52408a6..d92a846 100644 --- a/Localization.sln +++ b/Localization.sln @@ -1,14 +1,18 @@  Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 15 -VisualStudioVersion = 15.0.27703.2047 +# Visual Studio Version 17 +VisualStudioVersion = 17.5.33627.172 MinimumVisualStudioVersion = 10.0.40219.1 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "exe2po", "exe2po\exe2po.vcxproj", "{29F88A73-AB86-4748-B96B-E010EA4DD45D}" + ProjectSection(ProjectDependencies) = postProject + {13D18C95-84A4-4B3A-AC51-40B90C7B7A07} = {13D18C95-84A4-4B3A-AC51-40B90C7B7A07} + EndProjectSection EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "sample", "sample\sample.vcxproj", "{13D18C95-84A4-4B3A-AC51-40B90C7B7A07}" EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{4081BAC6-060E-4E22-96F2-595FB5E9F56F}" ProjectSection(SolutionItems) = preProject + build.cmd = build.cmd exe2po-register.reg = exe2po-register.reg exe2po-unregister.reg = exe2po-unregister.reg LICENSE = LICENSE diff --git a/README.md b/README.md index c31b6f0..aa430d5 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ [![Codacy Badge](https://api.codacy.com/project/badge/Grade/983675f415f5405da0846ec33156092f)](https://www.codacy.com/app/raspopov/po-localization?utm_source=github.com&utm_medium=referral&utm_content=raspopov/po-localization&utm_campaign=Badge_Grade) PO-Localization ------------------ +=============== This is a library designed to help C++ developers in creating Windows application to translate it on world languages. Project contains an @@ -10,8 +10,8 @@ adds ability to use translated PO-files to application itself. The PO-file is a native format of poEdit (a very convenient application for translators). - Compression -------------- +Compression +----------- Library can load translations in uncompressed or compressed formats (Lempel-Ziv algorithm only). Uncompressed files has ".po" extension and @@ -30,8 +30,8 @@ files. Note: Some versions of compress.exe produces incorrect compressed files (1 byte differ) just get another version of utility. - EXE to PO file converter usage --------------------------------- +EXE to PO file converter usage +------------------------------ exe2po.exe {input file.exe} {output file.po} @@ -70,8 +70,8 @@ Generated .po-file blocks for string resources: msgid "English string" msgstr "" - License ---------- +License +------- Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -85,12 +85,15 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. - Copyrights ------------- +Copyrights +---------- -PO-Localization -Copyright (C) Nikolay Raspopov, 2011-2018. \ -https://www.cherubicsoft.com/en/projects/po-localization +* PO-Localization + +Copyright (C) Nikolay Raspopov, 2011-2023. + +https://www.cherubicsoft.com/en/projects/po-localization/ + +* Microsoft (R) File Compression Utility Version 2.50 -Microsoft (R) File Compression Utility Version 2.50 \ Copyright (C) Microsoft Corp. 1990-1994. All rights reserved. diff --git a/build.cmd b/build.cmd index 50be3cb..2edac52 100644 --- a/build.cmd +++ b/build.cmd @@ -1,51 +1,15 @@ @echo off setlocal - -call clean.cmd - -set vc="%VS140COMNTOOLS%..\..\VC\vcvarsall.bat" -if exist %vc% goto :build -set vc="%VS150COMNTOOLS%..\..\VC\Auxiliary\Build\vcvarsall.bat" -if exist %vc% goto :build -echo Microsoft Visual C++ 2015/2017 is missing. Please go to http://www.visualstudio.com/ and install free Community edition. -exit /b 1 - -:build -echo Building... -call %vc% x86 -msbuild Localization.sln /v:m /t:Rebuild /p:Configuration=Release /p:Platform=Win32 -if exist Win32\release\exe2po.exe goto pack -echo Binary file is missing. Compile project first please. -exit /b 1 - -:pack -echo. -echo Detecting 7-Zip... -set zip="%ProgramFiles%\7-Zip\7z.exe" -if exist %zip% goto zip -set zip="%ProgramFiles(x86)%\7-Zip\7z.exe" -if exist %zip% goto zip -set zip="%ProgramW6432%\7-Zip\7z.exe" -if exist %zip% goto zip -echo The 7-Zip utility is missing. Please go to http://www.7-zip.org/ and install 7-Zip. -exit /b 1 - -:zip -echo. -echo Packing by 7-Zip: %zip%... -for /F "tokens=3" %%i in ( 'findstr ProductVersion exe2po\exe2po.rc' ) do set version=%%~i -md "..\redist" 2>nul: -set dst="%CD%\..\redist\po-localization-%version%.zip" -del %dst% 2>nul: -cd exe2po -%zip% a -tzip -mx9 -mm=Deflate64 -mpass=15 -stl %dst% gpl-2.0.txt -cd ..\src -%zip% a -tzip -mx9 -mm=Deflate64 -mpass=15 -stl %dst% lgpl-2.1.txt Localization.h Localization.cpp COMPRESS.EXE -cd ..\Win32\release -%zip% a -tzip -mx9 -mm=Deflate64 -mpass=15 -stl %dst% exe2po.exe -cd ..\.. -%zip% a -tzip -mx9 -mm=Deflate64 -mpass=15 -stl -r -xr!*.user -xr!*.aps -xr!*.p_ -xr!win32 -xr!x64 %dst% sample ReadMe.txt *.reg -echo. - -echo Done. -exit /b 0 \ No newline at end of file +set "cur=%cd%\" +pushd "%~dp0" +for /F "tokens=3" %%i in ( 'findstr ProductVersion %~dp0exe2po\exe2po.rc' ) do set "version=%%~i" +set "dst=%cur%po-localization-%version%.zip" +echo Packing %dst%... +del "%dst%" 2>nul +rd /q /s sample\Win32\ 2>nul +rd /q /s sample\x64\ 2>nul +del sample\*.user 2>nul +del sample\*.aps 2>nul +del sample\res\*.p_ 2>nul +powershell -Command "& { Compress-Archive -Path '%cur%exe2po.exe','%cur%sample.exe',ReadMe*,LICENSE,*.reg,src\*,sample\ -DestinationPath '%dst%' }" +popd \ No newline at end of file diff --git a/clean.cmd b/clean.cmd deleted file mode 100644 index 679dc48..0000000 --- a/clean.cmd +++ /dev/null @@ -1,12 +0,0 @@ -@echo off -echo Cleaning... -if exist "ipch" rd /s /q "ipch" && echo Removing "ipch"... -if exist "Win32" rd /s /q "Win32" && echo Removing "Win32"... -if exist "x64" rd /s /q "x64" && echo Removing "x64"... -for /r %%i in (*.aps) do del /q "%%i" && echo Removing "%%i"... -for /r %%i in (*.ncb) do del /q "%%i" && echo Removing "%%i"... -for /r %%i in (*.sdf) do del /q "%%i" && echo Removing "%%i"... -for /d /r %%i in (*.*) do if exist "%%i\Win32" rd /s /q "%%i\Win32" && echo Removing "%%i\Win32"... -for /d /r %%i in (*.*) do if exist "%%i\x64" rd /s /q "%%i\x64" && echo Cleaning %%i\x64"... -echo. -exit /b 0 \ No newline at end of file diff --git a/exe2po/exe2po.cpp b/exe2po/exe2po.cpp index 94afb0c..ced0a65 100644 --- a/exe2po/exe2po.cpp +++ b/exe2po/exe2po.cpp @@ -3,9 +3,9 @@ /* This file is part of EXE to PO file converter (EXE2PO) -https://github.com/raspopov/po-localization +https://www.cherubicsoft.com/en/projects/po-localization/ -Copyright (C) 2011-2018 Nikolay Raspopov +Copyright (C) 2011-2023 Nikolay Raspopov Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/exe2po/exe2po.rc b/exe2po/exe2po.rc index 2c00d8b..d9f6e9d 100644 --- a/exe2po/exe2po.rc +++ b/exe2po/exe2po.rc @@ -41,12 +41,12 @@ BEGIN BEGIN BLOCK "000004b0" BEGIN - VALUE "Comments", "https://github.com/raspopov/po-localization" + VALUE "Comments", "https://www.cherubicsoft.com/en/projects/po-localization/" VALUE "CompanyName", "Raspopov" VALUE "FileDescription", "EXE to PO file converter" VALUE "FileVersion", "1.0.0.4" VALUE "InternalName", "exe2po" - VALUE "LegalCopyright", "Copyright © 2011-2018 Nikolay Raspopov" + VALUE "LegalCopyright", "Copyright © 2011-2023 Nikolay Raspopov" VALUE "OriginalFilename", "exe2po.exe" VALUE "ProductName", "Localization Library" VALUE "ProductVersion", "1.0.0.4" diff --git a/exe2po/exe2po.vcxproj b/exe2po/exe2po.vcxproj index 9d6b524..f408376 100644 --- a/exe2po/exe2po.vcxproj +++ b/exe2po/exe2po.vcxproj @@ -22,30 +22,30 @@ {29F88A73-AB86-4748-B96B-E010EA4DD45D} exe2po Win32Proj - 10.0.17763.0 + 10.0 Application Unicode true - v141 + v143 Application Unicode true - v141 + v143 Application Unicode - v141 + v143 Application Unicode - v141 + v143 @@ -95,12 +95,14 @@ Disabled WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) EnableFastChecks - MultiThreadedDebugDLL + MultiThreadedDebug true false Use Level4 EditAndContinue + true + true shlwapi.lib;%(AdditionalDependencies) @@ -109,18 +111,21 @@ MachineX86 false + Disabled WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) EnableFastChecks - MultiThreadedDebugDLL + MultiThreadedDebug true false Use Level4 ProgramDatabase + true + true shlwapi.lib;%(AdditionalDependencies) @@ -128,21 +133,20 @@ Console false + - Full - AnySuitable - true - Speed - true + MaxSpeed WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) - MultiThreadedDLL + MultiThreaded true false Use Level4 true + true + true shlwapi.lib;%(AdditionalDependencies) @@ -152,21 +156,26 @@ MachineX86 true + + + pushd "$(OutDir)" +call $(SolutionDir)build.cmd +popd + + - Full - AnySuitable - true - Speed - true + MaxSpeed WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) - MultiThreadedDLL + MultiThreaded true false Use Level4 true + true + true shlwapi.lib;%(AdditionalDependencies) @@ -175,6 +184,13 @@ true true + + + pushd "$(OutDir)" +call $(SolutionDir)build.cmd +popd + + diff --git a/exe2po/stdafx.cpp b/exe2po/stdafx.cpp index 4beb0ac..23d3584 100644 --- a/exe2po/stdafx.cpp +++ b/exe2po/stdafx.cpp @@ -3,9 +3,9 @@ /* This file is part of EXE to PO file converter (EXE2PO) -https://github.com/raspopov/po-localization +https://www.cherubicsoft.com/en/projects/po-localization/ -Copyright (C) 2011-2018 Nikolay Raspopov +Copyright (C) 2011-2023 Nikolay Raspopov Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/exe2po/stdafx.h b/exe2po/stdafx.h index 673a5af..20c2c74 100644 --- a/exe2po/stdafx.h +++ b/exe2po/stdafx.h @@ -1,8 +1,8 @@ /* This file is part of EXE to PO file converter (EXE2PO) -https://github.com/raspopov/po-localization +https://www.cherubicsoft.com/en/projects/po-localization/ -Copyright (C) 2011-2018 Nikolay Raspopov +Copyright (C) 2011-2023 Nikolay Raspopov Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/sample/res/sample.ico b/sample/res/sample.ico deleted file mode 100644 index da39f10..0000000 Binary files a/sample/res/sample.ico and /dev/null differ diff --git a/sample/res/sample.rc2 b/sample/res/sample.rc2 deleted file mode 100644 index ee18c74..0000000 --- a/sample/res/sample.rc2 +++ /dev/null @@ -1,13 +0,0 @@ -// -// sample.RC2 - resources Microsoft Visual C++ does not edit directly -// - -#ifdef APSTUDIO_INVOKED -#error this file is not editable by Microsoft Visual C++ -#endif //APSTUDIO_INVOKED - - -///////////////////////////////////////////////////////////////////////////// -// Add manually edited resources here... - -///////////////////////////////////////////////////////////////////////////// diff --git a/sample/resource.h b/sample/resource.h index 010751b..cc40953 100644 --- a/sample/resource.h +++ b/sample/resource.h @@ -3,7 +3,6 @@ // Used by sample.rc // #define IDD_SAMPLE_DIALOG 102 -#define IDR_MAINFRAME 128 #define IDS_STRING130 130 #define IDR_MENU1 131 #define IDC_BUTTON1 1000 @@ -14,7 +13,6 @@ #define IDC_LANGS 1005 #define IDC_COMBO2 1006 #define IDC_EDIT2 1007 -#define IDC_HOTKEY1 1010 #define IDC_SYSLINK1 1011 #define IDC_MFCLINK1 1012 #define IDC_COMMAND1 1013 diff --git a/sample/sample.cpp b/sample/sample.cpp index 29c41f1..82ad444 100644 --- a/sample/sample.cpp +++ b/sample/sample.cpp @@ -3,9 +3,9 @@ /* This file is part of Localization library -https://github.com/raspopov/po-localization +https://www.cherubicsoft.com/en/projects/po-localization/ -Copyright (C) 2011-2018 Nikolay Raspopov +Copyright (C) 2011-2023 Nikolay Raspopov Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/sample/sample.h b/sample/sample.h index eb480c4..756a2c0 100644 --- a/sample/sample.h +++ b/sample/sample.h @@ -1,8 +1,8 @@ /* This file is part of Localization library -https://github.com/raspopov/po-localization +https://www.cherubicsoft.com/en/projects/po-localization/ -Copyright (C) 2011-2018 Nikolay Raspopov +Copyright (C) 2011-2023 Nikolay Raspopov Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/sample/sample.rc b/sample/sample.rc index 9dc9114..ee2fef5 100644 --- a/sample/sample.rc +++ b/sample/sample.rc @@ -19,16 +19,6 @@ LANGUAGE LANG_NEUTRAL, SUBLANG_NEUTRAL #pragma code_page(1251) -///////////////////////////////////////////////////////////////////////////// -// -// Icon -// - -// Icon with lowest ID value placed first to ensure application icon -// remains consistent on all systems. -IDR_MAINFRAME ICON "res\\sample.ico" - - ///////////////////////////////////////////////////////////////////////////// // // Dialog @@ -81,12 +71,12 @@ BEGIN BEGIN BLOCK "000004b0" BEGIN - VALUE "Comments", "https://github.com/raspopov/po-localization" + VALUE "Comments", "https://www.cherubicsoft.com/en/projects/po-localization/" VALUE "CompanyName", "Raspopov" VALUE "FileDescription", "Localization Library Sample" VALUE "FileVersion", "1.0.0.4" VALUE "InternalName", "sample" - VALUE "LegalCopyright", "Copyright © 2011-2018 Nikolay Raspopov" + VALUE "LegalCopyright", "Copyright © 2011-2023 Nikolay Raspopov" VALUE "OriginalFilename", "sample.exe" VALUE "ProductName", "Localization Library" VALUE "ProductVersion", "1.0.0.4" @@ -251,8 +241,6 @@ BEGIN "#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)\r\n" "LANGUAGE 9, 1\r\n" "#pragma code_page(1252)\r\n" - "#include ""res\\sample.rc2"" // non-Microsoft Visual C++ edited resources\r\n" - "#include ""afxres.rc"" // Standard components\r\n" "#endif\r\n" "\0" END @@ -277,8 +265,6 @@ END #if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) LANGUAGE 9, 1 #pragma code_page(1252) -#include "res\sample.rc2" // non-Microsoft Visual C++ edited resources -#include "afxres.rc" // Standard components #endif ///////////////////////////////////////////////////////////////////////////// diff --git a/sample/sample.vcxproj b/sample/sample.vcxproj index d99e8cb..0e81dd1 100644 --- a/sample/sample.vcxproj +++ b/sample/sample.vcxproj @@ -22,34 +22,34 @@ {13D18C95-84A4-4B3A-AC51-40B90C7B7A07} sample MFCProj - 10.0.17763.0 + 10.0 Application - Dynamic + Static Unicode true - v141 + v143 Application - Dynamic + Static Unicode true - v141 + v143 Application - Dynamic + Static Unicode - v141 + v143 Application - Dynamic + Static Unicode - v141 + v143 @@ -102,15 +102,17 @@ Disabled - ..\src;%(AdditionalIncludeDirectories) + ..\src;..;%(AdditionalIncludeDirectories) WIN32;_WINDOWS;_DEBUG;%(PreprocessorDefinitions) EnableFastChecks - MultiThreadedDebugDLL + MultiThreadedDebug true false Use Level4 EditAndContinue + true + true _DEBUG;%(PreprocessorDefinitions) @@ -132,15 +134,17 @@ Disabled - ..\src;%(AdditionalIncludeDirectories) + ..\src;..;%(AdditionalIncludeDirectories) WIN32;_WINDOWS;_DEBUG;%(PreprocessorDefinitions) EnableFastChecks - MultiThreadedDebugDLL + MultiThreadedDebug true false Use Level4 ProgramDatabase + true + true _DEBUG;%(PreprocessorDefinitions) @@ -161,19 +165,16 @@ true - Full - AnySuitable - true - Speed - true - ..\src;%(AdditionalIncludeDirectories) + MaxSpeed + ..\src;..;%(AdditionalIncludeDirectories) WIN32;_WINDOWS;NDEBUG;%(PreprocessorDefinitions) - false - MultiThreadedDLL + MultiThreaded true false Use Level4 + true + true NDEBUG;%(PreprocessorDefinitions) @@ -194,19 +195,16 @@ false - Full - AnySuitable - true - Speed - true - ..\src;%(AdditionalIncludeDirectories) + MaxSpeed + ..\src;..;%(AdditionalIncludeDirectories) WIN32;_WINDOWS;NDEBUG;%(PreprocessorDefinitions) - false - MultiThreadedDLL + MultiThreaded true false Use Level4 + true + true NDEBUG;%(PreprocessorDefinitions) @@ -250,8 +248,6 @@ %(RootDir)%(Directory)%(Filename).p_;%(Outputs) - - diff --git a/sample/sample.vcxproj.filters b/sample/sample.vcxproj.filters index e2fe3c4..be5ef86 100644 --- a/sample/sample.vcxproj.filters +++ b/sample/sample.vcxproj.filters @@ -29,12 +29,6 @@ Resource Files - - Resource Files - - - Resource Files - diff --git a/sample/sampleDlg.cpp b/sample/sampleDlg.cpp index d5b871f..aa7ce0a 100644 --- a/sample/sampleDlg.cpp +++ b/sample/sampleDlg.cpp @@ -3,9 +3,9 @@ /* This file is part of Localization library -https://github.com/raspopov/po-localization +https://www.cherubicsoft.com/en/projects/po-localization/ -Copyright (C) 2011-2018 Nikolay Raspopov +Copyright (C) 2011-2023 Nikolay Raspopov Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -32,7 +32,6 @@ CSampleDlg::CSampleDlg(CWnd* pParent /*=NULL*/) : CDialog(CSampleDlg::IDD, pParent) , m_nCombo ( 0 ) { - m_hIcon = AfxGetApp()->LoadIcon(IDR_MAINFRAME); } void CSampleDlg::DoDataExchange(CDataExchange* pDX) @@ -54,9 +53,6 @@ BOOL CSampleDlg::OnInitDialog() { CDialog::OnInitDialog(); - SetIcon( m_hIcon, TRUE ); // Set big icon - SetIcon( m_hIcon, FALSE ); // Set small icon - theApp.m_pLoc.FillComboBox( m_pLangs.GetSafeHwnd() ); theApp.m_pLoc.Translate( GetSafeHwnd(), CSampleDlg::IDD ); diff --git a/sample/sampleDlg.h b/sample/sampleDlg.h index 962250e..b34e158 100644 --- a/sample/sampleDlg.h +++ b/sample/sampleDlg.h @@ -1,8 +1,8 @@ /* This file is part of Localization library -https://github.com/raspopov/po-localization +https://www.cherubicsoft.com/en/projects/po-localization/ -Copyright (C) 2011-2018 Nikolay Raspopov +Copyright (C) 2011-2023 Nikolay Raspopov Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -27,7 +27,6 @@ class CSampleDlg : public CDialog enum { IDD = IDD_SAMPLE_DIALOG }; protected: - HICON m_hIcon; CString m_sEdit; int m_nCombo; CComboBox m_pLangs; diff --git a/sample/stdafx.cpp b/sample/stdafx.cpp index 9f402f8..5c0ac82 100644 --- a/sample/stdafx.cpp +++ b/sample/stdafx.cpp @@ -3,9 +3,9 @@ /* This file is part of Localization library -https://github.com/raspopov/po-localization +https://www.cherubicsoft.com/en/projects/po-localization/ -Copyright (C) 2011-2018 Nikolay Raspopov +Copyright (C) 2011-2023 Nikolay Raspopov Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/sample/stdafx.h b/sample/stdafx.h index 00a434b..1b152cf 100644 --- a/sample/stdafx.h +++ b/sample/stdafx.h @@ -1,8 +1,8 @@ /* This file is part of Localization library -https://github.com/raspopov/po-localization +https://www.cherubicsoft.com/en/projects/po-localization/ -Copyright (C) 2011-2018 Nikolay Raspopov +Copyright (C) 2011-2023 Nikolay Raspopov Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License.