# handlebars-tr

> Simple helper to render translated template

Latest version **0.0.4** (published 2014-12-03) · MIT license · 0 weekly downloads

## Install

```sh
npm install handlebars-tr
pnpm add handlebars-tr
yarn add handlebars-tr
bun add handlebars-tr
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.4 |
| Published | 2014-12-03 |
| First published | 2014-11-30 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Federico Rampazzo |
| Maintainers | framp |
| Keywords | translate, handlebars, tr, i18n, sprintf, compile, template |

## Links

- npm: https://www.npmjs.com/package/handlebars-tr
- Repository: https://github.com/framp/handlebars-tr
- Issues: https://github.com/framp/handlebars-tr/issues
- npm.io page: https://npm.io/package/handlebars-tr

## Alternatives

- [@openai/codex-sdk](https://npm.io/package/@openai/codex-sdk.md) — 731.4K weekly downloads
- [babel-plugin-transform-react-jsx](https://npm.io/package/babel-plugin-transform-react-jsx.md) — 565.0K weekly downloads
- [babel-helper-remove-or-void](https://npm.io/package/babel-helper-remove-or-void.md) — 508.5K weekly downloads
- [@pnpm/store-controller-types](https://npm.io/package/@pnpm/store-controller-types.md) — 186.9K weekly downloads
- [react-native-signature-canvas](https://npm.io/package/react-native-signature-canvas.md) — 155.6K weekly downloads

## Recent versions

- 0.0.4 (latest) — 2014-12-03
- 0.0.3 — 2014-12-02
- 0.0.2 — 2014-12-02
- 0.0.1 — 2014-11-30

## README

#handlebars-tr

A simple helper to translate strings in handlebars.

##Usage

    var Handlebars = require('handlebars');
    //var handlebarsTr = require('handlebars-tr')(Handlebars, '__language', '***');
    var handlebarsTr = require('handlebars-tr')(); //This line is equivalent to the previous one

    var template = Handlebars.compile('{{tr "Test"}}');
    var data = {
      __language: {
        Test: 'TestTranslation{{magic}}'
      }
      magic: 'Magic'
    };
    console.log(template(data));

This helper actually compile the strings in `__language` as handlebars template, passing all the data available to the root context.

If a string is not found in `__language`, the path will be printed surrounded by `***`: `***Test***`


##License
MIT

---
_Source: https://npm.io/package/handlebars-tr · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
