Skip to content

Commit f365d4e

Browse files
committed
move export 104 translations and references to avoid overwriting
Signed-off-by: Nora Blomaard <[email protected]>
1 parent b80d4b2 commit f365d4e

File tree

5 files changed

+44
-48
lines changed

5 files changed

+44
-48
lines changed

packages/compas-open-scd/src/translations/de.ts

Lines changed: 17 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,6 @@
11
import { Translations } from './loader.js';
22

33
export const de: Translations = {
4-
protocol104: {
5-
export: {
6-
noSignalsFound: 'Export 104 hat keine Signale gefunden',
7-
invalidSignalWarning: 'Export 104 hat ein ungültiges Signal gefunden',
8-
errors: {
9-
tiOrIoaInvalid:
10-
'ti or ioa fehlen oder ioa hat weniger als 4 Zeichen, ti: "{{ ti }}", ioa: "{{ ioa }}"',
11-
unknownSignalType:
12-
'Unbekannter Signaltyp für ti: "{{ ti }}", ioa: "{{ ioa }}"',
13-
noDoi: 'Es wurde kein Eltern DOI Element gefunden für ioa: "{{ ioa }}"',
14-
noBay:
15-
'Es wurde kein Bay Element mit dem Namen "{{ bayName }}" für ioa: "{{ ioa }}" gefunden',
16-
noVoltageLevel:
17-
'Es wurde kein VoltageLevel Element für Bay "{{ bayName }}" gefunden für ioa "{{ ioa }}"',
18-
noSubstation:
19-
'Es wurde kein Substation Element gefunden für VoltageLevel "{{ voltageLevelName }}" für ioa "{{ ioa }}"',
20-
},
21-
},
22-
},
234
userinfo: {
245
loggedInAs: '???',
256
},
@@ -156,6 +137,23 @@ export const de: Translations = {
156137
bayAmount: '???',
157138
substationGen: '???',
158139
},
140+
export104: {
141+
noSignalsFound: 'Export 104 hat keine Signale gefunden',
142+
invalidSignalWarning: 'Export 104 hat ein ungültiges Signal gefunden',
143+
errors: {
144+
tiOrIoaInvalid:
145+
'ti or ioa fehlen oder ioa hat weniger als 4 Zeichen, ti: "{{ ti }}", ioa: "{{ ioa }}"',
146+
unknownSignalType:
147+
'Unbekannter Signaltyp für ti: "{{ ti }}", ioa: "{{ ioa }}"',
148+
noDoi: 'Es wurde kein Eltern DOI Element gefunden für ioa: "{{ ioa }}"',
149+
noBay:
150+
'Es wurde kein Bay Element mit dem Namen "{{ bayName }}" für ioa: "{{ ioa }}" gefunden',
151+
noVoltageLevel:
152+
'Es wurde kein VoltageLevel Element für Bay "{{ bayName }}" gefunden für ioa "{{ ioa }}"',
153+
noSubstation:
154+
'Es wurde kein Substation Element gefunden für VoltageLevel "{{ voltageLevelName }}" für ioa "{{ ioa }}"',
155+
},
156+
},
159157
},
160158
locamation: {
161159
vmu: {

packages/compas-open-scd/src/translations/en.ts

Lines changed: 17 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,4 @@
11
export const en = {
2-
protocol104: {
3-
export: {
4-
noSignalsFound: 'Export 104 found no signals',
5-
invalidSignalWarning: 'Export 104 found invalid signal',
6-
errors: {
7-
tiOrIoaInvalid:
8-
'ti or ioa are missing or ioa is less than 4 digits, ti: "{{ ti }}", ioa: "{{ ioa }}"',
9-
unknownSignalType:
10-
'Unknown signal type for ti: "{{ ti }}", ioa: "{{ ioa }}"',
11-
noDoi: 'No parent DOI found for address with ioa: "{{ ioa }}"',
12-
noBay:
13-
'No Bay found bayname: "{{ bayName }}" for address with ioa: "{{ ioa }}"',
14-
noVoltageLevel:
15-
'No parent voltage level found for bay "{{ bayName }}" for ioa "{{ ioa }}"',
16-
noSubstation:
17-
'No parent substation found for voltage level "{{ voltageLevelName }}" for ioa "{{ ioa }}"',
18-
},
19-
},
20-
},
212
userinfo: {
223
loggedInAs: 'Logged in as {{name}}',
234
},
@@ -165,6 +146,23 @@ export const en = {
165146
bayAmount: `Generating {{amount}} Bay Element(s) for {{voltagelevelname}} Voltage Level!`,
166147
substationGen: `Generated {{substationname}} substation with content!`,
167148
},
149+
export104: {
150+
noSignalsFound: 'Export 104 found no signals',
151+
invalidSignalWarning: 'Export 104 found invalid signal',
152+
errors: {
153+
tiOrIoaInvalid:
154+
'ti or ioa are missing or ioa is less than 4 digits, ti: "{{ ti }}", ioa: "{{ ioa }}"',
155+
unknownSignalType:
156+
'Unknown signal type for ti: "{{ ti }}", ioa: "{{ ioa }}"',
157+
noDoi: 'No parent DOI found for address with ioa: "{{ ioa }}"',
158+
noBay:
159+
'No Bay found bayname: "{{ bayName }}" for address with ioa: "{{ ioa }}"',
160+
noVoltageLevel:
161+
'No parent voltage level found for bay "{{ bayName }}" for ioa "{{ ioa }}"',
162+
noSubstation:
163+
'No parent substation found for voltage level "{{ voltageLevelName }}" for ioa "{{ ioa }}"',
164+
},
165+
},
168166
},
169167
locamation: {
170168
vmu: {

packages/plugins/src/menu/Export104.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ export default class Export104 extends LitElement {
2727
if (signals.length === 0) {
2828
this.dispatchEvent(newLogEvent({
2929
kind: 'info',
30-
title: get('protocol104.export.noSignalsFound'),
30+
title: get('compas.export104.noSignalsFound'),
3131
}));
3232
return;
3333
}
@@ -48,7 +48,7 @@ export default class Export104 extends LitElement {
4848
private logWarning(errorMessage: string): void {
4949
this.dispatchEvent(newLogEvent({
5050
kind: 'warning',
51-
title: get('protocol104.export.invalidSignalWarning'),
51+
title: get('compas.export104.invalidSignalWarning'),
5252
message: errorMessage,
5353
}));
5454
}

packages/plugins/src/menu/export104/foundation.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -47,21 +47,21 @@ function extractSignal104Data(addressElement: Element, doc: XMLDocument): Extrac
4747

4848
// By convention the last four digits of the ioa are the signalnumber, see https://github.com/com-pas/compas-open-scd/issues/334
4949
if (ti === null || ioa === null || ioa.length < 4) {
50-
return { signal: null, error: get('protocol104.export.errors.tiOrIoaInvalid', { ti: ti ?? '', ioa: ioa ?? '' }) };
50+
return { signal: null, error: get('compas.export104.errors.tiOrIoaInvalid', { ti: ti ?? '', ioa: ioa ?? '' }) };
5151
}
5252
const { signalNumber, bayName } = splitIoa(ioa);
5353

5454
const signalType = getSignalType(ti);
5555
if (signalType === SignalType.Unknown) {
56-
return { signal: null, error: get('protocol104.export.errors.unknownSignalType', { ti: ti ?? '', ioa: ioa ?? '' }) };
56+
return { signal: null, error: get('compas.export104.errors.unknownSignalType', { ti: ti ?? '', ioa: ioa ?? '' }) };
5757
}
5858
const isMonitorSignal = signalType === SignalType.Monitor;
5959

6060
addressElement.parentElement;
6161
const parentDOI = addressElement.closest('DOI');
6262

6363
if (!parentDOI) {
64-
return { signal: null, error: get('protocol104.export.errors.noDoi', { ioa: ioa ?? '' }) };
64+
return { signal: null, error: get('compas.export104.errors.noDoi', { ioa: ioa ?? '' }) };
6565
}
6666

6767
const doiDesc = parentDOI.getAttribute('desc');
@@ -70,20 +70,20 @@ function extractSignal104Data(addressElement: Element, doc: XMLDocument): Extrac
7070
const parentBay = doc.querySelector(parentBayQuery);
7171

7272
if (!parentBay) {
73-
return { signal: null, error: get('protocol104.export.errors.noBay', { bayName, ioa: ioa ?? '' }) };
73+
return { signal: null, error: get('compas.export104.errors.noBay', { bayName, ioa: ioa ?? '' }) };
7474
}
7575

7676
const parentVoltageLevel = parentBay.closest('VoltageLevel');
7777

7878
if (!parentVoltageLevel) {
79-
return { signal: null, error: get('protocol104.export.errors.noVoltageLevel', { bayName, ioa: ioa ?? '' }) };
79+
return { signal: null, error: get('compas.export104.errors.noVoltageLevel', { bayName, ioa: ioa ?? '' }) };
8080
}
8181

8282
const voltageLevelName = parentVoltageLevel.getAttribute('name');
8383
const parentSubstation = parentVoltageLevel.closest('Substation');
8484

8585
if (!parentSubstation) {
86-
return { signal: null, error: get('protocol104.export.errors.noSubstation', { voltageLevelName: voltageLevelName ?? '', ioa: ioa ?? '' }) };
86+
return { signal: null, error: get('compas.export104.errors.noSubstation', { voltageLevelName: voltageLevelName ?? '', ioa: ioa ?? '' }) };
8787
}
8888

8989
const substationName = parentSubstation.getAttribute('name');

packages/plugins/test/unit/menu/104Export/foundation.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,8 @@ describe('Export104 foundation', () => {
5353
];
5454

5555
const expectedErrors = [
56-
'[protocol104.export.errors.unknownSignalType]',
57-
'[protocol104.export.errors.tiOrIoaInvalid]',
56+
'[compas.export104.errors.unknownSignalType]',
57+
'[compas.export104.errors.tiOrIoaInvalid]',
5858
];
5959

6060
expect(errors).to.deep.equal(expectedErrors);

0 commit comments

Comments
 (0)