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.1 to 1.0.2

3

dist/src/controller.js

@@ -16,3 +16,4 @@ "use strict";

};
TranslationController.prototype.setLocale = function (localeName, onReady, onError) {
TranslationController.prototype.setLocale = function (localeName, onReady, // called with new locale name when loading is finished
onError) {
var _this = this;

@@ -19,0 +20,0 @@ this.translationGetter(localeName, function (name, contents) {

{
"name": "i18n-dialect",
"version": "1.0.1",
"version": "1.0.2",
"description": "Internationalization support library",

@@ -28,5 +28,5 @@ "main": "dist/index.js",

"eslint": "3.13.1",
"i18n-po-json": "1.0.4",
"i18n-proto": "1.0.4",
"i18n-stex": "1.0.8",
"i18n-po-json": "1.0.5",
"i18n-proto": "1.0.5",
"i18n-stex": "1.0.9",
"karma": "1.7.0",

@@ -33,0 +33,0 @@ "karma-browserify": "^5.1.1",

@@ -62,3 +62,3 @@ # i18n-dialect

i18n-json-po uses github-flow to accept & merge fixes and improvements. Basic process is:
i18n-dialect uses github-flow to accept & merge fixes and improvements. Basic process is:
- Fork the repo.

@@ -65,0 +65,0 @@ - Create a branch.

import {
Descriptor,
PluralDescriptor,
PoData,
Meta
PluralDescriptor
} from './types';
import { I18NEntry } from 'i18n-proto';
import { I18NEntry, TranslationJson, TranslationMeta } from 'i18n-proto';
export class TranslationController {
protected dictMeta: Meta | undefined;
protected dictMeta: TranslationMeta | undefined;
protected pluralSelect: (factor: number) => number | undefined;

@@ -29,7 +27,7 @@ protected dictionary: { [key: string]: string[] } = {};

localeName: string,
onReady: (name: string) => void,
onReady: (name: string) => void, // called with new locale name when loading is finished
onError?: (e: any) => void
): void { // resolves with new locale name when loading is finished
): void {
this.translationGetter(localeName, (name: string, contents: string) => {
let poData: PoData = JSON.parse(contents); // TODO: better json schema validation?
let poData: TranslationJson = JSON.parse(contents); // TODO: better json schema validation?
if (!poData.items || !poData.meta) {

@@ -36,0 +34,0 @@ onError && onError('Invalid format of translation file');

@@ -8,3 +8,2 @@ export {

import { Scalar } from 'i18n-stex/src/types';
export { Meta, PoData } from 'i18n-po-json/src/types';

@@ -11,0 +10,0 @@ export type SingleSimpleDescriptor = {

@@ -5,5 +5,3 @@ import { TranslationController } from '../src/controller';

Descriptor,
PluralDescriptor,
PoData,
Meta
PluralDescriptor
} from '../src/types';

@@ -10,0 +8,0 @@

Sorry, the diff of this file is not supported yet

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