Language.h 2.33 KB
Newer Older
longpanda's avatar
longpanda committed
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
/******************************************************************************
 * Language.h
 *
 * Copyright (c) 2020, longpanda <admin@ventoy.net>
 *
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public License as
 * published by the Free Software Foundation; either version 3 of the
 * License, or (at your option) any later version.
 * 
 * This program is distributed in the hope that it will be useful, but
 * WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * General Public License for more details.
 * 
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, see <http://www.gnu.org/licenses/>.
 *
 */
 
#ifndef __LANGUAGE_H__
#define __LANGUAGE_H__

longpanda's avatar
longpanda committed
24

longpanda's avatar
longpanda committed
25
26
typedef enum STR_ID
{
longpanda's avatar
longpanda committed
27
28
29
30
31
	STR_ERROR = 0,
	STR_WARNING, // 1
	STR_INFO, // 2
	STR_INCORRECT_DIR, //3
	STR_INCORRECT_TREE_DIR, //4
longpanda's avatar
longpanda committed
32

longpanda's avatar
longpanda committed
33
34
35
36
37
38
	STR_DEVICE, //5
	STR_LOCAL_VER, //6
	STR_DISK_VER, //7
	STR_STATUS, //8
	STR_INSTALL, //9
	STR_UPDATE, //10
longpanda's avatar
longpanda committed
39

longpanda's avatar
longpanda committed
40
41
42
	STR_UPDATE_TIP, //11
	STR_INSTALL_TIP, //12
	STR_INSTALL_TIP2,//13
longpanda's avatar
longpanda committed
43

longpanda's avatar
longpanda committed
44
45
46
47
	STR_INSTALL_SUCCESS,//14
	STR_INSTALL_FAILED,//15
	STR_UPDATE_SUCCESS,//16
	STR_UPDATE_FAILED,//17
longpanda's avatar
longpanda committed
48

longpanda's avatar
longpanda committed
49
	STR_WAIT_PROCESS,//18
longpanda's avatar
longpanda committed
50

longpanda's avatar
longpanda committed
51
52
	STR_MENU_OPTION,//19
	STR_MENU_SECURE_BOOT,//20
longpanda's avatar
longpanda committed
53

longpanda's avatar
longpanda committed
54
55
56
57
58
59
    STR_MENU_PART_CFG,//21
    STR_BTN_OK,//22
    STR_BTN_CANCEL,//23
    STR_PRESERVE_SPACE,//24
	STR_SPACE_VAL_INVALID,//25

longpanda's avatar
update  
longpanda committed
60
61
62
63
    STR_MENU_CLEAR, //26
    STR_CLEAR_SUCCESS, //27
    STR_CLEAR_FAILED, //28

longpanda's avatar
longpanda committed
64
	STR_ID_MAX
longpanda's avatar
longpanda committed
65
66
}STR_ID;

longpanda's avatar
longpanda committed
67
68
69
extern BOOL g_SecureBoot;

#define VTOY_MENU_SECURE_BOOT	  0xA000
longpanda's avatar
longpanda committed
70
#define VTOY_MENU_PART_CFG        0xA001
longpanda's avatar
update  
longpanda committed
71
#define VTOY_MENU_CLEAN           0xA002
longpanda's avatar
longpanda committed
72
73
74
75
#define VTOY_MENU_LANGUAGE_BEGIN  0xB000


#define VENTOY_LANGUAGE_INI  TEXT(".\\ventoy\\languages.ini")
longpanda's avatar
longpanda committed
76
77
#define VENTOY_CFG_INI     TEXT(".\\Ventoy2Disk.ini")
#define VENTOY_CFG_INI_A   ".\\Ventoy2Disk.ini"
longpanda's avatar
longpanda committed
78
79
#define VENTOY_MAX_LANGUAGE	 200

80
#define GET_INI_STRING(Section, Key, Buf) GetPrivateProfileString(Section, Key, TEXT("#"), Buf, sizeof(Buf), VENTOY_LANGUAGE_INI)
longpanda's avatar
longpanda committed
81
82
83

typedef struct VENTOY_LANGUAGE
{
84
	WCHAR Name[128];
longpanda's avatar
longpanda committed
85
86
87
88
89
90
91
92
93
94
	WCHAR FontFamily[64];
	int FontSize;

	WCHAR StrId[STR_ID_MAX][64];
	WCHAR MsgString[STR_ID_MAX][1024];

}VENTOY_LANGUAGE;

extern VENTOY_LANGUAGE *g_cur_lang_data;

longpanda's avatar
longpanda committed
95
96
97
98
99
const TCHAR * GetString(enum STR_ID ID);

#define _G(a) GetString(a)

#endif