UNPKG

@nanostores/i18n

Version:

A tiny (≈600 bytes) i18n library for React/Preact/Vue/Svelte

11 lines (9 loc) 307 B
import { strings, transform } from '../transforms/index.js' export const params = transform((locale, translation, values) => { return strings(translation, string => { for (let name in values) { string = string.replace(new RegExp(`{${name}}`, 'g'), values[name]) } return string }) })