JSPM

catberry-l10n-dust-helper

3.0.0
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 2
  • Score
    100M100P100Q14539F
  • License MIT

Dust helper for Catberry localization plugin

Package Exports

  • catberry-l10n-dust-helper

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (catberry-l10n-dust-helper) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

Dust helper for Catberry localization plugin

Gitter

Installation

npm install catberry-l10n-dust-helper --save

Description

You can use dustjs helper that puts localized value wherever you want:

{@l10n key="SOME_LOCALIZATION_KEY" locale="en-us" count=5 /}
  • key - localization key
  • locale - current user localization (optional)
  • count - pluralization count (optional)

Let's say we have such localization dictionary:

{
    "COMMENT": ["comment", "comments"]
}

And we use such helper parameters:

{@l10n key="COMMENT" locale="en-us" count=1 /}

It outputs comment word.

{@l10n key="COMMENT" locale="en-us" count=5 /}

It outputs comments word.

Also, if you have locale value in template data context it is not needed to specify parameter locale in helper because it will be automatically used from template data context.

Contributing

There are a lot of ways to contribute:

Denis Rechkunov denis.rechkunov@gmail.com