Socket
Socket
Sign inDemoInstall

@nanostores/i18n

Package Overview
Dependencies
Maintainers
3
Versions
17
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@nanostores/i18n - npm Package Compare versions

Comparing version 0.2.0 to 0.2.1

32

create-i18n/index.js

@@ -20,3 +20,3 @@ import { atom, onMount } from 'nanostores'

let t = atom(baseTranslation)
let t = atom()
if (process.env.NODE_ENV !== 'production') {

@@ -36,19 +36,19 @@ t.component = componentName

onMount(t, () => {
let waiting = false
function setTranslation(code) {
let translations = {
...define.cache[baseLocale][componentName],
...define.cache[code][componentName]
}
for (let i in transforms) {
let nodeTransform = transforms[i]
let input = translations[i]
translations[i] = (...args) => nodeTransform(code, input, args)
}
t.set(translations)
waiting = false
let waiting = false
function setTranslation(code) {
let translations = {
...define.cache[baseLocale][componentName],
...define.cache[code][componentName]
}
for (let i in transforms) {
let nodeTransform = transforms[i]
let input = translations[i]
translations[i] = (...args) => nodeTransform(code, input, args)
}
t.set(translations)
waiting = false
}
setTranslation(baseLocale)
onMount(t, () => {
let unbindLocale = locale.subscribe(code => {

@@ -55,0 +55,0 @@ if (define.cache[code]) {

@@ -6,4 +6,4 @@ import { ReadableAtom } from 'nanostores'

export interface Formatter {
number: Intl.NumberFormat['format']
time: Intl.DateTimeFormat['format']
number(num: number, opts?: Intl.NumberFormatOptions): string
time(date?: Date | number, opts?: Intl.DateTimeFormatOptions): string
}

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

{
"name": "@nanostores/i18n",
"version": "0.2.0",
"version": "0.2.1",
"description": "A tiny (≈500 bytes) i18n library for React/Preact/Vue/Svelte",

@@ -5,0 +5,0 @@ "keywords": [

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