forked from mebjas/html5-qrcode
-
Notifications
You must be signed in to change notification settings - Fork 0
/
strings.ts
200 lines (158 loc) · 4.84 KB
/
strings.ts
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
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
/**
* @fileoverview
* Strings used by {@class Html5Qrcode} & {@class Html5QrcodeScanner}
*
* @author mebjas <[email protected]>
*
* The word "QR Code" is registered trademark of DENSO WAVE INCORPORATED
* http://www.denso-wave.com/qrcode/faqpatent-e.html
*/
/**
* Strings used in {@class Html5Qrcode}.
*
* TODO(mebjas): Support internalization.
*/
export class Html5QrcodeStrings {
public static codeParseError(exception: any): string {
return `QR code parse error, error = ${exception}`;
}
public static errorGettingUserMedia(error: any): string {
return `Error getting userMedia, error = ${error}`;
}
public static onlyDeviceSupportedError(): string {
return "The device doesn't support navigator.mediaDevices , only "
+ "supported cameraIdOrConfig in this case is deviceId parameter "
+ "(string).";
}
public static cameraStreamingNotSupported(): string {
return "Camera streaming not supported by the browser.";
}
public static unableToQuerySupportedDevices(): string {
return "Unable to query supported devices, unknown error.";
}
public static insecureContextCameraQueryError(): string {
return "Camera access is only supported in secure context like https "
+ "or localhost.";
}
public static scannerPaused(): string {
return "Scanner paused";
}
}
/**
* Strings used in {@class Html5QrcodeScanner}.
*
* TODO(mebjas): Support internalization.
*/
export class Html5QrcodeScannerStrings {
public static scanningStatus(): string {
return "Scanning";
}
public static idleStatus(): string {
return "Idle";
}
public static errorStatus(): string {
return "Error";
}
public static permissionStatus(): string {
return "Permission";
}
public static noCameraFoundErrorStatus(): string {
return "No Cameras";
}
public static lastMatch(decodedText: string): string {
return `Last Match: ${decodedText}`;
}
public static codeScannerTitle(): string {
return "Code Scanner";
}
public static cameraPermissionTitle(): string {
return "Request Camera Permissions";
}
public static cameraPermissionRequesting(): string {
return "Requesting camera permissions...";
}
public static noCameraFound(): string {
return "No camera found";
}
public static scanButtonStopScanningText(): string {
return "Stop Scanning";
}
public static scanButtonStartScanningText(): string {
return "Start Scanning";
}
public static torchOnButton(): string {
return "Switch On Torch";
}
public static torchOffButton(): string {
return "Switch Off Torch";
}
public static torchOnFailedMessage(): string {
return "Failed to turn on torch";
}
public static torchOffFailedMessage(): string {
return "Failed to turn off torch";
}
public static scanButtonScanningStarting(): string {
return "Launching Camera...";
}
/**
* Text to show when camera scan is selected.
*
* This will be used to switch to file based scanning.
*/
public static textIfCameraScanSelected(): string {
return "Scan an Image File";
}
/**
* Text to show when file based scan is selected.
*
* This will be used to switch to camera based scanning.
*/
public static textIfFileScanSelected(): string {
return "Scan using camera directly";
}
public static selectCamera(): string {
return "Select Camera";
}
public static fileSelectionChooseImage(): string {
return "Choose Image";
}
public static fileSelectionChooseAnother(): string {
return "Choose Another";
}
public static fileSelectionNoImageSelected(): string {
return "No image choosen";
}
/** Prefix to be given to anonymous cameras. */
public static anonymousCameraPrefix(): string {
return "Anonymous Camera";
}
public static dragAndDropMessage(): string {
return "Or drop an image to scan";
}
public static dragAndDropMessageOnlyImages(): string {
return "Or drop an image to scan (other files not supported)";
}
/** Value for zoom. */
public static zoom(): string {
return "zoom";
}
public static loadingImage(): string {
return "Loading image...";
}
public static cameraScanAltText(): string {
return "Camera based scan";
}
public static fileScanAltText(): string {
return "Fule based scan";
}
}
/** Strings used in {@class LibraryInfoDiv} */
export class LibraryInfoStrings {
public static poweredBy(): string {
return "Powered by ";
}
public static reportIssues(): string {
return "Report issues";
}
}