1
0
mirror of https://github.com/xuthus83/pigallery2.git synced 2024-11-03 21:04:03 +08:00

fixing chinese translation test

This commit is contained in:
Patrik J. Braun 2022-04-25 18:48:42 +02:00
parent 782cf78b03
commit acc921a4e5

View File

@ -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: '',