Skip to content

Commit

Permalink
Check for existence of glossary file, not folder (#127)
Browse files Browse the repository at this point in the history
This allows to have a glossary defined for some, but not all languages.
  • Loading branch information
steventilator authored Nov 6, 2024
1 parent e4e4008 commit df40848
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/services/deepl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,8 @@ export class DeepL implements TranslationService {
};

// Should a glossary be used?
if (this.glossariesDir || this.automaticGlossary) {
const glossaryFilePath = path.join(this.glossariesDir, `${from}-${to}.json`);
if (fs.existsSync(glossaryFilePath) || this.automaticGlossary) {
// Find the glossary that matches the source and target language:
const glossary = await this.getGlossary(
from,
Expand Down

0 comments on commit df40848

Please sign in to comment.