Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

localez

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

localez

Localize from single string for genders, numbers, and number to text.

  • 0.0.1
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
2
Maintainers
1
Weekly downloads
 
Created
Source

Localez

Tiny template focused library to handle localized strings:

Examples

__('If {{g donator male(he) female(she) }} only had given {{g receiver male(him) female(her) }} {{i data.flowers zero( flowers) one( flower) other( flowers)}} then they\'d lived happily ever after.', {donator: 'male', receiver: 'female', data : { flowers: 1 }})
// "If he only had given her 1 flower then they'd lived happily ever after."

LOCALE SPEC

Parse string and inject appropriate variables, process through each {{ }}, determine each type and return variable.

Types and Options have long and short distinguishes.

TYPES: gender (g) | Male or Female integer (i) | 1,2,3,4 etc.. number (n) | one, two, three, four etc..

TYPES OPTIONS: gender | male, female integer, number | zero, one, few, many, other

VARIABLE: This can be any valid json expression from json passed in: data.profile.gender

male

//TODO - Readme

Keywords

FAQs

Package last updated on 14 Oct 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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc