mirror of
https://github.com/transloadit/uppy.git
synced 2026-07-26 11:44:53 +00:00
40 lines
920 B
JavaScript
40 lines
920 B
JavaScript
import test from 'tape'
|
|
import Core from '../../src/core/index.js'
|
|
import russian from '../../src/locales/ru_RU.js'
|
|
import english from '../../src/locales/en_US.js'
|
|
|
|
test('translation', function (t) {
|
|
const core = new Core({locales: russian})
|
|
|
|
t.equal(
|
|
core.translator.translate('chooseFile'),
|
|
'Выберите файл',
|
|
'should return translated string'
|
|
)
|
|
|
|
t.end()
|
|
})
|
|
|
|
test('interpolation', function (t) {
|
|
const core = new Core({locales: english})
|
|
|
|
t.equal(
|
|
core.translator.translate('youHaveChosen', {'fileName': 'img.jpg'}),
|
|
'You have chosen: img.jpg',
|
|
'should return interpolated string'
|
|
)
|
|
|
|
t.end()
|
|
})
|
|
|
|
test('pluralization', function (t) {
|
|
const core = new Core({locales: russian})
|
|
|
|
t.equal(
|
|
core.translator.translate('filesChosen', {'smart_count': '18'}),
|
|
'Выбрано 18 файлов',
|
|
'should return interpolated & pluralized string'
|
|
)
|
|
|
|
t.end()
|
|
})
|