• Stars
    star
    1,216
  • Rank 38,545 (Top 0.8 %)
  • Language
    TypeScript
  • License
    MIT License
  • Created over 6 years ago
  • Updated 4 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Internationalization library for Svelte

ℹ️ svelte-i18n is due to some reworking, like moving from a singleton to instances. This will be worked on when I find the time and priority πŸ™

npm version

svelte-i18n

Internationalization for Svelte.

svelte-i18n helps you localize your app using the reactive tools Svelte provides. By using stores to keep track of the current locale, dictionary of messages and to format messages, we keep everything neat, in sync and easy to use on your svelte files.

Requirements

  • Node: >= 11.15.0
  • Browsers: Chrome 38+, Edge 16+, Firefox 13+, Opera 25+, Safari 8+.
<script>
  import { _ } from 'svelte-i18n'
</script>

<h1>{$_('page.home.title')}</h1>

<nav>
  <a>{$_('page.home.nav', { default: 'Home' })}</a>
  <a>{$_('page.about.nav', { default: 'About' })}</a>
  <a>{$_('page.contact.nav', { default: 'Contact' })}</a>
</nav>
// en.json
{
  "page": {
    "home": {
      "title": "Homepage",
      "nav": "Home"
    },
    "about": {
      "title": "About",
      "nav": "About"
    },
    "contact": {
      "title": "Contact",
      "nav": "Contact Us"
    }
  }
}

More Repositories

1

svelte-loadable

Dynamically load a svelte component
Svelte
319
star
2

svelte-css-vars

✨ Ever wanted to have reactive css variables in svelte? What if I told you there's a way?
JavaScript
235
star
3

kaisermann

πŸ“Ί Personal website and Github profile readme ✨
JavaScript
96
star
4

selene

A opinionated Wordpress base theme based on Sage.
PHP
29
star
5

sapper-template-i18n

Sapper template with an opinionated svelte-i18n usage
JavaScript
25
star
6

pr-slack-bot

A bot that keeps track of your PRs posted on slack
JavaScript
19
star
7

comicbubbles

CSS-only 8 bit-like comic balloons
CSS
18
star
8

svelte-page

Router component for Svelte
HTML
18
star
9

aph

Minimal DOM, barely api-less, manipulation library
JavaScript
16
star
10

PhotoSwippy

A no-(extra)-dependency PhotoSwipe friendly wrapper
JavaScript
12
star
11

rolleiflex

A Flexbox grid & helper framework made with Stylus and BEVM
CSS
9
star
12

svelte-markup-walker

A Svelte preprocessor that allows to walk through the AST generated by the svelte parser and modify the markup with MagicString.
TypeScript
9
star
13

textlooper

Customizable and lightweight text content looper based on CSS animations.
JavaScript
9
star
14

kiwi

πŸ₯πŸ›  Kiwi Tooling is a very dear and hand-crafted front-end tooling preset that aims to guide you on writing readable code for humans.
JavaScript
8
star
15

copymoji

click copy emoji
HTML
6
star
16

.dotfiles

Installs brew, wp-cli, composer, fish and a whole lot of things
Vim Script
6
star
17

marmitas.top

JavaScript
5
star
18

WPDLS

Basic custom WordPress admin style made easy
CSS
4
star
19

crius

A flexible and modular gulp front-end workflow
JavaScript
4
star
20

js-boilerplate

Barebones JS project boilerplate
JavaScript
3
star
21

post-links

Open links using POST instead of GET
JavaScript
3
star
22

vitorify

Copy and paste the bullshit, spend your energy elsewhere.
JavaScript
3
star
23

v1.kaisermann.me

Astro
2
star
24

10de10-generator

CSS
2
star
25

arke

A static/WordPress website setup-deploy tool
Python
2
star
26

expression-calculator

Simple exercise of a math expression calculator
JavaScript
2
star
27

ragnarok-scripts

A small collection of the old scripts I made for the Cronus-Emulator
2
star
28

quickenv

JavaScript
2
star
29

text-emoji-generator

HTML
1
star
30

jeopardy

Svelte
1
star
31

visc

Elements visibility state on viewport
JavaScript
1
star
32

programadeindie.com

PHP
1
star
33

s.olar.dance

CSS
1
star
34

stone-test

JavaScript
1
star
35

ti-queue

Timed Invocation Queue
JavaScript
1
star
36

find-my-puc

Projeto final para o curso de Sistemas de Informação
PHP
1
star
37

hyperion

A static website workflow forked from Crius
JavaScript
1
star
38

codigo-conduta-10de10

1
star
39

signature.kaisermann.me

My personal centralized website signature helper scripts.
JavaScript
1
star
40

lab

Created with CodeSandbox
JavaScript
1
star