Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

i18n-dialect

Package Overview
Dependencies
Maintainers
8
Versions
11
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

i18n-dialect - npm Package Compare versions

Comparing version 1.0.3 to 1.0.4

1

dist/src/controller.js

@@ -33,2 +33,3 @@ "use strict";

_this.pluralSelect = pluralSelect;
onReady(localeName);
}

@@ -35,0 +36,0 @@ catch (e) {

2

package.json
{
"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 @@ });

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc