paparsya
TypeScript icon, indicating that this package has built-in type declarations

1.0.1 • Public • Published

paparsya

WIP

Parse localized strings

let text = "Simeple text with a {variable}!"

paparsya(text, { variable: 'Whatnot' })
let text = "{comp:count, 1 {{count} User}, default {{count} Users}}"

paparsya(text, { count: 3 })

Rules

{variable}

{function:, }

Functions

Comp

Compare: {comp:, {}, {}, default {}}

Examples {comp:number, 1 {Number is one!}, default {Number is: {number}}} {comp:region, eu {Europe!}, us {US!}, default {Other}}

Plural

Plural: {plural:count, one {}, zero {}, other {}}

Example: {plural:count, one {{count} User}, other {{count} Users}}

Readme

Keywords

none

Package Sidebar

Install

npm i paparsya

Weekly Downloads

4

Version

1.0.1

License

ISC

Unpacked Size

2.78 kB

Total Files

11

Last publish

Collaborators

  • maanex