@@ -4,6 +4,47 @@ const apModule02 = require("./AlgopropCompiler02")
4
4
const commonModule = require ( "./common_1_0" )
5
5
const smModule = require ( "./sm_1_0" )
6
6
7
+
8
+ const strings = {
9
+ "ERR_ALGOPROP_CANNOT_BE_ARGUMENT" : "HL1000: Cannot use the name of an algoprop as a function argument or exception handler argument" ,
10
+ "ERR_ALGOPROP_CANNOT_BE_IN_CLASS" : "HL1001: Algoprops are not allowed as class members" ,
11
+ "ERR_ARGUMENTS_NOT_ALLOWED_IN_ALGOPROPS" : "HL1002: Function arguments are not allowed in algoprops" ,
12
+ "ERR_AWAIT_REQUIRES_ASYNC_FUNCTION" : "HL1003: await expressions are only allowed in async functions" ,
13
+ "ERR_BAD_FOREACH" : "HL1004: Bad format inside the FOREACH icon" ,
14
+ "ERR_BAD_HANDLER_FORMAT" : "HL1005: Bad handler format" ,
15
+ "ERR_BAD_VARIABLE_NAME" : "HL1006: Forbidden variable name" ,
16
+ "ERR_BRANCH_NOT_FOUND" : "HL1007: Branch not found" ,
17
+ "ERR_BRANCH_NOT_REFERENCED" : "HL1008: Branch not referenced" ,
18
+ "ERR_CALL_EXPRESSION_EXPECTED" : "HL1009: Call expression expected" ,
19
+ "ERR_CANNOT_ASSIGN_TO_ALGOPROP" : "HL1010: Cannot assign to an algoprop" ,
20
+ "ERR_CANNOT_USE_GETHANDLER_OUTSIDE_HANDLER" : "HL1011: Cannot use getHandlerData() outside of a handler" ,
21
+ "ERR_CLASS_NAME_NOT_UNIQUE" : "HL1012: Class name is not unique" ,
22
+ "ERR_DUPLICATE_DIAGRAM_NAME" : "HL1013: Diagram name is not unique" ,
23
+ "ERR_EXPRESSION_EXPECTED" : "HL1014: Expression expected" ,
24
+ "ERR_FUNCTION_NAME_AND_ARGUMENTS_EXPECTED" : "HL1015: Function name and arguments expected" ,
25
+ "ERR_INCONSISTENT_EVENT_SIGNATURE" : "HL1016: Inconsistent event signature" ,
26
+ "ERR_INPUT_IS_NOT_ALLOWED_IN_NORMAL_FUNCTIONS" : "HL1017: Input icons are only allowed in async functions" ,
27
+ "ERR_NO_EXIT" : "HL1018: The diagram has no end" ,
28
+ "ERR_NO_TEXT_IN_FOREACH" : "HL1019: A FOREACH icon cannot be empty" ,
29
+ "ERR_NOT_ALL_PATHS_RETURN_A_VALUE" : "HL1020: Not all paths return a value" ,
30
+ "ERR_ONE_FUNCTION_CALL_EXPECTED" : "HL1021: One function call expected" ,
31
+ "ERR_ONLY_ASYNC_FUNCTIONS_CAN_HAVE_ON_ERROR" : "HL1022: Only async functions can have \"on error\" handler" ,
32
+ "ERR_ONLY_LAST_CASE_CAN_BE_EMPTY" : "HL1023: Only the last Case icon can be empty" ,
33
+ "ERR_PAUSE_IS_NOT_ALLOWED_IN_NORMAL_FUNCTIONS" : "HL1024: Pause icons are only allowed in async functions" ,
34
+ "ERR_RECEIVE_IS_NOT_ALLOWED_IN_NORMAL_FUNCTIONS" : "HL1025: receive construct is only allowed in async functions" ,
35
+ "ERR_THIS_KEYWORD_IS_NOT_ALLOWED" : "HL1026: This keyword is not allowed" ,
36
+ "ERR_VALUE_EXPECTED" : "HL1027: Value expected" ,
37
+ "ERR_VARIABLE_DECLARATIONS_ARE_NOT_ALLOWED" : "HL1028: Variable declarations are not allowed" ,
38
+ }
39
+
40
+ function translate ( text ) {
41
+ var translated = strings [ text ]
42
+ if ( translated ) {
43
+ return translated
44
+ }
45
+ return text
46
+ }
47
+
7
48
function buildHolo ( record , getFromDt ) {
8
49
return buildHoloCore ( record , getFromDt , apModule )
9
50
}
@@ -15,6 +56,7 @@ function buildHolo02(record, getFromDt) {
15
56
function buildHoloCore ( record , getFromDt , apMod ) {
16
57
return new Promise ( function ( resolve ) {
17
58
var ap = apMod ( )
59
+ ap . translate = translate
18
60
var common = commonModule ( )
19
61
var sm = smModule ( )
20
62
var http = {
0 commit comments