mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-01-08 04:03:12 +03:00
6d8ca23625
refs https://github.com/TryGhost/Ghost/issues/15502 - this adds support for namespaces to the i18n package so we can separate translations for different packages
46 lines
1.1 KiB
JavaScript
46 lines
1.1 KiB
JavaScript
const assert = require('assert');
|
|
|
|
const i18n = require('../');
|
|
|
|
describe('i18n', function () {
|
|
describe('Can use Portal resources', function () {
|
|
describe('English', function () {
|
|
let t;
|
|
|
|
before(function () {
|
|
t = i18n('nl', 'portal').t;
|
|
});
|
|
|
|
it('can translate `Name`', function () {
|
|
assert.equal(t('Name'), 'Naam');
|
|
});
|
|
});
|
|
});
|
|
|
|
describe('Can translate', function () {
|
|
describe('Dutch', function () {
|
|
let t;
|
|
|
|
before(function () {
|
|
t = i18n('nl', 'test').t;
|
|
});
|
|
|
|
it('can translate Dutch', function () {
|
|
assert.equal(t('Hello'), 'Hallo Test');
|
|
});
|
|
});
|
|
|
|
describe('English', function () {
|
|
let t;
|
|
|
|
before(function () {
|
|
t = i18n('en', 'test').t;
|
|
});
|
|
|
|
it('can translate English', function () {
|
|
assert.equal(t('Hello'), 'Hello Test');
|
|
});
|
|
});
|
|
});
|
|
});
|