GithubHelp home page GithubHelp logo

wintersmith-i18n's Introduction

wintersmith-i18n

i18n plugin for Wintersmith

Install

Using wintersmith:

wintersmith plugin install i18n

Manually:

npm install --save wintersmith-i18n

Then add wintersmith-i18n to your plugins list in wintersmith's config.json.

Options

Set the locales you want in your config.json, like so:

{
    "i18n": {
        "locales": ["en", "it", "sv", "ja"]
    }
}

The default directory is ./locales resolved from your project root.

See https://github.com/mashpie/i18n-node#list-of-all-configuration-options for all options.

Usage

The plugin will make the standard i18n functions (__, __n, etc.) available globally in your templates.

You also must call setLocale with the locale you want to use, the method returns the locale or the default locale if no matching locale is found. Which is convenient for doing this:

<html lang="{{ setLocale('sv') }}">
..
<p>{{ __('Do you like turtles?') }}

See the example/ directory for a complete usage example.

wintersmith-i18n's People

Contributors

jnordberg avatar

Stargazers

Fika Ridaul Maulayya avatar Irfan Maulana avatar Finbar Giusti avatar Ismael Canal avatar  avatar

Watchers

 avatar

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.