]> glassweightruler.freedombox.rocks Git - Ventoy.git/blob - Ventoy2Disk/Ventoy2Disk/Language.h
Update issue_template.yml
[Ventoy.git] / Ventoy2Disk / Ventoy2Disk / Language.h
1 /******************************************************************************
2 * Language.h
3 *
4 * Copyright (c) 2020, longpanda <admin@ventoy.net>
5 *
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public License as
8 * published by the Free Software Foundation; either version 3 of the
9 * License, or (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful, but
12 * WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, see <http://www.gnu.org/licenses/>.
18 *
19 */
20
21 #ifndef __LANGUAGE_H__
22 #define __LANGUAGE_H__
23
24
25 typedef enum STR_ID
26 {
27 STR_ERROR = 0,
28 STR_WARNING, // 1
29 STR_INFO, // 2
30 STR_INCORRECT_DIR, //3
31 STR_INCORRECT_TREE_DIR, //4
32
33 STR_DEVICE, //5
34 STR_LOCAL_VER, //6
35 STR_DISK_VER, //7
36 STR_STATUS, //8
37 STR_INSTALL, //9
38 STR_UPDATE, //10
39
40 STR_UPDATE_TIP, //11
41 STR_INSTALL_TIP, //12
42 STR_INSTALL_TIP2,//13
43
44 STR_INSTALL_SUCCESS,//14
45 STR_INSTALL_FAILED,//15
46 STR_UPDATE_SUCCESS,//16
47 STR_UPDATE_FAILED,//17
48
49 STR_WAIT_PROCESS,//18
50
51 STR_MENU_OPTION,//19
52 STR_MENU_SECURE_BOOT,//20
53
54 STR_MENU_PART_CFG,//21
55 STR_BTN_OK,//22
56 STR_BTN_CANCEL,//23
57 STR_PRESERVE_SPACE,//24
58 STR_SPACE_VAL_INVALID,//25
59
60 STR_MENU_CLEAR, //26
61 STR_CLEAR_SUCCESS, //27
62 STR_CLEAR_FAILED, //28
63 STR_MENU_PART_STYLE, //29
64 STR_DISK_2TB_MBR_ERROR,//30
65
66 STR_SHOW_ALL_DEV, //31
67 STR_PART_ALIGN_4KB, //32
68 STR_WEB_COMMUNICATION_ERR, //33
69 STR_WEB_REMOTE_ABNORMAL, //34
70 STR_WEB_REQUEST_TIMEOUT, //35
71 STR_WEB_SERVICE_UNAVAILABLE, //36
72 STR_WEB_TOKEN_MISMATCH, //37
73 STR_WEB_SERVICE_BUSY, //38
74
75 STR_MENU_VTSI_CREATE, //39
76 STR_VTSI_CREATE_TIP, //40
77 STR_VTSI_CREATE_SUCCESS, //41
78 STR_VTSI_CREATE_FAILED, //42
79
80 STR_ID_MAX
81 }STR_ID;
82
83 extern BOOL g_SecureBoot;
84
85 #define VTOY_MENU_SECURE_BOOT 0xA000
86 #define VTOY_MENU_PART_CFG 0xA001
87 #define VTOY_MENU_CLEAN 0xA002
88 #define VTOY_MENU_PART_STYLE 0xA003
89 #define VTOY_MENU_PART_MBR 0xA004
90 #define VTOY_MENU_PART_GPT 0xA005
91 #define VTOY_MENU_ALL_DEV 0xA006
92 #define VTOY_MENU_VTSI 0xA007
93
94
95 typedef enum OPT_SUBMENU
96 {
97 OPT_SUBMENU_SECURE_BOOT = 0,
98 OPT_SUBMENU_PART_STYLE,
99 OPT_SUBMENU_PART_CFG,
100 OPT_SUBMENU_CLEAR,
101 OPT_SUBMENU_ALL_DEV,
102 OPT_SUBMENU_VTSI,
103
104 OPT_SUBMENU_MAX
105 }OPT_SUBMENU;
106
107
108 #define VTOY_MENU_LANGUAGE_BEGIN 0xB000
109
110
111 #define VENTOY_LANGUAGE_INI TEXT(".\\ventoy\\languages.ini")
112 #define VENTOY_LANGUAGE_JSON TEXT(".\\ventoy\\languages.json")
113 #define VENTOY_LANGUAGE_INI_A ".\\ventoy\\languages.ini"
114 #define VENTOY_LANGUAGE_JSON_A ".\\ventoy\\languages.json"
115
116 #define VENTOY_CFG_INI TEXT(".\\Ventoy2Disk.ini")
117 #define VENTOY_CFG_INI_A ".\\Ventoy2Disk.ini"
118 #define VENTOY_MAX_LANGUAGE 200
119
120 #define GET_INI_STRING(Section, Key, Buf) GetPrivateProfileString(Section, Key, TEXT("#"), Buf, sizeof(Buf), VENTOY_LANGUAGE_INI)
121
122
123
124 typedef struct VENTOY_LANGUAGE
125 {
126 WCHAR Name[128];
127 WCHAR FontFamily[64];
128 int FontSize;
129
130 WCHAR StrId[STR_ID_MAX][64];
131 WCHAR MsgString[STR_ID_MAX][1024];
132
133 }VENTOY_LANGUAGE;
134
135 extern VENTOY_LANGUAGE *g_cur_lang_data;
136
137 const TCHAR * GetString(enum STR_ID ID);
138
139 #define _G(a) GetString(a)
140
141 typedef enum UNICODE_ICON
142 {
143 UNICODE_LOCK = 0,
144 UNICODE_BUTT
145 }UNICODE_ICON;
146
147 const UINT16 * GetUnicodeIcon(icon);
148 #define _UICON(i) GetUnicodeIcon(i)
149
150 #endif