2012-12-19 09:30:18 +00:00
/****************************************************************************
* *
* Project 64 - A Nintendo 64 emulator . *
* http : //www.pj64-emu.com/ *
* Copyright ( C ) 2012 Project64 . All rights reserved . *
* *
* License : *
* GNU / GPLv2 http : //www.gnu.org/licenses/gpl-2.0.html *
* *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
2010-06-07 02:23:58 +00:00
# include "stdafx.h"
2008-09-18 03:15:49 +00:00
2015-03-04 09:36:08 +00:00
CLanguage * g_Lang = NULL ;
2008-09-18 03:15:49 +00:00
2012-11-19 11:05:30 +00:00
void CLanguage : : LoadDefaultStrings ( void )
{
# define DEF_STR(ID,str) m_DefaultStrings.insert(LANG_STRINGS::value_type(ID,str))
2008-09-18 03:15:49 +00:00
2015-03-04 09:36:08 +00:00
DEF_STR ( EMPTY_STRING , L " " ) ;
2015-03-04 21:38:06 +00:00
/*********************************************************************************
* Meta Information *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
//About DLL
DEF_STR ( LANGUAGE_NAME , L " " ) ;
DEF_STR ( LANGUAGE_AUTHOR , L " " ) ;
DEF_STR ( LANGUAGE_VERSION , L " " ) ;
DEF_STR ( LANGUAGE_DATE , L " " ) ;
//About DLL Dialog
2015-03-04 09:36:08 +00:00
DEF_STR ( INI_CURRENT_LANG , L " Current Language " ) ;
DEF_STR ( INI_AUTHOR , L " Author " ) ;
DEF_STR ( INI_VERSION , L " Version " ) ;
DEF_STR ( INI_DATE , L " Date " ) ;
DEF_STR ( INI_HOMEPAGE , L " Visit Home Page " ) ;
DEF_STR ( INI_CURRENT_RDB , L " ROM Database (.RDB) " ) ;
2015-03-26 01:33:21 +00:00
DEF_STR ( INI_CURRENT_CHT , L " Cheat Code File (.CHT) " ) ;
2015-03-25 21:48:23 +00:00
DEF_STR ( INI_CURRENT_RDX , L " Extended ROM Info (.RDX) " ) ;
2015-03-04 09:36:08 +00:00
2015-03-04 21:38:06 +00:00
//About INI title
2015-03-23 09:00:23 +00:00
DEF_STR ( INI_TITLE , L " About Config Files " ) ;
2013-03-31 16:10:54 +00:00
2008-09-18 03:15:49 +00:00
/*********************************************************************************
* Numbers *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
2015-03-04 09:36:08 +00:00
DEF_STR ( NUMBER_0 , L " 0 " ) ;
DEF_STR ( NUMBER_1 , L " 1 " ) ;
DEF_STR ( NUMBER_2 , L " 2 " ) ;
DEF_STR ( NUMBER_3 , L " 3 " ) ;
DEF_STR ( NUMBER_4 , L " 4 " ) ,
DEF_STR ( NUMBER_5 , L " 5 " ) ;
DEF_STR ( NUMBER_6 , L " 6 " ) ;
DEF_STR ( NUMBER_7 , L " 7 " ) ;
DEF_STR ( NUMBER_8 , L " 8 " ) ;
DEF_STR ( NUMBER_9 , L " 9 " ) ;
2015-03-04 21:38:06 +00:00
/*********************************************************************************
* Menu *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
//File Menu
2015-03-04 09:36:08 +00:00
DEF_STR ( MENU_FILE , L " &File " ) ;
2015-03-25 21:48:23 +00:00
DEF_STR ( MENU_OPEN , L " &Open ROM " ) ;
DEF_STR ( MENU_ROM_INFO , L " ROM &Info.... " ) ;
2015-03-04 09:36:08 +00:00
DEF_STR ( MENU_START , L " Start Emulation " ) ;
DEF_STR ( MENU_END , L " &End Emulation " ) ;
2015-03-25 21:48:23 +00:00
DEF_STR ( MENU_CHOOSE_ROM , L " Choose ROM Directory... " ) ;
DEF_STR ( MENU_REFRESH , L " Refresh ROM List " ) ;
DEF_STR ( MENU_RECENT_ROM , L " Recent ROM " ) ;
DEF_STR ( MENU_RECENT_DIR , L " Recent ROM Directories " ) ;
2015-03-04 09:36:08 +00:00
DEF_STR ( MENU_EXIT , L " E&xit " ) ;
2015-03-04 21:38:06 +00:00
//System Menu
2015-03-04 09:36:08 +00:00
DEF_STR ( MENU_SYSTEM , L " &System " ) ;
DEF_STR ( MENU_RESET , L " &Reset " ) ;
DEF_STR ( MENU_PAUSE , L " &Pause " ) ;
DEF_STR ( MENU_BITMAP , L " Generate Bitmap " ) ;
DEF_STR ( MENU_LIMIT_FPS , L " Limit FPS " ) ;
2015-03-25 21:48:23 +00:00
DEF_STR ( MENU_SAVE , L " &Save State " ) ;
2015-03-04 09:36:08 +00:00
DEF_STR ( MENU_SAVE_AS , L " Save As... " ) ;
2015-03-25 21:48:23 +00:00
DEF_STR ( MENU_RESTORE , L " &Load State " ) ;
2015-03-04 09:36:08 +00:00
DEF_STR ( MENU_LOAD , L " Load... " ) ;
DEF_STR ( MENU_CURRENT_SAVE , L " Current Save S&tate " ) ;
DEF_STR ( MENU_CHEAT , L " Cheats... " ) ;
DEF_STR ( MENU_GS_BUTTON , L " GS Button " ) ;
2015-03-04 21:38:06 +00:00
DEF_STR ( MENU_RESUME , L " R&esume " ) ;
DEF_STR ( MENU_RESET_SOFT , L " &Soft Reset " ) ;
DEF_STR ( MENU_RESET_HARD , L " &Hard Reset " ) ;
//Options Menu
2015-03-04 09:36:08 +00:00
DEF_STR ( MENU_OPTIONS , L " &Options " ) ;
DEF_STR ( MENU_FULL_SCREEN , L " &Full Screen " ) ;
2015-03-26 01:46:35 +00:00
DEF_STR ( MENU_ON_TOP , L " &Always on &Top " ) ;
2015-03-04 09:36:08 +00:00
DEF_STR ( MENU_CONFG_GFX , L " Configure Graphics Plugin... " ) ;
DEF_STR ( MENU_CONFG_AUDIO , L " Configure Audio Plugin... " ) ;
DEF_STR ( MENU_CONFG_CTRL , L " Configure Controller Plugin... " ) ;
DEF_STR ( MENU_CONFG_RSP , L " Configure RSP Plugin... " ) ;
2015-03-26 01:50:37 +00:00
DEF_STR ( MENU_SHOW_CPU , L " Show CPU Usage " ) ;
2015-03-04 09:36:08 +00:00
DEF_STR ( MENU_SETTINGS , L " &Settings... " ) ;
2015-03-04 21:38:06 +00:00
//Debugger Menu
2015-03-04 09:36:08 +00:00
DEF_STR ( MENU_DEBUGGER , L " &Debugger " ) ;
2015-03-04 21:38:06 +00:00
//Language Menu
2015-03-04 09:36:08 +00:00
DEF_STR ( MENU_LANGUAGE , L " &Language " ) ;
2015-03-04 21:38:06 +00:00
//Help Menu
2015-03-04 09:36:08 +00:00
DEF_STR ( MENU_HELP , L " &Help " ) ;
2015-03-23 09:00:23 +00:00
DEF_STR ( MENU_ABOUT_INI , L " About Conf&ig Files " ) ;
DEF_STR ( MENU_ABOUT_PJ64 , L " &About Project64 " ) ;
2015-03-04 21:38:06 +00:00
DEF_STR ( MENU_FORUM , L " Support &Forum " ) ;
DEF_STR ( MENU_HOMEPAGE , L " &Homepage " ) ;
//Current Save Slot menu
DEF_STR ( MENU_SLOT_DEFAULT , L " Default " ) ;
DEF_STR ( MENU_SLOT_1 , L " Slot 1 " ) ;
DEF_STR ( MENU_SLOT_2 , L " Slot 2 " ) ;
DEF_STR ( MENU_SLOT_3 , L " Slot 3 " ) ;
DEF_STR ( MENU_SLOT_4 , L " Slot 4 " ) ;
DEF_STR ( MENU_SLOT_5 , L " Slot 5 " ) ;
DEF_STR ( MENU_SLOT_6 , L " Slot 6 " ) ;
DEF_STR ( MENU_SLOT_7 , L " Slot 7 " ) ;
DEF_STR ( MENU_SLOT_8 , L " Slot 8 " ) ;
DEF_STR ( MENU_SLOT_9 , L " Slot 9 " ) ;
DEF_STR ( MENU_SLOT_10 , L " Slot 10 " ) ;
2008-09-18 03:15:49 +00:00
2015-03-04 21:38:06 +00:00
//Pop up Menu
DEF_STR ( POPUP_PLAY , L " Play Game " ) ;
2015-03-25 21:48:23 +00:00
DEF_STR ( POPUP_INFO , L " ROM Information " ) ;
2015-03-04 21:38:06 +00:00
DEF_STR ( POPUP_SETTINGS , L " Edit Game Settings " ) ;
DEF_STR ( POPUP_CHEATS , L " Edit Cheats " ) ;
2015-03-23 09:00:23 +00:00
DEF_STR ( POPUP_GFX_PLUGIN , L " Graphics Plugin " ) ;
2008-09-18 03:15:49 +00:00
//Alternate Name to save Slot
2015-03-04 09:36:08 +00:00
DEF_STR ( SAVE_SLOT_DEFAULT , L " Save Slot - Default " ) ;
DEF_STR ( SAVE_SLOT_1 , L " Save Slot - 1 " ) ;
DEF_STR ( SAVE_SLOT_2 , L " Save Slot - 2 " ) ;
DEF_STR ( SAVE_SLOT_3 , L " Save Slot - 3 " ) ;
DEF_STR ( SAVE_SLOT_4 , L " Save Slot - 4 " ) ;
DEF_STR ( SAVE_SLOT_5 , L " Save Slot - 5 " ) ;
DEF_STR ( SAVE_SLOT_6 , L " Save Slot - 6 " ) ;
DEF_STR ( SAVE_SLOT_7 , L " Save Slot - 7 " ) ;
DEF_STR ( SAVE_SLOT_8 , L " Save Slot - 8 " ) ;
DEF_STR ( SAVE_SLOT_9 , L " Save Slot - 9 " ) ;
DEF_STR ( SAVE_SLOT_10 , L " Save Slot - 10 " ) ;
2008-09-18 03:15:49 +00:00
/*********************************************************************************
2015-03-25 21:48:23 +00:00
* ROM Browser *
2008-09-18 03:15:49 +00:00
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
2015-03-25 21:48:23 +00:00
//ROM Browser Fields
2015-03-04 09:36:08 +00:00
DEF_STR ( RB_FILENAME , L " File Name " ) ;
DEF_STR ( RB_INTERNALNAME , L " Internal Name " ) ;
DEF_STR ( RB_GOODNAME , L " Good Name " ) ;
DEF_STR ( RB_STATUS , L " Status " ) ;
2015-03-25 21:48:23 +00:00
DEF_STR ( RB_ROMSIZE , L " ROM Size " ) ;
2015-03-26 01:53:05 +00:00
DEF_STR ( RB_NOTES_CORE , L " Notes (core) " ) ;
2015-03-04 09:36:08 +00:00
DEF_STR ( RB_NOTES_PLUGIN , L " Notes (default plugins) " ) ;
2015-03-26 01:53:05 +00:00
DEF_STR ( RB_NOTES_USER , L " Notes (user) " ) ;
2015-03-04 09:36:08 +00:00
DEF_STR ( RB_CART_ID , L " Cartridge ID " ) ;
DEF_STR ( RB_MANUFACTUER , L " Manufacturer " ) ;
DEF_STR ( RB_COUNTRY , L " Country " ) ;
DEF_STR ( RB_DEVELOPER , L " Developer " ) ;
DEF_STR ( RB_CRC1 , L " CRC1 " ) ;
DEF_STR ( RB_CRC2 , L " CRC2 " ) ;
DEF_STR ( RB_CICCHIP , L " CIC Chip " ) ;
DEF_STR ( RB_RELEASE_DATE , L " Release Date " ) ;
DEF_STR ( RB_GENRE , L " Genre " ) ;
DEF_STR ( RB_PLAYERS , L " Players " ) ;
DEF_STR ( RB_FORCE_FEEDBACK , L " Force Feedback " ) ;
DEF_STR ( RB_FILE_FORMAT , L " File Format " ) ;
2008-09-18 03:15:49 +00:00
2015-03-25 21:48:23 +00:00
//Select ROM
2015-03-26 01:56:00 +00:00
DEF_STR ( SELECT_ROM_DIR , L " Select current ROM directory " ) ;
2008-09-18 03:15:49 +00:00
//Messages
2015-03-23 09:00:23 +00:00
DEF_STR ( RB_NOT_GOOD_FILE , L " Bad ROM? Use GoodN64 & check for updated RDB " ) ;
2008-09-18 03:15:49 +00:00
/*********************************************************************************
* Options *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
//Options Title
2015-03-04 09:36:08 +00:00
DEF_STR ( OPTIONS_TITLE , L " Settings " ) ;
2008-09-18 03:15:49 +00:00
//Tabs
2015-03-04 09:36:08 +00:00
DEF_STR ( TAB_PLUGIN , L " Plugins " ) ;
DEF_STR ( TAB_DIRECTORY , L " Directories " ) ;
DEF_STR ( TAB_OPTIONS , L " Options " ) ;
2015-03-25 21:48:23 +00:00
DEF_STR ( TAB_ROMSELECTION , L " ROM Selection " ) ;
2015-03-04 09:36:08 +00:00
DEF_STR ( TAB_ADVANCED , L " Advanced " ) ;
DEF_STR ( TAB_ROMSETTINGS , L " General Settings " ) ;
DEF_STR ( TAB_SHELLINTERGATION , L " Shell Integration " ) ;
2015-03-04 21:38:06 +00:00
DEF_STR ( TAB_ROMNOTES , L " Notes " ) ;
2015-03-04 09:36:08 +00:00
DEF_STR ( TAB_SHORTCUTS , L " Keyboard Shortcuts " ) ;
DEF_STR ( TAB_ROMSTATUS , L " Status " ) ;
DEF_STR ( TAB_RECOMPILER , L " Recompiler " ) ;
2008-09-18 03:15:49 +00:00
//Plugin Dialog
2015-03-04 09:36:08 +00:00
DEF_STR ( PLUG_ABOUT , L " About " ) ;
2015-03-26 02:10:21 +00:00
DEF_STR ( PLUG_RSP , L " RSP (Reality Signal Processor) plugin: " ) ;
2015-03-04 09:36:08 +00:00
DEF_STR ( PLUG_GFX , L " Video (graphics) plugin: " ) ;
DEF_STR ( PLUG_AUDIO , L " Audio (sound) plugin: " ) ;
DEF_STR ( PLUG_CTRL , L " Input (controller) plugin: " ) ;
2015-03-26 02:06:24 +00:00
DEF_STR ( PLUG_HLE_GFX , L " Graphics HLE " ) ;
DEF_STR ( PLUG_HLE_AUDIO , L " Audio HLE " ) ;
2015-03-04 09:36:08 +00:00
DEF_STR ( PLUG_DEFAULT , L " ** Use System Plugin ** " ) ;
2008-09-18 03:15:49 +00:00
//Directory Dialog
2015-03-26 02:13:05 +00:00
DEF_STR ( DIR_PLUGIN , L " Plugin directory: " ) ;
DEF_STR ( DIR_ROM , L " ROM directory: " ) ;
DEF_STR ( DIR_AUTO_SAVE , L " N64 native saves directory: " ) ;
2015-03-26 02:17:52 +00:00
DEF_STR ( DIR_INSTANT_SAVE , L " Saved states directory: " ) ;
2015-03-26 02:13:05 +00:00
DEF_STR ( DIR_SCREEN_SHOT , L " Screenshot directory: " ) ;
2015-03-26 02:19:56 +00:00
DEF_STR ( DIR_ROM_DEFAULT , L " Last folder that a ROM was open from " ) ;
2015-03-04 09:36:08 +00:00
DEF_STR ( DIR_SELECT_PLUGIN , L " Select plugin directory " ) ;
2015-03-25 21:48:23 +00:00
DEF_STR ( DIR_SELECT_ROM , L " Select ROM directory " ) ;
DEF_STR ( DIR_SELECT_AUTO , L " Select N64 native saves directory " ) ;
2015-03-26 02:17:52 +00:00
DEF_STR ( DIR_SELECT_INSTANT , L " Select saved states directory " ) ;
2015-03-25 21:48:23 +00:00
DEF_STR ( DIR_SELECT_SCREEN , L " Select screenshot directory " ) ;
2015-03-26 02:13:05 +00:00
DEF_STR ( DIR_TEXTURE , L " Texture pack directory: " ) ;
2015-03-04 09:36:08 +00:00
DEF_STR ( DIR_SELECT_TEXTURE , L " Select texture pack directory " ) ;
2008-09-18 03:15:49 +00:00
//Options (general) Tab
2015-03-23 09:00:23 +00:00
DEF_STR ( OPTION_AUTO_SLEEP , L " Pause emulation when window is not active " ) ;
2015-03-26 02:26:09 +00:00
DEF_STR ( OPTION_AUTO_FULLSCREEN , L " Enter full-screen mode when loading a ROM " ) ;
2015-03-26 02:33:39 +00:00
DEF_STR ( OPTION_BASIC_MODE , L " Hide advanced settings " ) ;
2015-03-04 09:36:08 +00:00
DEF_STR ( OPTION_REMEMBER_CHEAT , L " Remember selected cheats " ) ;
2015-03-26 02:32:07 +00:00
DEF_STR ( OPTION_DISABLE_SS , L " Disable screen saver when running a ROM " ) ;
2015-03-26 02:41:44 +00:00
DEF_STR ( OPTION_DISPLAY_FR , L " Display speed " ) ;
2015-03-23 09:00:23 +00:00
DEF_STR ( OPTION_CHECK_RUNNING , L " Check if Project64 is already running " ) ;
2015-03-26 02:41:44 +00:00
DEF_STR ( OPTION_CHANGE_FR , L " Speed display: " ) ;
2008-09-18 03:15:49 +00:00
2015-03-25 21:48:23 +00:00
//ROM Browser Tab
2015-03-26 02:59:31 +00:00
DEF_STR ( RB_MAX_ROMS , L " Max # of ROMs remembered (0-10): " ) ;
2015-03-25 21:48:23 +00:00
DEF_STR ( RB_ROMS , L " ROMs " ) ;
2015-03-26 02:59:31 +00:00
DEF_STR ( RB_MAX_DIRS , L " Max # of ROM dirs remembered (0-10): " ) ;
2015-03-26 02:43:47 +00:00
DEF_STR ( RB_DIRS , L " dirs " ) ;
2015-03-26 02:59:31 +00:00
DEF_STR ( RB_USE , L " Use ROM browser " ) ;
DEF_STR ( RB_DIR_RECURSION , L " Use directory recursion " ) ;
2015-03-04 09:36:08 +00:00
DEF_STR ( RB_AVALIABLE_FIELDS , L " Available fields: " ) ;
DEF_STR ( RB_SHOW_FIELDS , L " Show fields in this order: " ) ;
DEF_STR ( RB_ADD , L " Add -> " ) ;
DEF_STR ( RB_REMOVE , L " <- Remove " ) ;
DEF_STR ( RB_UP , L " Up " ) ;
DEF_STR ( RB_DOWN , L " Down " ) ;
DEF_STR ( RB_REFRESH , L " Automatically refresh browser " ) ;
2008-09-18 03:15:49 +00:00
//Advanced Options
2015-03-25 21:48:23 +00:00
DEF_STR ( ADVANCE_INFO , L " Most of these changes will not take effect until a new ROM is opened or current ROM is reset. " ) ;
2015-03-04 09:36:08 +00:00
DEF_STR ( ADVANCE_DEFAULTS , L " Core Defaults " ) ;
DEF_STR ( ADVANCE_CPU_STYLE , L " CPU core style: " ) ;
2015-03-29 00:57:02 +00:00
DEF_STR ( ADVANCE_SMCM , L " Self-mod methods: " ) ;
2015-03-26 02:59:31 +00:00
DEF_STR ( ADVANCE_MEM_SIZE , L " Default memory size: " ) ;
DEF_STR ( ADVANCE_ABL , L " Advanced block linking: " ) ;
DEF_STR ( ADVANCE_AUTO_START , L " Start emulation when ROM is opened " ) ;
2015-03-23 09:00:23 +00:00
DEF_STR ( ADVANCE_OVERWRITE , L " Always override default settings with ones from RDB " ) ;
2015-03-29 00:57:02 +00:00
DEF_STR ( ADVANCE_COMPRESS , L " Automatically compress saved states " ) ;
2015-03-26 02:59:31 +00:00
DEF_STR ( ADVANCE_DEBUGGER , L " Enable debugger " ) ;
2015-03-04 09:36:08 +00:00
DEF_STR ( ADVANCE_SMM_CACHE , L " Cache " ) ;
DEF_STR ( ADVANCE_SMM_PIDMA , L " PI DMA " ) ;
2015-03-26 02:59:31 +00:00
DEF_STR ( ADVANCE_SMM_VALIDATE , L " Start changed " ) ;
DEF_STR ( ADVANCE_SMM_PROTECT , L " Protect memory " ) ;
DEF_STR ( ADVANCE_SMM_TLB , L " TLB unmapping " ) ;
2008-09-18 03:15:49 +00:00
2015-03-25 21:48:23 +00:00
//ROM Options
2015-03-04 09:36:08 +00:00
DEF_STR ( ROM_CPU_STYLE , L " CPU core style: " ) ;
2015-03-26 02:59:31 +00:00
DEF_STR ( ROM_VIREFRESH , L " VI refresh rate: " ) ;
DEF_STR ( ROM_MEM_SIZE , L " Memory size: " ) ;
DEF_STR ( ROM_ABL , L " Advanced block linking: " ) ;
DEF_STR ( ROM_SAVE_TYPE , L " Default save type: " ) ;
DEF_STR ( ROM_COUNTER_FACTOR , L " Counter factor: " ) ;
DEF_STR ( ROM_LARGE_BUFFER , L " Larger compile buffer " ) ;
2015-03-04 09:36:08 +00:00
DEF_STR ( ROM_USE_TLB , L " Use TLB " ) ;
DEF_STR ( ROM_REG_CACHE , L " Register caching " ) ;
2015-03-26 02:59:31 +00:00
DEF_STR ( ROM_DELAY_SI , L " Delay SI interrupt " ) ;
2015-03-22 17:05:15 +00:00
DEF_STR ( ROM_FAST_SP , L " Fast SP " ) ;
2015-03-04 09:36:08 +00:00
DEF_STR ( ROM_DEFAULT , L " Default " ) ;
2015-03-26 02:59:31 +00:00
DEF_STR ( ROM_AUDIO_SIGNAL , L " RSP audio signal " ) ;
DEF_STR ( ROM_FIXED_AUDIO , L " Fixed audio timing " ) ;
2015-03-04 09:36:08 +00:00
DEF_STR ( ROM_FUNC_FIND , L " Function lookup method: " ) ;
2015-03-26 02:59:31 +00:00
DEF_STR ( ROM_CUSTOM_SMM , L " Custom self mod Method " ) ;
DEF_STR ( ROM_SYNC_AUDIO , L " Sync using audio " ) ;
DEF_STR ( ROM_COUNTPERBYTE , L " AI count per byte: " ) ;
2015-03-26 03:31:28 +00:00
DEF_STR ( ROM_32BIT , L " 32-bit engine: " ) ;
2015-03-26 02:59:31 +00:00
DEF_STR ( ROM_DELAY_DP , L " Delay DP interrupt: " ) ;
2008-09-18 03:15:49 +00:00
//Core Styles
2015-03-04 09:36:08 +00:00
DEF_STR ( CORE_INTERPTER , L " Interpreter " ) ;
DEF_STR ( CORE_RECOMPILER , L " Recompiler " ) ;
2015-03-26 02:59:31 +00:00
DEF_STR ( CORE_SYNC , L " Synchronize cores " ) ;
2008-09-18 03:15:49 +00:00
//Self Mod Methods
2015-03-04 09:36:08 +00:00
DEF_STR ( SMCM_NONE , L " None " ) ;
DEF_STR ( SMCM_CACHE , L " Cache " ) ;
2015-03-26 02:59:31 +00:00
DEF_STR ( SMCM_PROECTED , L " Protect memory " ) ;
DEF_STR ( SMCM_CHECK_MEM , L " Check memory & cache " ) ;
DEF_STR ( SMCM_CHANGE_MEM , L " Change memory & cache " ) ;
DEF_STR ( SMCM_CHECK_ADV , L " Check memory advance " ) ;
DEF_STR ( SMCM_CACHE2 , L " Clear code on cache " ) ;
2008-09-18 03:15:49 +00:00
2015-03-25 21:48:23 +00:00
//Function Lookup method
2015-03-26 02:59:31 +00:00
DEF_STR ( FLM_PLOOKUP , L " Physical lookup table " ) ;
DEF_STR ( FLM_VLOOKUP , L " Virtual lookup table " ) ;
DEF_STR ( FLM_CHANGEMEM , L " Change memory " ) ;
2008-09-18 03:15:49 +00:00
//RDRAM Size
2015-03-04 09:36:08 +00:00
DEF_STR ( RDRAM_4MB , L " 4 MB " ) ;
DEF_STR ( RDRAM_8MB , L " 8 MB " ) ;
2008-09-18 03:15:49 +00:00
//Advanced Block Linking
2015-03-04 09:36:08 +00:00
DEF_STR ( ABL_ON , L " On " ) ;
DEF_STR ( ABL_OFF , L " Off " ) ;
2008-09-18 03:15:49 +00:00
//Save Type
2015-03-29 00:57:02 +00:00
DEF_STR ( SAVE_FIRST_USED , L " Use first-used save type " ) ;
2015-03-26 03:05:48 +00:00
DEF_STR ( SAVE_4K_EEPROM , L " 4-kbit EEPROM " ) ;
DEF_STR ( SAVE_16K_EEPROM , L " 16-kbit EEPROM " ) ;
DEF_STR ( SAVE_SRAM , L " 32-kbyte SRAM " ) ;
DEF_STR ( SAVE_FLASHRAM , L " Flash RAM " ) ;
2008-09-18 03:15:49 +00:00
2015-03-25 21:48:23 +00:00
//Shell Integration Tab
2015-03-04 09:36:08 +00:00
DEF_STR ( SHELL_TEXT , L " File extension association: " ) ;
2008-09-18 03:15:49 +00:00
2015-03-25 21:48:23 +00:00
//ROM Notes
2015-03-26 02:59:31 +00:00
DEF_STR ( NOTE_STATUS , L " ROM status: " ) ;
DEF_STR ( NOTE_CORE , L " Core note: " ) ;
DEF_STR ( NOTE_PLUGIN , L " Plugin note: " ) ;
2008-09-18 03:15:49 +00:00
// Accelerator Selector
2015-03-26 02:59:31 +00:00
DEF_STR ( ACCEL_CPUSTATE_TITLE , L " CPU state: " ) ;
DEF_STR ( ACCEL_MENUITEM_TITLE , L " Menu item: " ) ;
DEF_STR ( ACCEL_CURRENTKEYS_TITLE , L " Current keys: " ) ;
DEF_STR ( ACCEL_SELKEY_TITLE , L " Select new shortcut key: " ) ;
DEF_STR ( ACCEL_ASSIGNEDTO_TITLE , L " Currently assigned to: " ) ;
2015-03-04 09:36:08 +00:00
DEF_STR ( ACCEL_ASSIGN_BTN , L " Assign " ) ;
DEF_STR ( ACCEL_REMOVE_BTN , L " Remove " ) ;
2015-03-26 02:59:31 +00:00
DEF_STR ( ACCEL_RESETALL_BTN , L " Reset all " ) ;
2015-03-04 09:36:08 +00:00
DEF_STR ( ACCEL_CPUSTATE_1 , L " Game not playing " ) ;
DEF_STR ( ACCEL_CPUSTATE_2 , L " Game playing " ) ;
2015-03-26 02:29:05 +00:00
DEF_STR ( ACCEL_CPUSTATE_3 , L " Game playing (windowed) " ) ;
2015-03-26 02:26:09 +00:00
DEF_STR ( ACCEL_CPUSTATE_4 , L " Game playing (full-screen) " ) ;
2008-09-18 03:15:49 +00:00
// Frame Rate Option
2015-03-26 02:59:31 +00:00
DEF_STR ( STR_FR_VIS , L " Vertical interrupts per second " ) ;
DEF_STR ( STR_FR_DLS , L " Display lists per second " ) ;
2015-03-26 03:07:25 +00:00
DEF_STR ( STR_FR_PERCENT , L " Percentage of full speed " ) ;
2008-09-18 03:15:49 +00:00
// Increase speed
2015-03-04 09:36:08 +00:00
DEF_STR ( STR_INSREASE_SPEED , L " Increase Game Speed " ) ;
DEF_STR ( STR_DECREASE_SPEED , L " Decrease Game Speed " ) ;
2015-03-20 19:38:55 +00:00
//Bottom page buttons
DEF_STR ( BOTTOM_RESET_PAGE , L " Reset Page " ) ;
DEF_STR ( BOTTOM_RESET_ALL , L " Reset All " ) ;
DEF_STR ( BOTTOM_APPLY , L " Apply " ) ;
2008-09-18 03:15:49 +00:00
/*********************************************************************************
* ROM Information *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
2015-03-25 21:48:23 +00:00
//ROM Info Title
DEF_STR ( INFO_TITLE , L " ROM Information " ) ;
2008-09-18 03:15:49 +00:00
2015-03-25 21:48:23 +00:00
//ROM Info Text
2015-03-26 02:59:31 +00:00
DEF_STR ( INFO_ROM_NAME_TEXT , L " ROM name: " ) ;
DEF_STR ( INFO_FILE_NAME_TEXT , L " File name: " ) ;
2015-03-04 09:36:08 +00:00
DEF_STR ( INFO_LOCATION_TEXT , L " Location: " ) ;
2015-03-26 02:59:31 +00:00
DEF_STR ( INFO_SIZE_TEXT , L " ROM size: " ) ;
2015-03-04 09:36:08 +00:00
DEF_STR ( INFO_CART_ID_TEXT , L " Cartridge ID: " ) ;
DEF_STR ( INFO_MANUFACTURER_TEXT , L " Manufacturer: " ) ;
DEF_STR ( INFO_COUNTRY_TEXT , L " Country: " ) ;
DEF_STR ( INFO_CRC1_TEXT , L " CRC1: " ) ;
DEF_STR ( INFO_CRC2_TEXT , L " CRC2: " ) ;
2015-03-26 02:59:31 +00:00
DEF_STR ( INFO_CIC_CHIP_TEXT , L " CIC chip: " ) ;
2015-03-04 09:36:08 +00:00
DEF_STR ( INFO_MD5_TEXT , L " MD5: " ) ;
2008-09-18 03:15:49 +00:00
/*********************************************************************************
* Cheats *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
//Cheat List
2015-03-04 09:36:08 +00:00
DEF_STR ( CHEAT_TITLE , L " Cheats " ) ;
DEF_STR ( CHEAT_LIST_FRAME , L " Cheats: " ) ;
DEF_STR ( CHEAT_NOTES_FRAME , L " Notes: " ) ;
DEF_STR ( CHEAT_MARK_ALL , L " Mark All " ) ;
DEF_STR ( CHEAT_MARK_NONE , L " Unmark All " ) ;
2008-09-18 03:15:49 +00:00
//Add Cheat
2015-03-04 09:36:08 +00:00
DEF_STR ( CHEAT_ADDCHEAT_FRAME , L " Add Cheat " ) ;
DEF_STR ( CHEAT_ADDCHEAT_NAME , L " Name: " ) ;
DEF_STR ( CHEAT_ADDCHEAT_CODE , L " Code: " ) ;
DEF_STR ( CHEAT_ADDCHEAT_INSERT , L " Insert " ) ;
DEF_STR ( CHEAT_ADDCHEAT_CLEAR , L " Clear " ) ;
DEF_STR ( CHEAT_ADDCHEAT_NOTES , L " Cheat Notes: " ) ;
DEF_STR ( CHEAT_ADD_TO_DB , L " Add to DB " ) ;
2008-09-18 03:15:49 +00:00
//Code extension
2015-03-04 09:36:08 +00:00
DEF_STR ( CHEAT_CODE_EXT_TITLE , L " Code Extensions " ) ;
DEF_STR ( CHEAT_CODE_EXT_TXT , L " Please choose a value to be used for: " ) ;
DEF_STR ( CHEAT_OK , L " OK " ) ;
DEF_STR ( CHEAT_CANCEL , L " Cancel " ) ;
2008-09-18 03:15:49 +00:00
//Digital Value
2015-03-04 09:36:08 +00:00
DEF_STR ( CHEAT_QUANTITY_TITLE , L " Quantity Digit " ) ;
DEF_STR ( CHEAT_CHOOSE_VALUE , L " Please choose a value for: " ) ;
DEF_STR ( CHEAT_VALUE , L " &Value " ) ;
DEF_STR ( CHEAT_FROM , L " from " ) ;
DEF_STR ( CHEAT_TO , L " to " ) ;
DEF_STR ( CHEAT_NOTES , L " &Notes: " ) ;
2015-03-04 21:38:06 +00:00
DEF_STR ( CHEAT_ADDCHEAT_ADD , L " Add Cheat " ) ;
DEF_STR ( CHEAT_ADDCHEAT_NEW , L " New Cheat " ) ;
DEF_STR ( CHEAT_ADDCHEAT_CODEDES , L " <address> <value> " ) ;
DEF_STR ( CHEAT_ADDCHEAT_OPT , L " Options: " ) ;
DEF_STR ( CHEAT_ADDCHEAT_OPTDES , L " <value> <label> " ) ;
2008-09-18 03:15:49 +00:00
//Edit Cheat
2015-03-04 09:36:08 +00:00
DEF_STR ( CHEAT_EDITCHEAT_WINDOW , L " Edit Cheat " ) ;
DEF_STR ( CHEAT_EDITCHEAT_UPDATE , L " Update Cheat " ) ;
2015-03-25 21:48:23 +00:00
DEF_STR ( CHEAT_CHANGED_MSG , L " Cheat has been changed. \n \n Do you want to update? " ) ;
2015-03-26 03:08:42 +00:00
DEF_STR ( CHEAT_CHANGED_TITLE , L " Cheat updated " ) ;
2008-09-18 03:15:49 +00:00
//Cheat Popup Menu
2015-03-04 09:36:08 +00:00
DEF_STR ( CHEAT_ADDNEW , L " Add New Cheat... " ) ;
DEF_STR ( CHEAT_EDIT , L " Edit " ) ;
DEF_STR ( CHEAT_DELETE , L " Delete " ) ;
2008-09-18 03:15:49 +00:00
2015-03-26 03:13:09 +00:00
// short-cut editor
DEF_STR ( STR_SHORTCUT_RESET_TITLE , L " Reset short-cuts " ) ;
DEF_STR ( STR_SHORTCUT_RESET_TEXT , L " Are you sure you want to reset the short-cuts? \n \n This action cannot be undone. " ) ;
2015-03-04 09:36:08 +00:00
DEF_STR ( STR_SHORTCUT_FILEMENU , L " File Menu " ) ;
DEF_STR ( STR_SHORTCUT_SYSTEMMENU , L " System Menu " ) ;
DEF_STR ( STR_SHORTCUT_OPTIONS , L " Options " ) ;
DEF_STR ( STR_SHORTCUT_SAVESLOT , L " Save Slots " ) ;
2008-09-18 03:15:49 +00:00
/*********************************************************************************
* Messages *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
2015-03-04 09:36:08 +00:00
DEF_STR ( MSG_CPU_PAUSED , L " *** CPU PAUSED *** " ) ;
2015-03-26 02:59:31 +00:00
DEF_STR ( MSG_CPU_RESUMED , L " CPU resumed " ) ;
2015-03-29 00:57:02 +00:00
DEF_STR ( MSG_PERM_LOOP , L " In a permanent loop that cannot be exited. \n Emulation will now stop. \n \n Verify ROM and ROM settings. " ) ;
2015-03-26 02:59:31 +00:00
DEF_STR ( MSG_MEM_ALLOC_ERROR , L " Failed to allocate memory " ) ;
2015-03-04 21:38:06 +00:00
DEF_STR ( MSG_FAIL_INIT_GFX , L " The default or selected video plugin is missing or invalid. \n \n You need to go into Settings and select a video (graphics) plugin. \n Check that you have at least one compatible plugin file in your plugin folder. " ) ;
DEF_STR ( MSG_FAIL_INIT_AUDIO , L " The default or selected audio plugin is missing or invalid. \n \n You need to go into Settings and select a audio (sound) plugin. \n Check that you have at least one compatible plugin file in your plugin folder. " ) ;
2015-03-26 02:59:31 +00:00
DEF_STR ( MSG_FAIL_INIT_RSP , L " The default or selected RSP plugin is missing or invalid. \n \n You need to go into Settings and select a RSP (Reality Signal Processor) plugin. \n Check that you have at least one compatible plugin file in your plugin folder. " ) ;
2015-03-04 21:38:06 +00:00
DEF_STR ( MSG_FAIL_INIT_CONTROL , L " The default or selected input plugin is missing or invalid. \n \n You need to go into Settings and select an input (controller) plugin. \n Check that you have at least one compatible plugin file in your plugin folder. " ) ;
2015-03-04 09:36:08 +00:00
DEF_STR ( MSG_FAIL_LOAD_PLUGIN , L " Failed to load plugin: " ) ;
2015-03-29 00:57:02 +00:00
DEF_STR ( MSG_FAIL_LOAD_WORD , L " Failed to load word. \n \n Verify ROM and ROM settings. " ) ;
2015-03-26 02:59:31 +00:00
DEF_STR ( MSG_FAIL_OPEN_SAVE , L " Failed to open save file " ) ;
2015-03-25 21:48:23 +00:00
DEF_STR ( MSG_FAIL_OPEN_EEPROM , L " Failed to open EEPROM " ) ;
2015-03-26 02:59:31 +00:00
DEF_STR ( MSG_FAIL_OPEN_FLASH , L " Failed to open flash RAM " ) ;
DEF_STR ( MSG_FAIL_OPEN_MEMPAK , L " Failed to open mempak " ) ;
2015-03-04 09:36:08 +00:00
DEF_STR ( MSG_FAIL_OPEN_ZIP , L " Attempt to open zip file failed. \n \n Probably a corrupt zip file - try unzipping ROM manually. " ) ;
DEF_STR ( MSG_FAIL_OPEN_IMAGE , L " Attempt to open file failed. " ) ;
2015-03-25 21:48:23 +00:00
DEF_STR ( MSG_FAIL_ZIP , L " Error occurred when trying to open zip file. " ) ;
DEF_STR ( MSG_FAIL_IMAGE , L " File loaded does not appear to be a valid N64 ROM. \n \n Verify your ROMs with GoodN64. " ) ;
2015-03-04 09:36:08 +00:00
DEF_STR ( MSG_UNKNOWN_COUNTRY , L " Unknown country " ) ;
2015-03-26 03:16:26 +00:00
DEF_STR ( MSG_UNKNOWN_CIC_CHIP , L " Unknown CIC chip " ) ;
2015-03-04 09:36:08 +00:00
DEF_STR ( MSG_UNKNOWN_FILE_FORMAT , L " Unknown file format " ) ;
2015-03-23 09:00:23 +00:00
DEF_STR ( MSG_UNKNOWN_MEM_ACTION , L " Unknown memory action \n \n Emulation stopped " ) ;
2015-03-26 02:59:31 +00:00
DEF_STR ( MSG_UNHANDLED_OP , L " Unhandled R4300i opcode at " ) ;
2015-03-26 03:16:26 +00:00
DEF_STR ( MSG_NONMAPPED_SPACE , L " Executing from non-mapped space. \n \n Verify ROM and ROM settings. " ) ;
2015-03-26 02:59:31 +00:00
DEF_STR ( MSG_SAVE_STATE_HEADER , L " This saved state does not appear to match the running ROM. \n \n States must be saved & loaded between 100% identical ROMs. \n In particular the REGION and VERSION need to be the same. \n Loading this state is likely to cause the game and/or emulator to crash. \n \n Are you sure you want to continue loading? " ) ;
2015-03-04 09:36:08 +00:00
DEF_STR ( MSG_MSGBOX_TITLE , L " Error " ) ;
DEF_STR ( MSG_PIF2_ERROR , L " Copyright sequence not found in LUT. Game will no longer function. " ) ;
DEF_STR ( MSG_PIF2_TITLE , L " Copy Protection Failure " ) ;
2015-03-26 02:59:31 +00:00
DEF_STR ( MSG_PLUGIN_CHANGE , L " Changing a plugin requires Project64 to reset a running ROM. \n If you don't want to lose your place, answer No and save the current state first. \n \n Change plugins and reset ROM now? " ) ;
2015-03-04 09:36:08 +00:00
DEF_STR ( MSG_PLUGIN_CHANGE_TITLE , L " Change Plugins " ) ;
DEF_STR ( MSG_EMULATION_ENDED , L " Emulation ended " ) ;
DEF_STR ( MSG_EMULATION_STARTED , L " Emulation started " ) ;
2015-03-26 02:59:31 +00:00
DEF_STR ( MSG_UNABLED_LOAD_STATE , L " Unable to load state " ) ;
DEF_STR ( MSG_LOADED_STATE , L " Loaded state " ) ;
DEF_STR ( MSG_SAVED_STATE , L " Saved current state to " ) ;
2015-03-25 21:48:23 +00:00
DEF_STR ( MSG_SAVE_SLOT , L " State slot " ) ;
2015-03-26 03:18:31 +00:00
DEF_STR ( MSG_BYTESWAP , L " Byte-swapping image " ) ;
2015-03-04 09:36:08 +00:00
DEF_STR ( MSG_CHOOSE_IMAGE , L " Choosing N64 image " ) ;
DEF_STR ( MSG_LOADED , L " Loaded " ) ;
DEF_STR ( MSG_LOADING , L " Loading image " ) ;
2015-03-26 04:11:43 +00:00
DEF_STR ( MSG_PLUGIN_NOT_INIT , L " Cannot open a ROM because plugins have not successfully initialized. " ) ;
2015-03-04 09:36:08 +00:00
DEF_STR ( MSG_DEL_SURE , L " Are you sure you really want to delete this? " ) ;
DEF_STR ( MSG_DEL_TITLE , L " Delete Cheat " ) ;
2015-03-26 03:21:42 +00:00
DEF_STR ( MSG_CHEAT_NAME_IN_USE , L " Cheat name is already in use. " ) ;
DEF_STR ( MSG_MAX_CHEATS , L " You have reached the maximum amount of cheats for this ROM. " ) ;
2015-03-25 21:48:23 +00:00
DEF_STR ( MSG_PLUGIN_INIT , L " Plugin initializing " ) ;
2015-03-26 03:21:42 +00:00
DEF_STR ( MSG_NO_SHORTCUT_SEL , L " You have not selected a virtual key to assign to the menu item. " ) ;
DEF_STR ( MSG_NO_MENUITEM_SEL , L " You need to select a menu item to assign this key to. " ) ;
DEF_STR ( MSG_MENUITEM_ASSIGNED , L " Short-cut has already been assigned to another menu item. " ) ;
DEF_STR ( MSG_NO_SEL_SHORTCUT , L " No shortcut has been selected to be removed. " ) ;
2015-03-26 02:59:31 +00:00
DEF_STR ( MSG_WAITING_FOR_START , L " ROM loaded. Waiting for emulation to start. " ) ;
2015-03-26 03:21:42 +00:00
DEF_STR ( MSG_INVALID_EXE , L " Project64 beta is for members only. \n \n If you have an account at pj64.net, you should not be seeing this error!! \n Please contact us on the site. " ) ;
2015-03-04 09:36:08 +00:00
DEF_STR ( MSG_INVALID_EXE_TITLE , L " Program Error " ) ;
DEF_STR ( MSG_7Z_FILE_NOT_FOUND , L " Failed to find filename in 7z file " ) ;
2015-03-26 03:29:02 +00:00
DEF_STR ( MSG_SET_LLE_GFX_TITLE , L " Graphics Low-Level Emulation " ) ;
2015-03-26 04:12:49 +00:00
DEF_STR ( MSG_SET_LLE_GFX_MSG , L " Graphics LLE is not for general use!!! \n It is advisable that you only use this for testing and not for playing games. \n \n Change to graphics LLE? " ) ;
2015-03-26 03:29:02 +00:00
DEF_STR ( MSG_SET_HLE_AUD_TITLE , L " Audio High-Level Emulation " ) ;
2015-03-26 04:11:43 +00:00
DEF_STR ( MSG_SET_HLE_AUD_MSG , L " Audio HLE requires a third-party plugin!!! \n If you do not use a third-party audio plugin that supports HLE, you will hear no sound. \n \n Change to audio HLE? " ) ;
2008-09-18 03:15:49 +00:00
}
LRESULT CALLBACK LangSelectProc ( HWND hDlg , UINT uMsg , WPARAM wParam , LPARAM lParam ) ;
CLanguage : : CLanguage ( ) :
2015-03-04 09:36:08 +00:00
m_emptyString ( L " " )
2008-09-18 03:15:49 +00:00
{
LoadDefaultStrings ( ) ;
}
void CLanguage : : LoadCurrentStrings ( bool ShowSelectDialog )
{
if ( ShowSelectDialog )
{
2015-03-04 09:36:08 +00:00
m_SelectedLanguage = g_Settings - > LoadString ( Setting_CurrentLanguage ) . ToUTF16 ( ) ;
2008-09-18 03:15:49 +00:00
}
LanguageList LangList = GetLangList ( ) ;
stdstr Filename ;
//clear all the current strings loaded
2012-11-19 11:05:30 +00:00
m_CurrentStrings . clear ( ) ;
2008-09-18 03:15:49 +00:00
//Find the file name of the current language
2015-03-04 09:36:08 +00:00
for ( LanguageList : : iterator Language = LangList . begin ( ) ; Language ! = LangList . end ( ) ; Language + + )
{
if ( g_Lang - > IsCurrentLang ( * Language ) )
2008-09-18 03:15:49 +00:00
{
Filename = Language - > Filename ;
break ;
}
}
if ( ShowSelectDialog & & Filename . length ( ) = = 0 & & LangList . size ( ) > 0 )
{
//Do Dialog box to choose language
DialogBoxParam ( GetModuleHandle ( NULL ) , MAKEINTRESOURCE ( IDD_Lang_Select ) , NULL , ( DLGPROC ) LangSelectProc , ( LPARAM ) this ) ;
return ;
}
if ( Filename . length ( ) = = 0 )
{
return ;
}
//Process the file
FILE * file = fopen ( Filename . c_str ( ) , " rb " ) ;
if ( file = = NULL ) { return ; }
2015-03-10 11:54:12 +00:00
//Search for utf8 file marker
BYTE utf_bom [ 3 ] ;
if ( fread ( & utf_bom , sizeof ( utf_bom ) , 1 , file ) ! = 1 | |
utf_bom [ 0 ] ! = 0xEF | |
utf_bom [ 1 ] ! = 0xBB | |
utf_bom [ 2 ] ! = 0xBF )
{
fclose ( file ) ;
return ;
}
2008-09-18 03:15:49 +00:00
//String;
2012-10-06 04:09:17 +00:00
while ( ! feof ( file ) )
{
2012-11-19 11:05:30 +00:00
m_CurrentStrings . insert ( GetNextLangString ( file ) ) ;
2008-09-18 03:15:49 +00:00
}
fclose ( file ) ;
}
WNDPROC pfnWndLangSelectOkProc = NULL ;
HBITMAP hOkButton = NULL ;
DWORD CALLBACK LangSelectOkProc ( HWND hWnd , DWORD uMsg , DWORD wParam , DWORD lParam )
{
static bool m_fPressed = false ;
static HBITMAP hOkButtonDown = NULL ;
switch ( uMsg ) {
case WM_PAINT :
{
PAINTSTRUCT ps ;
if ( BeginPaint ( hWnd , & ps ) )
{
if ( m_fPressed )
{
if ( hOkButtonDown = = NULL )
{
hOkButtonDown = LoadBitmap ( GetModuleHandle ( NULL ) , MAKEINTRESOURCE ( IDB_LANG_OK_DOWN ) ) ;
}
if ( hOkButtonDown )
{
RECT rcClient ;
GetClientRect ( hWnd , & rcClient ) ;
BITMAP bmTL1 ;
GetObject ( hOkButtonDown , sizeof ( BITMAP ) , & bmTL1 ) ;
HDC memdc = CreateCompatibleDC ( ps . hdc ) ;
HGDIOBJ save = SelectObject ( memdc , hOkButtonDown ) ;
BitBlt ( ps . hdc , 0 , 0 , bmTL1 . bmWidth , bmTL1 . bmHeight , memdc , 0 , 0 , SRCCOPY ) ;
SelectObject ( memdc , save ) ;
DeleteDC ( memdc ) ;
}
} else {
if ( hOkButton )
{
RECT rcClient ;
GetClientRect ( hWnd , & rcClient ) ;
BITMAP bmTL1 ;
GetObject ( hOkButton , sizeof ( BITMAP ) , & bmTL1 ) ;
HDC memdc = CreateCompatibleDC ( ps . hdc ) ;
HGDIOBJ save = SelectObject ( memdc , hOkButton ) ;
BitBlt ( ps . hdc , 0 , 0 , bmTL1 . bmWidth , bmTL1 . bmHeight , memdc , 0 , 0 , SRCCOPY ) ;
SelectObject ( memdc , save ) ;
DeleteDC ( memdc ) ;
}
}
EndPaint ( hWnd , & ps ) ;
}
}
break ;
case WM_MOUSEMOVE :
if ( : : GetCapture ( ) = = hWnd )
{
POINT ptCursor = { ( ( int ) ( short ) LOWORD ( lParam ) ) , ( ( int ) ( short ) HIWORD ( lParam ) ) } ;
ClientToScreen ( hWnd , & ptCursor ) ;
RECT rect ;
GetWindowRect ( hWnd , & rect ) ;
bool uPressed = : : PtInRect ( & rect , ptCursor ) = = TRUE ;
if ( m_fPressed ! = uPressed )
{
m_fPressed = uPressed ;
: : InvalidateRect ( hWnd , NULL , TRUE ) ;
UpdateWindow ( hWnd ) ;
}
}
break ;
case WM_LBUTTONDOWN :
{
LRESULT lRet = 0 ;
lRet = DefWindowProc ( hWnd , uMsg , wParam , lParam ) ;
SetCapture ( hWnd ) ;
if ( : : GetCapture ( ) = = hWnd )
{
m_fPressed = true ;
if ( m_fPressed )
{
: : InvalidateRect ( hWnd , NULL , TRUE ) ;
UpdateWindow ( hWnd ) ;
}
}
return lRet ;
}
break ;
case WM_LBUTTONUP :
{
LRESULT lRet = 0 ;
lRet = DefWindowProc ( hWnd , uMsg , wParam , lParam ) ;
if ( : : GetCapture ( ) = = hWnd )
{
: : ReleaseCapture ( ) ;
if ( m_fPressed )
{
: : SendMessage ( GetParent ( hWnd ) , WM_COMMAND , MAKEWPARAM ( GetDlgCtrlID ( hWnd ) , BN_CLICKED ) , ( LPARAM ) hWnd ) ;
}
}
m_fPressed = false ;
return lRet ;
}
break ;
}
return CallWindowProc ( pfnWndLangSelectOkProc , hWnd , uMsg , wParam , lParam ) ;
}
2015-03-04 09:36:08 +00:00
LRESULT CALLBACK LangSelectProc ( HWND hDlg , UINT uMsg , WPARAM wParam , LPARAM lParam )
{
2008-09-18 03:15:49 +00:00
static HBITMAP hbmpBackgroundTop = NULL ;
static HBITMAP hbmpBackgroundBottom = NULL ;
static HBITMAP hbmpBackgroundMiddle = NULL ;
static HFONT hTextFont = NULL ;
static CLanguage * lngClass ;
switch ( uMsg ) {
case WM_INITDIALOG :
SetWindowPos ( hDlg , HWND_TOPMOST , 0 , 0 , 0 , 0 , SWP_NOMOVE | SWP_NOREPOSITION | SWP_NOSIZE ) ;
{
lngClass = ( CLanguage * ) lParam ;
LanguageList LangList = lngClass - > GetLangList ( ) ;
if ( LangList . size ( ) = = 0 ) { EndDialog ( hDlg , 0 ) ; }
for ( LanguageList : : iterator Language = LangList . begin ( ) ; Language ! = LangList . end ( ) ; Language + + )
{
2015-03-04 09:36:08 +00:00
int index = SendMessageW ( GetDlgItem ( hDlg , IDC_LANG_SEL ) , CB_ADDSTRING , 0 , ( WPARAM ) Language - > LanguageName . c_str ( ) ) ;
if ( _wcsicmp ( Language - > LanguageName . c_str ( ) , L " English " ) = = 0 )
{
2008-09-18 03:15:49 +00:00
SendMessage ( GetDlgItem ( hDlg , IDC_LANG_SEL ) , CB_SETCURSEL , index , 0 ) ;
}
}
int Index = SendMessage ( GetDlgItem ( hDlg , IDC_LANG_SEL ) , CB_GETCURSEL , 0 , 0 ) ;
if ( Index < 0 ) { SendMessage ( GetDlgItem ( hDlg , IDC_LANG_SEL ) , CB_SETCURSEL , 0 , 0 ) ; }
enum { ROUND_EDGE = 15 } ;
DWORD dwStyle = GetWindowLong ( hDlg , GWL_STYLE ) ;
dwStyle & = ~ ( WS_CAPTION | WS_SIZEBOX ) ;
SetWindowLong ( hDlg , GWL_STYLE , dwStyle ) ;
// Use the size of the image
hbmpBackgroundTop = LoadBitmap ( GetModuleHandle ( NULL ) , MAKEINTRESOURCE ( IDB_ABOUT_TOP ) ) ;
hbmpBackgroundBottom = LoadBitmap ( GetModuleHandle ( NULL ) , MAKEINTRESOURCE ( IDB_ABOUT_BOTTOM ) ) ;
hbmpBackgroundMiddle = LoadBitmap ( GetModuleHandle ( NULL ) , MAKEINTRESOURCE ( IDB_ABOUT_MIDDLE ) ) ;
BITMAP bmTL ;
GetObject ( hbmpBackgroundTop , sizeof ( BITMAP ) , & bmTL ) ;
if ( hbmpBackgroundTop )
{
// int iHeight = bmTL.bmHeight;
int iWidth = bmTL . bmWidth ;
RECT rect ;
GetWindowRect ( hDlg , & rect ) ;
rect . left - = rect . left ;
rect . bottom - = rect . top ;
rect . top - = rect . top ;
// Tweaked
HRGN hWindowRegion = CreateRoundRectRgn
(
rect . left ,
rect . top ,
rect . left + iWidth + GetSystemMetrics ( SM_CXEDGE ) - 1 ,
rect . bottom + GetSystemMetrics ( SM_CYEDGE ) - 1 ,
ROUND_EDGE ,
ROUND_EDGE
) ;
if ( hWindowRegion )
{
SetWindowRgn ( hDlg , hWindowRegion , TRUE ) ;
DeleteObject ( hWindowRegion ) ;
}
}
hTextFont = : : CreateFont
(
18 ,
0 ,
0 ,
0 ,
FW_NORMAL ,
0 ,
0 ,
0 ,
DEFAULT_CHARSET ,
OUT_DEFAULT_PRECIS ,
CLIP_DEFAULT_PRECIS ,
PROOF_QUALITY ,
DEFAULT_PITCH | FF_DONTCARE ,
_T ( " Arial " )
) ;
SendDlgItemMessage ( hDlg , IDC_SELECT_LANG , WM_SETFONT , ( WPARAM ) hTextFont , TRUE ) ;
}
hOkButton = LoadBitmap ( GetModuleHandle ( NULL ) , MAKEINTRESOURCE ( IDB_LANG_OK ) ) ;
pfnWndLangSelectOkProc = ( WNDPROC ) : : GetWindowLongPtr ( GetDlgItem ( hDlg , IDOK ) , GWLP_WNDPROC ) ;
: : SetWindowLongPtr ( GetDlgItem ( hDlg , IDOK ) , GWLP_WNDPROC , ( LONG_PTR ) LangSelectOkProc ) ;
break ;
case WM_NCHITTEST :
{
int xPos = LOWORD ( lParam ) ;
int yPos = HIWORD ( lParam ) ;
RECT client , a ;
GetClientRect ( hDlg , & a ) ;
GetClientRect ( hDlg , & client ) ;
ClientToScreen ( hDlg , ( LPPOINT ) & client ) ;
client . right + = client . left ;
client . bottom + = client . top ;
int nCaption = GetSystemMetrics ( SM_CYCAPTION ) * 4 ;
LRESULT lResult = HTCLIENT ;
//check caption
if ( xPos < = client . right & & xPos > = client . left & &
( yPos > = client . top + 0 ) & & ( yPos < = client . top + 0 + nCaption ) )
{
lResult = HTCAPTION ;
}
SetWindowLong ( hDlg , DWL_MSGRESULT , lResult ) ;
return TRUE ;
}
break ;
case WM_CTLCOLORSTATIC :
{
HDC hdcStatic = ( HDC ) wParam ;
SetTextColor ( hdcStatic , RGB ( 0 , 0 , 0 ) ) ;
SetBkMode ( hdcStatic , TRANSPARENT ) ;
return ( LONG ) ( LRESULT ) ( ( HBRUSH ) GetStockObject ( NULL_BRUSH ) ) ;
}
break ;
case WM_PAINT :
{
PAINTSTRUCT ps ;
if ( BeginPaint ( hDlg , & ps ) )
{
RECT rcClient ;
GetClientRect ( hDlg , & rcClient ) ;
BITMAP bmTL_top , bmTL_bottom , bmTL_Middle ;
GetObject ( hbmpBackgroundTop , sizeof ( BITMAP ) , & bmTL_top ) ;
GetObject ( hbmpBackgroundBottom , sizeof ( BITMAP ) , & bmTL_bottom ) ;
GetObject ( hbmpBackgroundMiddle , sizeof ( BITMAP ) , & bmTL_Middle ) ;
HDC memdc = CreateCompatibleDC ( ps . hdc ) ;
HGDIOBJ save = SelectObject ( memdc , hbmpBackgroundTop ) ;
BitBlt ( ps . hdc , 0 , 0 , bmTL_top . bmWidth , bmTL_top . bmHeight , memdc , 0 , 0 , SRCCOPY ) ;
SelectObject ( memdc , save ) ;
DeleteDC ( memdc ) ;
memdc = CreateCompatibleDC ( ps . hdc ) ;
save = SelectObject ( memdc , hbmpBackgroundMiddle ) ;
for ( int x = bmTL_top . bmHeight ; x < rcClient . bottom ; x + = bmTL_Middle . bmHeight )
{
//BitBlt(ps.hdc, 0, bmTL_top.bmHeight, bmTL_Middle.bmWidth, rcClient.bottom - (bmTL_bottom.bmHeight + bmTL_top.bmHeight), memdc, 0, 0, SRCCOPY);
BitBlt ( ps . hdc , 0 , x , bmTL_Middle . bmWidth , bmTL_Middle . bmHeight , memdc , 0 , 0 , SRCCOPY ) ;
}
SelectObject ( memdc , save ) ;
DeleteDC ( memdc ) ;
BITMAP ;
memdc = CreateCompatibleDC ( ps . hdc ) ;
save = SelectObject ( memdc , hbmpBackgroundBottom ) ;
BitBlt ( ps . hdc , 0 , rcClient . bottom - bmTL_bottom . bmHeight , bmTL_bottom . bmWidth , bmTL_bottom . bmHeight , memdc , 0 , 0 , SRCCOPY ) ;
SelectObject ( memdc , save ) ;
DeleteDC ( memdc ) ;
BITMAP ;
EndPaint ( hDlg , & ps ) ;
}
}
break ;
case WM_COMMAND :
switch ( LOWORD ( wParam ) ) {
case IDOK :
if ( hbmpBackgroundTop )
{
DeleteObject ( hbmpBackgroundTop ) ;
}
if ( hbmpBackgroundBottom )
{
DeleteObject ( hbmpBackgroundBottom ) ;
}
if ( hbmpBackgroundMiddle )
{
DeleteObject ( hbmpBackgroundMiddle ) ;
}
if ( hTextFont )
2015-03-04 09:36:08 +00:00
{
2008-09-18 03:15:49 +00:00
: : DeleteObject ( hTextFont ) ;
2015-03-04 09:36:08 +00:00
}
2008-09-18 03:15:49 +00:00
{
int Index = SendMessage ( GetDlgItem ( hDlg , IDC_LANG_SEL ) , CB_GETCURSEL , 0 , 0 ) ;
2015-03-04 09:36:08 +00:00
if ( Index > = 0 )
{
wchar_t String [ 255 ] ;
SendMessageW ( GetDlgItem ( hDlg , IDC_LANG_SEL ) , CB_GETLBTEXT , Index , ( LPARAM ) String ) ;
2008-09-18 03:15:49 +00:00
lngClass - > SetLanguage ( String ) ;
}
}
EndDialog ( hDlg , 0 ) ;
break ;
}
default :
return FALSE ;
}
return TRUE ;
}
LanguageList & CLanguage : : GetLangList ( void )
{
if ( m_LanguageList . size ( ) > 0 )
{
return m_LanguageList ;
}
2012-11-17 01:02:04 +00:00
CPath LanguageFiles ( g_Settings - > LoadString ( Setting_LanguageDir ) , " *.pj.Lang " ) ;
2008-09-18 03:15:49 +00:00
if ( LanguageFiles . FindFirst ( ) )
{
2015-03-04 09:36:08 +00:00
do
{
2008-09-18 03:15:49 +00:00
LanguageFile File ; //We temporally store the values in here to added to the list
File . Filename = LanguageFiles ;
2015-03-10 11:54:12 +00:00
File . LanguageName = GetLangString ( LanguageFiles , LANGUAGE_NAME ) ;
if ( File . LanguageName . length ( ) = = 0 )
{
continue ;
}
2008-09-18 03:15:49 +00:00
//get the name of the language from inside the file
m_LanguageList . push_back ( File ) ;
} while ( LanguageFiles . FindNext ( ) ) ;
}
return m_LanguageList ;
}
2015-03-04 09:36:08 +00:00
const std : : wstring & CLanguage : : GetString ( LanguageStringID StringID )
2012-11-19 11:05:30 +00:00
{
LANG_STRINGS : : iterator CurrentString = m_CurrentStrings . find ( StringID ) ;
2015-03-04 09:36:08 +00:00
if ( CurrentString ! = m_CurrentStrings . end ( ) )
{
2008-09-18 03:15:49 +00:00
return CurrentString - > second ;
}
2012-11-19 11:05:30 +00:00
LANG_STRINGS : : iterator DefString = m_DefaultStrings . find ( StringID ) ;
2015-03-04 09:36:08 +00:00
if ( DefString ! = m_DefaultStrings . end ( ) )
{
2008-09-18 03:15:49 +00:00
return DefString - > second ;
}
# ifdef _DEBUG
2015-03-11 19:50:30 +00:00
g_Notify - > BreakPoint ( __FILEW__ , __LINE__ ) ;
2008-09-18 03:15:49 +00:00
# endif
return m_emptyString ;
}
2015-03-04 09:36:08 +00:00
std : : wstring CLanguage : : GetLangString ( const char * FileName , LanguageStringID ID )
2012-11-19 11:05:30 +00:00
{
2008-09-18 03:15:49 +00:00
FILE * file = fopen ( FileName , " rb " ) ;
2015-03-04 09:36:08 +00:00
if ( file = = NULL ) { return L " " ; }
2008-09-18 03:15:49 +00:00
2015-03-10 11:54:12 +00:00
//Search for utf8 file marker
BYTE utf_bom [ 3 ] ;
if ( fread ( & utf_bom , sizeof ( utf_bom ) , 1 , file ) ! = 1 | |
utf_bom [ 0 ] ! = 0xEF | |
utf_bom [ 1 ] ! = 0xBB | |
utf_bom [ 2 ] ! = 0xBF )
{
return L " " ;
}
2008-09-18 03:15:49 +00:00
//String;
2012-10-06 04:09:17 +00:00
while ( ! feof ( file ) )
{
LANG_STR String = GetNextLangString ( file ) ;
2015-03-04 09:36:08 +00:00
if ( String . first = = ID )
{
2008-09-18 03:15:49 +00:00
fclose ( file ) ;
return String . second ;
}
}
fclose ( file ) ;
2015-03-04 09:36:08 +00:00
return L " " ;
2008-09-18 03:15:49 +00:00
}
2012-11-19 11:05:30 +00:00
LANG_STR CLanguage : : GetNextLangString ( void * OpenFile )
{
2008-09-18 03:15:49 +00:00
enum { MAX_STRING_LEN = 400 } ;
int StringID ;
char szString [ MAX_STRING_LEN ] ; //temp store the string from the file
FILE * file = ( FILE * ) OpenFile ;
2015-03-10 11:54:12 +00:00
//while(token!='#' && !feof(file)) { fread(&token, 1, 1, file); }
if ( feof ( file ) ) { return LANG_STR ( 0 , L " " ) ; }
2008-09-18 03:15:49 +00:00
//Search for token #
2015-03-10 11:54:12 +00:00
char token = 0 ;
2008-09-18 03:15:49 +00:00
while ( token ! = ' # ' & & ! feof ( file ) ) { fread ( & token , 1 , 1 , file ) ; }
2015-03-04 09:36:08 +00:00
if ( feof ( file ) ) { return LANG_STR ( 0 , L " " ) ; }
2008-09-18 03:15:49 +00:00
//get StringID after token
fscanf ( file , " %d " , & StringID ) ;
//Search for token #
while ( token ! = ' # ' & & ! feof ( file ) ) { fread ( & token , 1 , 1 , file ) ; }
2015-03-04 09:36:08 +00:00
if ( feof ( file ) ) { StringID = EMPTY_STRING ; return LANG_STR ( 0 , L " " ) ; }
2008-09-18 03:15:49 +00:00
2015-03-04 09:36:08 +00:00
//Search for start of string '"'
2008-09-18 03:15:49 +00:00
while ( token ! = ' " ' & & ! feof ( file ) ) { fread ( & token , 1 , 1 , file ) ; }
2015-03-04 09:36:08 +00:00
if ( feof ( file ) ) { StringID = EMPTY_STRING ; return LANG_STR ( 0 , L " " ) ; }
2008-09-18 03:15:49 +00:00
int pos = 0 ;
fread ( & token , 1 , 1 , file ) ;
2015-03-04 09:36:08 +00:00
while ( token ! = ' " ' & & ! feof ( file ) )
{
2008-09-18 03:15:49 +00:00
szString [ pos + + ] = token ;
fread ( & token , 1 , 1 , file ) ;
if ( pos = = MAX_STRING_LEN - 2 ) { token = ' " ' ; }
}
szString [ pos + + ] = 0 ;
2015-03-11 19:50:30 +00:00
stdstr text ( szString ) ;
text . Replace ( " \\ n " , " \n " ) ;
return LANG_STR ( StringID , text . ToUTF16 ( ) ) ;
2008-09-18 03:15:49 +00:00
}
2015-03-04 09:36:08 +00:00
void CLanguage : : SetLanguage ( const wchar_t * LanguageName )
2008-09-18 03:15:49 +00:00
{
m_SelectedLanguage = LanguageName ;
LoadCurrentStrings ( false ) ;
2015-03-04 09:36:08 +00:00
stdstr Language ;
Language . FromUTF16 ( LanguageName ) ;
g_Settings - > SaveString ( Setting_CurrentLanguage , Language ) ;
2008-09-18 03:15:49 +00:00
}
bool CLanguage : : IsCurrentLang ( LanguageFile & File )
{
if ( m_SelectedLanguage = = File . LanguageName )
{
return true ;
}
return false ;
2015-01-31 19:27:27 +00:00
}