Socket
Socket
Sign inDemoInstall

svelte-i18n

Package Overview
Dependencies
Maintainers
1
Versions
79
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

svelte-i18n - npm Package Compare versions

Comparing version 0.0.0 to 0.0.1

coverage/clover.xml

126

package.json
{
"name": "svelte-i18n",
"version": "0.0.0",
"version": "0.0.1",
"license": "MIT",
"main": "dist/i18n.js",
"types": "src/index.d.ts",
"description": "",
"author": "Christian Kaisermann <christian@kaisermann.me>",
"repository": "https://github.com/kaisermann",
"keywords": [],
"main": "dist/svelte-i18n.umd.js",
"module": "dist/svelte-i18n.es5.js",
"typings": "dist/types/svelte-i18n.d.ts",
"files": [
"dist"
],
"author": "Christian Kaisermann <christian@kaisermann.me>",
"repository": {
"type": "git",
"url": ""
},
"license": "MIT",
"engines": {
"node": ">=6.0.0"
},
"scripts": {
"lint": "tslint -t codeFrame 'src/**/*.ts' 'test/**/*.ts'",
"prebuild": "rimraf dist",
"build": "tsc --module commonjs && rollup -c rollup.config.ts && typedoc --out docs --target es6 --theme minimal --mode file src",
"start": "rollup -c rollup.config.ts -w",
"test": "jest",
"test:watch": "jest --watch",
"test:prod": "npm run lint && npm run test -- --coverage --no-cache",
"deploy-docs": "ts-node tools/gh-pages-publish",
"report-coverage": "cat ./coverage/lcov.info | coveralls",
"commit": "git-cz",
"semantic-release": "semantic-release",
"semantic-release-prepare": "ts-node tools/semantic-release-prepare",
"precommit": "lint-staged"
"build": "microbundle --name='svelte-i18n'",
"start": "microbundle watch --name='svelte-i18n'",
"test": "jest --no-cache --verbose",
"test:watch": "jest --no-cache --verbose --watchAll",
"lint": "eslint \"src/**/*.js\"",
"format": "prettier --loglevel silent --write \"src/**/*.js\" && eslint --fix \"src/**/*.js\"",
"prepublishOnly": "npm run format && npm run test && npm run build"
},
"lint-staged": {
"{src,test}/**/*.ts": [
"prettier --write",
"git add"
]
},
"config": {
"commitizen": {
"path": "node_modules/cz-conventional-changelog"
},
"validate-commit-msg": {
"types": "conventional-commit-types",
"helpMessage": "Use \"npm run commit\" instead, we use conventional-changelog format :) (https://github.com/commitizen/cz-cli)"
}
},
"jest": {
"verbose": true,
"testURL": "http://localhost/",
"transform": {
".(ts|tsx)": "<rootDir>/node_modules/ts-jest/preprocessor.js"
"^.+\\.jsx?$": "babel-jest"
},
"testRegex": "(/__tests__/.*|\\.(test|spec))\\.(ts|tsx|js)$",
"testRegex": "(/test/.*|\\.(test|spec))\\.js$",
"moduleFileExtensions": [
"ts",
"tsx",
"js"

@@ -63,3 +32,4 @@ ],

"/node_modules/",
"/test/"
"/test/",
"/src/formatter.js"
],

@@ -76,43 +46,27 @@ "coverageThreshold": {

},
"prettier": {
"semi": false,
"singleQuote": true
},
"devDependencies": {
"@types/deepmerge": "^2.1.0",
"@types/jest": "^22.0.0",
"@types/node": "^10.0.3",
"colors": "^1.1.2",
"commitizen": "^2.9.6",
"coveralls": "^3.0.0",
"cross-env": "^5.0.1",
"cz-conventional-changelog": "^2.0.0",
"husky": "^0.14.0",
"jest": "^22.0.2",
"lint-staged": "^7.1.3",
"lodash.camelcase": "^4.3.0",
"prettier": "^1.13.4",
"prompt": "^1.0.0",
"replace-in-file": "^3.0.0-beta.2",
"rimraf": "^2.6.1",
"rollup": "^0.59.2",
"rollup-plugin-commonjs": "^9.0.0",
"rollup-plugin-json": "^3.0.0",
"rollup-plugin-node-resolve": "^3.0.0",
"rollup-plugin-sourcemaps": "^0.4.2",
"rollup-plugin-typescript2": "^0.11.1",
"semantic-release": "^15.0.0",
"svelte": "^2.9.7",
"ts-jest": "^22.0.0",
"ts-node": "^6.0.0",
"tslint": "^5.8.0",
"tslint-config-prettier": "^1.1.0",
"tslint-config-standard": "^7.0.0",
"typedoc": "^0.11.0",
"typescript": "^2.6.2",
"validate-commit-msg": "^2.12.2"
"@babel/core": "^7.0.0-beta.56",
"@babel/preset-env": "^7.0.0-beta.56",
"babel-core": "^7.0.0-bridge.0",
"babel-jest": "^23.4.2",
"eslint": "^5.3.0",
"eslint-config-prettier": "^2.9.0",
"eslint-config-standard": "^11.0.0",
"eslint-plugin-import": "^2.13.0",
"eslint-plugin-node": "^7.0.1",
"eslint-plugin-prettier": "^2.6.2",
"eslint-plugin-promise": "^3.8.0",
"eslint-plugin-standard": "^3.1.0",
"jest": "^23.4.2",
"microbundle": "^0.6.0",
"prettier": "^1.14.1",
"svelte": "^2.9.11"
},
"peerDependencies": {
"svelte": "^2.9.11"
},
"dependencies": {
"deepmerge": "^2.1.1"
"deepmerge": "^2.1.1",
"object-resolve-path": "^1.1.1"
}
}

@@ -15,7 +15,5 @@ # svelte-i18n

const store = new Store()
/** i18n(svelteStore, arrayOfLocalesObjects) */
i18n(store, [
{
/** i18n(svelteStore, { dictionary }) */
const store = i18n(new Store(), {
dictionary: {
'pt-BR': {

@@ -25,4 +23,4 @@ message: 'Mensagem',

alert: 'Alerta',
error: 'Erro'
}
error: 'Erro',
},
},

@@ -33,22 +31,29 @@ 'en-US': {

alert: 'Alert',
error: 'Error'
}
}
error: 'Error',
},
},
},
/** Locales are deeply merged */
{
'pt-BR': {
messages: {
warn: 'Aviso',
success: 'Sucesso'
}
})
/**
* Extend the initial dictionary.
* Dictionaries are deeply merged.
* */
store.i18n.extendDictionary({
'pt-BR': {
messages: {
warn: 'Aviso',
success: 'Sucesso',
},
'en-US': {
messages: {
warn: 'Warn',
success: 'Success'
}
}
}
])
},
'en-US': {
messages: {
warn: 'Warn',
success: 'Success',
},
},
})
/** Set the initial locale */
store.i18n.setLocale('en-US')
```

@@ -60,7 +65,10 @@

<div>
{$_('message')}: {$_.upper('messages.success')}
{$_('message')}: {$_.upper('messages.success'))}
</div>
```
<!-- Will render for en-US -->
Renders:
```html
Message: SUCCESS
```
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