forked from mebjas/html5-qrcode
-
Notifications
You must be signed in to change notification settings - Fork 0
/
strings.ts
138 lines (111 loc) · 3.39 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
/**
* @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.";
}
}
/**
* 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 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";
}
}
/** Strings used in {@class LibraryInfoDiv} */
export class LibraryInfoStrings {
public static builtUsing(): string {
return "Built using ";
}
public static reportIssues(): string {
return "Report issues";
}
}