Giter Club home page Giter Club logo

sapper-i18n-sync's Introduction

๐ŸŒ Sapper I18N Sync

Utilities for localized URLs in Sapper with built-in i18n support.

โญ๏ธ Features

  • Use |slug|s in Svelte files for i18n
  • Language prefixes for URL localization
  • Fetch your i18n files from a remote git repository

Why this package exists

There is no "right" way to do i18n in Sapper (see sveltejs/sapper#576). This package is a temporary utility that adds support for language prefixes in URLs and i18n helpers.

For example:

<p>|helloWorld|</p>

Is rendered to the English page http://example.com/en/hello:

<p>Hello, world!</p>

To do this, the main features are: (i) replacing |slug| with translations, and (ii) generating components and routes.

๐Ÿ’ป Get started

To get started, install the package from npm:

npm install sapper-i18n-sync

To create a locales directory from a remote git repository:

import { generateLocales } from "sapper-i18n-sync";
generateLocales({
  gitRepo: "https://github.com/koj-co/i18n",
  path: "locales",
})

Then, generate:

import { generateSvelte } from "sapper-i18n-sync";
generateSvelte();

๐Ÿ“„ License

MIT ยฉ Anand Chowdhary

sapper-i18n-sync's People

Contributors

anandchowdhary avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar

Forkers

speepapdev

sapper-i18n-sync's Issues

could you please guide more of how to make this work

hi,

could guide more detail of how to make this work? i really need this, but your readme i don't what should i do first and so on.

example, where to add this

To create a locales directory from a remote git repository:

import { generateLocales } from "sapper-i18n-sync";
generateLocales({
  gitRepo: "https://github.com/koj-co/i18n",
  path: "locales",
})

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.