i18n-dialect
Advanced tools
Comparing version 1.0.3 to 1.0.4
@@ -33,2 +33,3 @@ "use strict"; | ||
_this.pluralSelect = pluralSelect; | ||
onReady(localeName); | ||
} | ||
@@ -35,0 +36,0 @@ catch (e) { |
{ | ||
"name": "i18n-dialect", | ||
"version": "1.0.3", | ||
"version": "1.0.4", | ||
"description": "Internationalization support library", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
@@ -46,2 +46,3 @@ import { | ||
this.pluralSelect = pluralSelect; | ||
onReady(localeName); | ||
} catch (e) { | ||
@@ -48,0 +49,0 @@ onError && onError(e); |
@@ -415,6 +415,6 @@ import * as assert from 'assert'; | ||
it('Integration: properly loads locale file by name (via setLocale)', () => { | ||
it('Integration: properly loads locale file by name (via setLocale)', (done) => { | ||
setTranslationGetter((name: string, onReady: (name: string, contents: string) => void) => onReady(name, testLocaleJson)); | ||
let t = getController(); | ||
return t.setLocale('cs_cz', (name: string) => { | ||
t.setLocale('cs_cz', (name: string) => { | ||
assert.equal(name, 'cs_cz'); // should match with name passed to setLocale | ||
@@ -424,11 +424,13 @@ assert.equal(t.mDictMeta().language, 'cs_CZ'); // should match with value in json | ||
assert.notEqual(t.mPluralSelect(), undefined); | ||
done(); | ||
}, (err: any) => { | ||
assert.empty(err); | ||
done(); | ||
}); | ||
}); | ||
it('Integration: properly gets string from loaded dictionary with _t', () => { | ||
it('Integration: properly gets string from loaded dictionary with _t', (done) => { | ||
setTranslationGetter((name: string, onReady: (name: string, contents: string) => void) => onReady(name, testLocaleJson)); | ||
let t = getController(); | ||
return t.setLocale('cs_cz', (name: string) => { | ||
t.setLocale('cs_cz', (name: string) => { | ||
let descr: Descriptor = { | ||
@@ -441,11 +443,13 @@ type: '_t', | ||
assert.equal(t.getString(descr), '"Provider" neumožňuje připojení na Vaší adrese.'); | ||
done(); | ||
}, (err: any) => { | ||
assert.empty(err); | ||
done(); | ||
}); | ||
}); | ||
it('Integration: properly gets string from loaded dictionary with _pt', () => { | ||
it('Integration: properly gets string from loaded dictionary with _pt', (done) => { | ||
setTranslationGetter((name: string, onReady: (name: string, contents: string) => void) => onReady(name, testLocaleJson)); | ||
let t = getController(); | ||
return t.setLocale('cs_cz', (name: string) => { | ||
t.setLocale('cs_cz', (name: string) => { | ||
let descr: Descriptor = { | ||
@@ -459,11 +463,13 @@ type: '_pt', | ||
assert.equal(t.getString(descr), '23 km'); | ||
done(); | ||
}, (err: any) => { | ||
assert.empty(err); | ||
done(); | ||
}); | ||
}); | ||
it('Integration: properly gets string from loaded dictionary with _nt', () => { | ||
it('Integration: properly gets string from loaded dictionary with _nt', (done) => { | ||
setTranslationGetter((name: string, onReady: (name: string, contents: string) => void) => onReady(name, testLocaleJson)); | ||
let t = getController(); | ||
return t.setLocale('cs_cz', (name: string) => { | ||
t.setLocale('cs_cz', (name: string) => { | ||
let descr: Descriptor = { | ||
@@ -486,11 +492,14 @@ type: '_nt', | ||
assert.equal(t.getString(descr), '8 TV kanálů'); | ||
done(); | ||
}, (err: any) => { | ||
assert.empty(err); | ||
done(); | ||
}); | ||
}); | ||
it('Integration: properly gets string from loaded dictionary with _npt', () => { | ||
it('Integration: properly gets string from loaded dictionary with _npt', (done) => { | ||
setTranslationGetter((name: string, onReady: (name: string, contents: string) => void) => onReady(name, testLocaleJson)); | ||
let t = getController(); | ||
return t.setLocale('cs_cz', (name: string) => { | ||
t.setLocale('cs_cz', (name: string) => { | ||
let descr: Descriptor = { | ||
@@ -514,4 +523,7 @@ type: '_npt', | ||
assert.equal(t.getString(descr), '8 míst'); | ||
done(); | ||
}, (err: any) => { | ||
assert.empty(err); | ||
done(); | ||
}); | ||
@@ -518,0 +530,0 @@ }); |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
184111
1213