# ethereum-localized-messaging

> A method of converting machine codes to human-readable text in any language and phrasing.

Latest version **2.1.4** (published 2019-01-10) · Apache-2.0 license · 0 weekly downloads

## Install

```sh
npm install ethereum-localized-messaging
pnpm add ethereum-localized-messaging
yarn add ethereum-localized-messaging
bun add ethereum-localized-messaging
```

## 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 | 2.1.4 |
| Published | 2019-01-10 |
| First published | 2018-09-29 |
| Weekly downloads | 0 |
| License | Apache-2.0 |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >=8.4 |
| Dependencies | 3 |
| Unpacked size | 34.8 KB |
| Known vulnerabilities | 0 |
| Install scripts | yes |
| GitHub stars | 5 |
| Author | Jenn Cooper |
| Maintainers | jenncoop |
| Keywords | ethereum, solidity, localizations, eip, 1444 |

## Links

- npm: https://www.npmjs.com/package/ethereum-localized-messaging
- Repository: https://github.com/jenncoop/ethereum-localized-messaging
- Homepage: https://github.com/jenncoop/ethereum-localized-messaging#readme
- Issues: https://github.com/jenncoop/ethereum-localized-messaging/issues
- npm.io page: https://npm.io/package/ethereum-localized-messaging

## Dependencies (3)

- [web3](https://npm.io/package/web3.md) ^1.0.0-beta.37
- [truffle](https://npm.io/package/truffle.md) ^5.0.1
- [ethereumjs-tx](https://npm.io/package/ethereumjs-tx.md) ^1.3.7

## Recent versions

- 2.1.4 (latest) — 2019-01-10
- 2.1.3 — 2018-10-16
- 2.1.2 — 2018-10-16
- 2.1.1 — 2018-10-16
- 1.1.1 — 2018-10-05
- 1.1.0 — 2018-10-05
- 0.1.0 — 2018-09-29

## README

# Ethereum Localized Messaging

[![Build Status Badge](https://travis-ci.org/jenncoop/ethereum-localized-messaging.svg?branch=master)](https://travis-ci.org/jenncoop/ethereum-localized-messaging.svg?branch=master) [![Coverage Status](https://coveralls.io/repos/github/jenncoop/ethereum-localized-messaging/badge.svg?branch=master)](https://coveralls.io/github/jenncoop/ethereum-localized-messaging?branch=master)
[![ERC1444](https://img.shields.io/badge/ERC-1444-414.svg)](https://eips.ethereum.org/EIPS/eip-1444)

A method of converting machine codes to human-readable text in any language and phrasing.

## An Implementation of EIP-1444
[EIP-1444](https://github.com/ethereum/EIPs/pull/1444): an on-chain system for providing user feedback by converting machine-efficient codes into human-readable strings in any language or phrasing. The system does not impose a list of languages, but rather lets users create, share, and use the localized text of their choice.

## Installation

```
npm install ethereum-localized-messaging
```

### Usage

Implement your own localizations:

```solidity
pragma solidity ^0.5.0;

import "/ethereum-localized-messaging/contracts/Localization.sol";

contract PirateLocalization is Localization {
    constructor() public {
        set(hex"00", "Nay!");
        set(hex"01", "Aye!");
        set(hex"02", "Arr jolly crew have begun");
        set(hex"03", "Awaitin'");
        set(hex"04", "Ye need ta do something");
        set(hex"05", "Has walked thar plank an expired");
        set(hex"0F", "Only this here metadata");
        set(hex"10", "Ye can nay do that");
        set(hex"11", "Ye be permitted");
        set(hex"12", "Ye have requested thar go ahead");
        set(hex"13", "Yer waitin' fer the go ahead");
        set(hex"14", "Thar awaiting yer signal");
    }
}
```

```solidity
pragma solidity ^0.5.0;

import "/ethereum-localized-messaging/contracts/LocalizationPreferences.sol";
import "./PirateLocalization.sol";

contract MyContract {
    LocalizationPreferences prefs;

    constructor() public {
        PirateLocalization pirateLocalization = new PirateLocalization();
        prefs = new LocalizationPreferences(pirateLocalization);
    }

    function localize(bytes32 _code) view public returns (bool _found, string _msg) {
        return prefs.textFor(_code);
    }
}
```

## Contributing

### Prerequisites

* NodeJS, v10.11.0 or higher
* Truffle, v5.0.0-beta.0

### Quick Start

1. `npm install`
2. `truffle compile`
3. `npm run coverage`

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