Skip to content

Commit 3a857f4

Browse files
authored
Merge pull request #796 from Speech-Rule-Engine/fix/worker_translations
fixes worker method for extra translations
2 parents d699af5 + 7317e39 commit 3a857f4

File tree

1 file changed

+11
-10
lines changed

1 file changed

+11
-10
lines changed

ts/common/system.ts

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -537,19 +537,20 @@ async function assembleWorkerStructure(
537537
json.mactions = SpeechGeneratorUtil.connectMactionSelections(mml, sxml);
538538
json.speech = SpeechGeneratorUtil.computeSpeechStructure(sxml);
539539
const root = (sxml.childNodes[0] as Element)?.getAttribute('id');
540-
if (options.braille !== 'none') {
541-
await setupEngine({
542-
modality: 'braille',
543-
locale: options.braille,
544-
domain: 'default',
545-
style: 'default'
546-
});
547-
json.braille = SpeechGeneratorUtil.computeBrailleStructure(sxml);
548-
json.braillelabel = json.braille[root]['braille-none'];
549-
}
550540
json.label = json.speech[root]['speech-none'];
551541
json.ssml = json.speech[root]['speech-ssml'];
552542
json.translations = Object.assign({}, LOCALE.MESSAGES.navigate);
543+
if (options.braille === 'none') {
544+
return json;
545+
}
546+
await setupEngine({
547+
modality: 'braille',
548+
locale: options.braille,
549+
domain: 'default',
550+
style: 'default'
551+
});
552+
json.braille = SpeechGeneratorUtil.computeBrailleStructure(sxml);
553+
json.braillelabel = json.braille[root]['braille-none'];
553554
return json;
554555
}
555556

0 commit comments

Comments
 (0)