🚀 Socket Launch Week 🚀 Day 5: Introducing Socket Fix.Learn More
Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

rivets-intl

Rivets.js component for internationalization

1.0.2
latest
Version published
Weekly downloads
10
233.33%
Maintainers
1
Weekly downloads
 
Created

rivets-intl

Rivets.js component for internationalization

Overview

rivets-intl uses IntlMessageFormat to render translated strings that can be bound by rivets

Usage

In your rivets setup add rivets-intl as a component

    var messages = { 'en-US': { greeting: { formal: "Hello, { name }" } } };
    var locale = 'en-US';
    Rivets.components.i18n = require('rivets-intl')(messages, locale);

In a template file

    <i18n key="greeting.formal" name="full_name" />

Then bind data

    var data = { full_name: "Black Widow" };
    Rivets.bind(template, data);

The result will be a string:

Hello, Black Widow

FAQs

Package last updated on 08 May 2015

Did you know?

Socket

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.

Install

Related posts