Latest Threat Research:Malicious dYdX Packages Published to npm and PyPI After Maintainer Compromise.Details
Socket
Book a DemoInstallSign in
Socket

t-component

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

t-component

tiny translation helper

Source
npmnpm
Version
0.0.1
Version published
Weekly downloads
2
-80%
Maintainers
1
Weekly downloads
 
Created
Source

t

tiny translation helper.

Installation

$ component install component/t

API

t(string, [object])

Return a translatable string, with optional substitutions keyed in object.

var t = require('t');

t('Hello');
// => "Hello"

t('Hello {name}', { name: 'Tobi' });
// => "Hello Tobi"

t.lang()

Get the current language code, for example "en".

t.lang(code)

Set language code.

t.CODE = object

Define translations, for example:

t.es = {
  'Hello {name}': 'Hola {name}'
};

t('Hello {name}', { name: 'Tobi' });
// => "Hello Tobi"


t.lang('es');
t('Hello {name}', { name: 'Tobi' }).should.equal('Hola Tobi');
// => "Hola Tobi"

License

MIT

FAQs

Package last updated on 12 Sep 2012

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