-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtranslator.cpp
136 lines (116 loc) · 7.75 KB
/
translator.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
#include "translator.h"
#include <QDebug>
Translator::Translator(){
/* Menus */
translator.insert(pair<string, string>("開新檔案", "New File"));
translator.insert(pair<string, string>("開啟舊檔", "Load File" ));
translator.insert(pair<string, string>("儲存檔案", "Save" ));
translator.insert(pair<string, string>("另存新檔", "Save As" ));
translator.insert(pair<string, string>("加入新客戶", "Add Customer" ));
translator.insert(pair<string, string>("加入新公司", "Add Company" ));
translator.insert(pair<string, string>("加入新的菜名", "Add Vegetable" ));
translator.insert(pair<string, string>("加入單位", "Add Unit" ));
translator.insert(pair<string, string>("刪除客戶", "Delete Customer" ));
translator.insert(pair<string, string>("刪除公司", "Delete Company" ));
translator.insert(pair<string, string>("刪掉菜名", "Delete Vegetable" ));
translator.insert(pair<string, string>("刪掉單位", "Delete Unit" ));
translator.insert(pair<string, string>("印 Inventory", "Print Inventory" ));
translator.insert(pair<string, string>("印 記錄表", "Print Today's Transactions" ));
translator.insert(pair<string, string>("印 History", "Print History" ));
/* User Interface */
translator.insert(pair<string, string>("買", "Buy" ));
translator.insert(pair<string, string>("賣", "Sell" ));
translator.insert(pair<string, string>("菜名", "Vegetable List" ));
translator.insert(pair<string, string>("菜名子", "Vegetable" ));
translator.insert(pair<string, string>("庫存表", "Breakdown" ));
translator.insert(pair<string, string>("倒", "Dump" ));
translator.insert(pair<string, string>("退貨", "Return" ));
translator.insert(pair<string, string>("歷史", "History" ));
translator.insert(pair<string, string>("退貨單", "Returns" ));
translator.insert(pair<string, string>("清掉退貨單", "Clear Return" ));
translator.insert(pair<string, string>("清掉歷史", "Clear History" ));
translator.insert(pair<string, string>("退給公司", "Return to Company" ));
translator.insert(pair<string, string>("退給農場", "Customer Returned" ));
translator.insert(pair<string, string>("簡寫", "Abbreviation" ));
/* Menu Popups */
translator.insert(pair<string, string>("請輸入你要加的新公司名字", "Company" ));
translator.insert(pair<string, string>("請輸入你要加的新客戶名字", "Customer" ));
translator.insert(pair<string, string>("請輸入你要加的單位", "Unit" ));
translator.insert(pair<string, string>("請輸入你要加的菜名", "Vegetable" ));
translator.insert(pair<string, string>("你要刪掉哪一個公司?", "Company" ));
translator.insert(pair<string, string>("你要刪掉哪一個客戶?", "Customer" ));
translator.insert(pair<string, string>("你要刪掉哪一個單位?", "Unit" ));
translator.insert(pair<string, string>("你要刪掉哪一個菜名?", "Vegetable" ));
translator.insert(pair<string, string>("沒單位!", "No Units!" ));
translator.insert(pair<string, string>("警告", "Warning" ));
translator.insert(pair<string, string>("請輸入字體大小", "Font Size"));
translator.insert(pair<string, string>("你要列印哪一天的日期?", "Date" ));
/* On Buy Click */
translator.insert(pair<string, string>("輸入進菜資料", "Buying Information" ));
translator.insert(pair<string, string>("買了多少?", "Amount" ));
translator.insert(pair<string, string>("哪家公司的?", "Company" ));
translator.insert(pair<string, string>("幾號來的菜?", "Date" ));
translator.insert(pair<string, string>("進價多少?", "Price" ));
translator.insert(pair<string, string>("錯誤", "Error" ));
/* On Sell Click */
translator.insert(pair<string, string>("輸入賣菜資料", "Selling Information" ));
translator.insert(pair<string, string>("賣了多少?", "Amount Sold" ));
translator.insert(pair<string, string>("不夠賣!", "Not Enough to Sell!" ));
translator.insert(pair<string, string>("賣给谁?", "Customer" ));
translator.insert(pair<string, string>("那天賣出", "Date" ));
translator.insert(pair<string, string>("你要賣那天的菜?", "In Stock" ));
translator.insert(pair<string, string>("聯合賣", "Split" ));
translator.insert(pair<string, string>("賣多少錢?", "Price" ));
translator.insert(pair<string, string>("菜不足,繼續買另外一天的菜?",
"Not Enough Vegetables, Sell Remaining on Another Day?" ));
translator.insert(pair<string, string>("聯合數字錯誤!", "Not Valid" ));
translator.insert(pair<string, string>("不夠賣!", "Not Enough to Sell" ));
/* Query Splits */
translator.insert(pair<string, string>("你要幾家公司聯合? (最多4家)",
"How Many Splits? (Max 4)" ));
translator.insert(pair<string, string>("聯合賣", "Split Sell" ));
translator.insert(pair<string, string>("輸入的數量不一樣!", "Numbers Do Not Sum Up to Total!" ));
translator.insert(pair<string, string>("輸入的數量太多!", "Not Enough to Sell!" ));
/* On Return Click */
translator.insert(pair<string, string>("退還給公司的菜", "Returned to Us" ));
translator.insert(pair<string, string>("退幾箱?", "Amount" ));
translator.insert(pair<string, string>("誰退回來的?", "Customer" ));
translator.insert(pair<string, string>("这是哪天退回來的", "Date" ));
translator.insert(pair<string, string>("这是哪家公司的菜?", "Company" ));
translator.insert(pair<string, string>("这是哪天買的菜?", "Original Date of Vegetable" ));
translator.insert(pair<string, string>("退還給農場的菜", "Return to Company" ));
translator.insert(pair<string, string>("輸入退菜資料", "Return Information" ));
translator.insert(pair<string, string>("你要退那天的菜?", "Return Which Item?" ));
translator.insert(pair<string, string>("不夠菜退!", "Not Enough to Return!" ));
translator.insert(pair<string, string>("你要儲存嗎?", "Do You Want To Save?"));
/* Dump */
translator.insert(pair<string, string>("倒", "Dump" ));
translator.insert(pair<string, string>("你要倒那天的菜?", "In Stock" ));
translator.insert(pair<string, string>("倒幾箱?", "Amount" ));
translator.insert(pair<string, string>("全部", "All" ));
translator.insert(pair<string, string>("不夠數量倒!", "Not Enough to Dump!" ));
translator.insert(pair<string, string>("你確定你要倒掉全部嗎?",
"Are You Sure You Want to Dump All?" ));
/* Delete/Undo History */
translator.insert(pair<string, string>("你要打勾所有的選項才能undo!",
"You Must Check All Boxes to Undo!" ));
translator.insert(pair<string, string>("你要打勾所有的選項才能edit!",
"You Must Check All Boxes to Edit!" ));
translator.insert(pair<string, string>("你確定你要刪掉全部嗎?",
"Are You Sure You Want to Delete All?" ));
translator.insert(pair<string, string>("刪掉歷史", "Delete History" ));
translator.insert(pair<string, string>("刪掉多少?", "Delete How Many?" ));
translator.insert(pair<string, string>("不夠數量刪除!", "Not Enough to Delete!" ));
translator.insert(pair<string, string>("", "" ));
currentLanguage = CHINESE;
}
Translator::~Translator(){
}
string Translator::translate(string input){
if(currentLanguage == CHINESE)
return input;
return translator.find(input) -> second;
}
void Translator::changeLanguage(int i){
currentLanguage = i;
}