From acc921a4e57aa9edc6584f22b8782f66b2225ae7 Mon Sep 17 00:00:00 2001 From: "Patrik J. Braun" Date: Mon, 25 Apr 2022 18:48:42 +0200 Subject: [PATCH] fixing chinese translation test --- test/frontend/translation.spec.ts | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/test/frontend/translation.spec.ts b/test/frontend/translation.spec.ts index 482963a2..818cc16c 100644 --- a/test/frontend/translation.spec.ts +++ b/test/frontend/translation.spec.ts @@ -1,7 +1,9 @@ +/* eslint-disable @typescript-eslint/no-var-requires */ import {ProjectPath} from '../../src/backend/ProjectPath'; import {promises as fsp} from 'fs'; -const chai = require('chai'); import * as path from 'path'; + +const chai = require('chai'); const {expect} = chai; // to help WebStorm to handle the test cases @@ -19,10 +21,13 @@ describe('UI', () => { for (const t of translations) { - const lang = t.substr(t.indexOf('.') + 1, 2); + let lang = t.substring(t.indexOf('.') + 1, t.indexOf('.') + 3); if (lang === 'en') { continue; // no need to add 'en' as it is the default language. } + if (lang === 'cn') { + lang = 'zh'; // zh county code is Chinese + } const translationPath = path.join(base, t).replace(new RegExp('\\\\', 'g'), '/'); expect(knownTranslations[lang]).to.deep.equal({ baseHref: '',