mirror of
https://github.com/Mibew/mibew.git
synced 2025-04-11 10:20:12 +03:00
37 lines
875 B
JavaScript
37 lines
875 B
JavaScript
// Testing Localization system
|
|
module('Localization');
|
|
|
|
test('Basic things', function() {
|
|
// Fill localization container
|
|
Mibew.Localization.set({
|
|
one: 'uno',
|
|
'Hello {0}, {1} and {2}!': '¡Hola {0}, {1} y {2}!'
|
|
});
|
|
|
|
equal(
|
|
Mibew.Localization.trans('one'),
|
|
'uno',
|
|
'Test simple string'
|
|
);
|
|
|
|
equal(
|
|
Mibew.Localization.trans('Hello {0}, {1} and {2}!', 'Foo', 'Bar', 'Baz'),
|
|
'¡Hola Foo, Bar y Baz!',
|
|
'Test placeholders'
|
|
);
|
|
});
|
|
|
|
test('Unknown string', function() {
|
|
equal(
|
|
Mibew.Localization.trans('An unknown string'),
|
|
'An unknown string',
|
|
'Test simple string'
|
|
);
|
|
|
|
equal(
|
|
Mibew.Localization.trans('An unknown string with a placeholder: {0}', 'test!'),
|
|
'An unknown string with a placeholder: test!',
|
|
'Test placeholders'
|
|
);
|
|
});
|