2023-01-18 15:21:17 +03:00
|
|
|
const assert = require('assert');
|
|
|
|
|
|
|
|
const i18n = require('../');
|
|
|
|
|
2023-03-01 11:10:11 +03:00
|
|
|
describe('i18n', function () {
|
|
|
|
describe('Can use Portal resources', function () {
|
|
|
|
describe('English', function () {
|
|
|
|
let t;
|
2023-01-18 15:21:17 +03:00
|
|
|
|
2023-03-01 11:10:11 +03:00
|
|
|
before(function () {
|
|
|
|
t = i18n('nl', 'portal').t;
|
|
|
|
});
|
2023-01-18 15:21:17 +03:00
|
|
|
|
2023-03-01 11:10:11 +03:00
|
|
|
it('can translate `Name`', function () {
|
|
|
|
assert.equal(t('Name'), 'Naam');
|
|
|
|
});
|
2023-01-18 15:21:17 +03:00
|
|
|
});
|
|
|
|
});
|
|
|
|
|
2023-03-01 11:10:11 +03:00
|
|
|
describe('Can translate', function () {
|
|
|
|
describe('Dutch', function () {
|
|
|
|
let t;
|
|
|
|
|
|
|
|
before(function () {
|
|
|
|
t = i18n('nl', 'test').t;
|
|
|
|
});
|
2023-01-18 15:21:17 +03:00
|
|
|
|
2023-03-01 11:10:11 +03:00
|
|
|
it('can translate Dutch', function () {
|
|
|
|
assert.equal(t('Hello'), 'Hallo Test');
|
|
|
|
});
|
2023-01-18 15:21:17 +03:00
|
|
|
});
|
|
|
|
|
2023-03-01 11:10:11 +03:00
|
|
|
describe('English', function () {
|
|
|
|
let t;
|
|
|
|
|
|
|
|
before(function () {
|
|
|
|
t = i18n('en', 'test').t;
|
|
|
|
});
|
|
|
|
|
|
|
|
it('can translate English', function () {
|
|
|
|
assert.equal(t('Hello'), 'Hello Test');
|
|
|
|
});
|
2023-01-18 15:21:17 +03:00
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|