
Security News
Deno 2.2 Improves Dependency Management and Expands Node.js Compatibility
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
svelte-i18n
Advanced tools
Internationalization for svelte
Work-in-progress
store
import i18n from 'svelte-i18n'
import { Store } from 'svelte/store'
/** i18n(svelteStore, { dictionary }) */
const store = i18n(new Store(), {
dictionary: {
'pt-BR': {
message: 'Mensagem',
messages: {
alert: 'Alerta',
error: 'Erro',
},
},
'en-US': {
message: 'Message',
messages: {
alert: 'Alert',
error: 'Error',
},
},
},
})
/**
* 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',
},
},
})
/** Set the initial locale */
store.i18n.setLocale('en-US')
templates
<div>
{$_('message')}: {$_.upper('messages.success'))}
</div>
Renders:
Message: SUCCESS
FAQs
Internationalization library for Svelte
The npm package svelte-i18n receives a total of 32,536 weekly downloads. As such, svelte-i18n popularity was classified as popular.
We found that svelte-i18n demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
Security News
React's CRA deprecation announcement sparked community criticism over framework recommendations, leading to quick updates acknowledging build tools like Vite as valid alternatives.
Security News
Ransomware payment rates hit an all-time low in 2024 as law enforcement crackdowns, stronger defenses, and shifting policies make attacks riskier and less profitable.