@tolgee/cli 1.1.1 → 1.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -10,7 +10,7 @@ export default createMachine({
|
|
10
10
|
children: '',
|
11
11
|
line: 0,
|
12
12
|
key: VOID_KEY,
|
13
|
-
|
13
|
+
getTranslate: null,
|
14
14
|
ignore: null,
|
15
15
|
keys: [],
|
16
16
|
warnings: [],
|
@@ -64,7 +64,7 @@ export default createMachine({
|
|
64
64
|
},
|
65
65
|
},
|
66
66
|
},
|
67
|
-
|
67
|
+
getTranslate: {
|
68
68
|
initial: 'idle',
|
69
69
|
states: {
|
70
70
|
idle: {
|
@@ -72,7 +72,7 @@ export default createMachine({
|
|
72
72
|
'entity.name.function.ts': {
|
73
73
|
target: 'func',
|
74
74
|
actions: 'storeLine',
|
75
|
-
cond: (_ctx, evt) => evt.token === '
|
75
|
+
cond: (_ctx, evt) => evt.token === 'getTranslate',
|
76
76
|
},
|
77
77
|
},
|
78
78
|
},
|
@@ -103,12 +103,12 @@ export default createMachine({
|
|
103
103
|
'punctuation.definition.string.template.begin.ts': 'namespace',
|
104
104
|
'variable.other.readwrite.ts': {
|
105
105
|
target: 'idle',
|
106
|
-
actions: ['
|
106
|
+
actions: ['storeGetTranslate', 'markGetTranslateAsDynamic'],
|
107
107
|
},
|
108
108
|
'meta.brace.round.ts': {
|
109
109
|
target: 'idle',
|
110
110
|
cond: (_ctx, evt) => evt.token === ')',
|
111
|
-
actions: '
|
111
|
+
actions: 'storeGetTranslate',
|
112
112
|
},
|
113
113
|
},
|
114
114
|
},
|
@@ -116,7 +116,7 @@ export default createMachine({
|
|
116
116
|
on: {
|
117
117
|
'*': {
|
118
118
|
target: 'namespace_end',
|
119
|
-
actions: '
|
119
|
+
actions: 'storeNamespacedGetTranslate',
|
120
120
|
},
|
121
121
|
},
|
122
122
|
},
|
@@ -126,11 +126,11 @@ export default createMachine({
|
|
126
126
|
'meta.brace.round.ts': 'idle',
|
127
127
|
'punctuation.definition.template-expression.begin.ts': {
|
128
128
|
target: 'idle',
|
129
|
-
actions: '
|
129
|
+
actions: 'markGetTranslateAsDynamic',
|
130
130
|
},
|
131
131
|
'keyword.operator.arithmetic.ts': {
|
132
132
|
target: 'idle',
|
133
|
-
actions: '
|
133
|
+
actions: 'markGetTranslateAsDynamic',
|
134
134
|
},
|
135
135
|
},
|
136
136
|
},
|
@@ -204,7 +204,7 @@ export default createMachine({
|
|
204
204
|
on: {
|
205
205
|
'punctuation.definition.variable.svelte': {
|
206
206
|
target: 'dollar',
|
207
|
-
cond: (ctx, evt) => ctx.
|
207
|
+
cond: (ctx, evt) => ctx.getTranslate !== null && evt.token === '$',
|
208
208
|
},
|
209
209
|
},
|
210
210
|
},
|
@@ -368,14 +368,14 @@ export default createMachine({
|
|
368
368
|
{ warning: 'W_UNUSED_IGNORE', line: evt.line - 1 },
|
369
369
|
],
|
370
370
|
}),
|
371
|
-
|
372
|
-
|
371
|
+
storeGetTranslate: assign({
|
372
|
+
getTranslate: (_ctx, _evt) => '',
|
373
373
|
}),
|
374
|
-
|
375
|
-
|
374
|
+
storeNamespacedGetTranslate: assign({
|
375
|
+
getTranslate: (_ctx, evt) => evt.token,
|
376
376
|
}),
|
377
|
-
|
378
|
-
|
377
|
+
markGetTranslateAsDynamic: assign({
|
378
|
+
getTranslate: (_ctx, _evt) => false,
|
379
379
|
warnings: (ctx, _evt) => [
|
380
380
|
...ctx.warnings,
|
381
381
|
{ warning: 'W_DYNAMIC_NAMESPACE', line: ctx.line },
|
@@ -418,7 +418,7 @@ export default createMachine({
|
|
418
418
|
storeKeyCurrentNamespace: assign({
|
419
419
|
key: (ctx, _evt) => ({
|
420
420
|
...ctx.key,
|
421
|
-
namespace: ctx.
|
421
|
+
namespace: ctx.getTranslate !== null ? ctx.getTranslate : undefined,
|
422
422
|
}),
|
423
423
|
}),
|
424
424
|
dynamicKeyName: assign({
|