# pubcore-ui-text

> DEPRECATED; moved to: @pubcore/ui-text

Latest version **1.0.14** (published 2020-05-08) · MIT license · 0 weekly downloads

## Install

```sh
npm install pubcore-ui-text
pnpm add pubcore-ui-text
yarn add pubcore-ui-text
bun add pubcore-ui-text
```

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.14 |
| Published | 2020-05-08 |
| First published | 2017-06-11 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 13.8 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Maintainers | dominix, fidorw, jacklrs |

## Links

- npm: https://www.npmjs.com/package/pubcore-ui-text
- Repository: https://github.com/pubcore/uiText
- Homepage: https://github.com/pubcore/uiText#readme
- Issues: https://github.com/pubcore/uiText/issues
- npm.io page: https://npm.io/package/pubcore-ui-text

## Dependencies (1)

- [pubcore-http](https://npm.io/package/pubcore-http.md) ^1.0.8

## Recent versions

- 1.0.14 (latest) — 2020-05-08
- 1.0.12 — 2019-12-28
- 1.0.11 — 2019-08-28
- 1.0.9 — 2019-06-07
- 1.0.8 — 2018-05-12
- 1.0.7 — 2017-06-15
- 1.0.6 — 2017-06-13
- 1.0.5 — 2017-06-11
- 1.0.4 — 2017-06-11
- 1.0.3 — 2017-06-11
- 1.0.2 — 2017-06-11
- 1.0.1 — 2017-06-11
- 1.0.0 — 2017-06-11

## README

# DEPRECATED, please use [pubcore/ui-text instead](https://www.npmjs.com/package/@pubcore/ui-text)
[![Build Status](https://travis-ci.org/pubcore/uiText.svg?branch=master)](https://travis-ci.org/pubcore/uiText)

# Map keys to text with replacement-tag support
To support multilingual user interfaces one option is to use key-value lists
of texts. Instead of writing the text directly into a document, a text-key is
used to look up the text to show.

An other benefit is to decouple developer work from content management work,
if texts are not known at time of development.

## Configuration
    import {initLogMissingTextkey} from 'pubcore-ui-text'

    //enable post log-infos, if there are missing text-keys
    initLogMissingTextkey({postUri:'https://xyz.com/'})

## Examples

    import uiText from 'pubcore-ui-text'

    //example-data with text-key "content" and it's text string having
    //one replacement-tag "count":
    var T = {
        content: '{count} item(s)'
    }

    console.log( uiText(T, 'content', {count:5}) )
    //output: '5 item(s)'

    //we can add some inline default text:
    console.log( uiText(T, 'word_count', 'Found {count} words', {count:2}) )
    //output: "Found 2 words"

## codepen example
https://codepen.io/pubcore/pen/JrLaap

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