{"eip":1444,"title":"Localized Messaging with Signal-to-Text","description":"A method of converting machine codes to human-readable text in any language and phrasing.","authors":["Brooklyn Zelenka (@expede)","Jennifer Cooper (@jenncoop)"],"status":"Stagnant","type":"Standards Track","category":"ERC","created":"2018-09-23","discussionsTo":"https://ethereum-magicians.org/t/eip-1444-localized-messaging-with-signal-to-text/","repo":"ERCs","label":"ERC-1444","officialUrl":"https://eips.ethereum.org/EIPS/eip-1444","sourceUrl":"https://github.com/ethereum/ERCs/blob/master/ERCS/erc-1444.md","url":"https://eips.huatuo.xyz/eip-1444/","tldr":{"en":"An on-chain system that turns machine codes (bytes32 keys, enums, status codes) into human-readable text in whatever language each user prefers, with a guaranteed fallback when no translation exists.","ja":"機械コード（bytes32 キー、enum、ステータスコード）を、各ユーザーが好む言語の人間が読めるテキストに変換するオンチェーンのシステム。翻訳がない場合でも必ずフォールバックが得られる。","ko":"기계 코드(bytes32 키, enum, 상태 코드)를 사용자가 선호하는 언어의 사람이 읽을 수 있는 텍스트로 바꿔 주는 온체인 시스템. 번역이 없을 때도 보장된 폴백이 있다.","zh":"一个链上系统，把机器码（bytes32 键、枚举、状态码）转换成每位用户偏好语言的人类可读文本，并在没有翻译时保证有后备文本。"},"tags":["localization","i18n","ux","messages","erc"],"explainers":{"en":{"lang":"en","tldr":"An on-chain system that turns machine codes (bytes32 keys, enums, status codes) into human-readable text in whatever language each user prefers, with a guaranteed fallback when no translation exists.","tags":["localization","i18n","ux","messages","erc"],"related":[1066],"updated":"2026-10-19","url":"https://eips.huatuo.xyz/eip-1444/","markdown":"## What problem does it solve?\n\nContracts communicate outcomes with compact machine values: booleans, enums, status codes such as [ERC-1066](/eip-1066/), or a hard-coded English `revert` string. Raw codes are unfriendly to users, and English-only strings serve only part of the world.\n\nERC-1444 lets anyone publish translations of those codes on-chain, and lets each user choose which translation they want. A contract or frontend can then show \"Insufficient funds\", \"残高不足\" or a simplified explanation for the same underlying code.\n\n## How it works\n\nThere are two kinds of contract:\n\n- **`Localization`**: a simple lookup table from `bytes32` code to UTF-8 text, exposing `textFor(bytes32 code) returns (string)`. Anyone can deploy one for a language, dialect or level of detail.\n- **`LocalizationPreferences`**: a proxy where each user registers their preferred `Localization` with `set(localization)`. Its `textFor(code)` returns `(bool wasFound, string text)`.\n\nLookup rules:\n\n1. The proxy asks the user's chosen `Localization` for the code.\n2. If that returns an empty string, the proxy **must** fall back to a default `Localization` that has every key filled in, and return `wasFound = false`.\n3. Otherwise it returns the text with `wasFound = true`.\n\nThe flag lets a UI explain why a message appears in a different language.\n\nStrings may be templates in C `printf` style (`%s`, `%d`). Messages with two or more arguments should use positional parameters (`%1$s`, `%2$s`), because word order differs between languages. The spec recommends returning the template and its arguments separately and doing the interpolation off-chain.\n\n`bytes32` keys are used because they match the EVM word size. Smaller codes, such as ERC-1066's `bytes1`, fit inside them directly.\n\n## Sample code\n\nA minimal `Localization` and an off-chain lookup through a preferences proxy (ethers v6):\n\n```solidity\n// SPDX-License-Identifier: MIT\npragma solidity ^0.8.20;\n\ncontract JapaneseMessages {\n    mapping(bytes32 =\u003e string) private text;\n\n    constructor() {\n        text[bytes32(uint256(0x10))] = unicode\"拒否されました\";\n        text[bytes32(uint256(0x11))] = unicode\"承認されました\";\n    }\n\n    function textFor(bytes32 code) external view returns (string memory) {\n        return text[code]; // \"\" means not translated -\u003e proxy falls back\n    }\n}\n```\n\n```ts\nimport { Contract, JsonRpcProvider, zeroPadValue } from \"ethers\";\n\nconst provider = new JsonRpcProvider(process.env.RPC_URL);\nconst prefs = new Contract(\n  process.env.PREFS_ADDRESS!,\n  [\"function textFor(bytes32) view returns (bool, string)\"],\n  provider,\n);\n\nconst code = zeroPadValue(\"0x11\", 32);\nconst [wasFound, template] = await prefs.textFor(code);\nconsole.log(wasFound ? template : `${template} (fallback language)`);\n```\n\n## Things to know\n\n- Status is **Stagnant**. No shared, widely used registry of localizations emerged.\n- The spec suggests treating `tx.origin` as the registering user in `set`. Relying on `tx.origin` is generally discouraged, and it does not work for smart-contract wallets.\n- Storing many strings on-chain is costly. The spec weighed off-chain storage but chose on-chain text so that it stays available and can be used in `revert` messages.\n- No global registry is mandated: projects can run their own proxies or share common ones.\n"},"ja":{"lang":"ja","tldr":"機械コード（bytes32 キー、enum、ステータスコード）を、各ユーザーが好む言語の人間が読めるテキストに変換するオンチェーンのシステム。翻訳がない場合でも必ずフォールバックが得られる。","tags":["localization","i18n","ux","messages","erc"],"related":[1066],"updated":"2026-10-19","url":"https://eips.huatuo.xyz/ja/eip-1444/","markdown":"## 何を解決するのか\n\nコントラクトは、結果をブール値、enum、[ERC-1066](/eip-1066/) のようなステータスコード、あるいはハードコードされた英語の `revert` 文字列といった、コンパクトな機械向けの値で伝えます。生のコードはユーザーにとって不親切で、英語だけの文字列は世界の一部にしか役立ちません。\n\nERC-1444 は、誰でもそれらのコードの翻訳をオンチェーンで公開でき、各ユーザーがどの翻訳を使うかを選べるようにします。そうすれば、コントラクトやフロントエンドは、同じ基となるコードに対して「Insufficient funds」「残高不足」、あるいはやさしく言い換えた説明を表示できます。\n\n## 仕組み\n\nコントラクトには 2 種類あります。\n\n- **`Localization`**: `bytes32` のコードから UTF-8 テキストへの単純な参照テーブルで、`textFor(bytes32 code) returns (string)` を公開します。誰でも、言語、方言、詳細度のレベルごとにデプロイできます。\n- **`LocalizationPreferences`**: 各ユーザーが `set(localization)` で好みの `Localization` を登録するプロキシです。その `textFor(code)` は `(bool wasFound, string text)` を返します。\n\n参照のルール:\n\n1. プロキシは、ユーザーが選んだ `Localization` にそのコードを問い合わせます。\n2. それが空文字列を返したら、プロキシは、すべてのキーが埋まっているデフォルトの `Localization` に**必ず**フォールバックし、`wasFound = false` を返します。\n3. そうでなければ、`wasFound = true` とともにそのテキストを返します。\n\nこのフラグにより、UI は、メッセージが別の言語で表示されている理由を説明できます。\n\n文字列は、C の `printf` 形式（`%s`、`%d`）のテンプレートにできます。2 つ以上の引数を持つメッセージでは、言語によって語順が異なるため、位置指定パラメータ（`%1$s`、`%2$s`）を使うべきです。仕様は、テンプレートと引数を別々に返し、補間はオフチェーンで行うことを推奨しています。\n\n`bytes32` のキーが使われるのは、EVM のワードサイズに合うからです。ERC-1066 の `bytes1` のような小さなコードは、その中にそのまま収まります。\n\n## サンプルコード\n\n最小限の `Localization` と、プリファレンスのプロキシを通じたオフチェーンでの参照（ethers v6）:\n\n```solidity\n// SPDX-License-Identifier: MIT\npragma solidity ^0.8.20;\n\ncontract JapaneseMessages {\n    mapping(bytes32 =\u003e string) private text;\n\n    constructor() {\n        text[bytes32(uint256(0x10))] = unicode\"拒否されました\";\n        text[bytes32(uint256(0x11))] = unicode\"承認されました\";\n    }\n\n    function textFor(bytes32 code) external view returns (string memory) {\n        return text[code]; // \"\" means not translated -\u003e proxy falls back\n    }\n}\n```\n\n```ts\nimport { Contract, JsonRpcProvider, zeroPadValue } from \"ethers\";\n\nconst provider = new JsonRpcProvider(process.env.RPC_URL);\nconst prefs = new Contract(\n  process.env.PREFS_ADDRESS!,\n  [\"function textFor(bytes32) view returns (bool, string)\"],\n  provider,\n);\n\nconst code = zeroPadValue(\"0x11\", 32);\nconst [wasFound, template] = await prefs.textFor(code);\nconsole.log(wasFound ? template : `${template} (fallback language)`);\n```\n\n## 知っておくべきこと\n\n- ステータスは **Stagnant** です。共有された、広く使われるローカライゼーションのレジストリは生まれませんでした。\n- 仕様は、`set` で `tx.origin` を登録するユーザーとして扱うことを提案しています。`tx.origin` に頼ることは一般に推奨されず、スマートコントラクトウォレットでは機能しません。\n- 多くの文字列をオンチェーンに保存するのはコストがかかります。仕様はオフチェーン保存も検討しましたが、テキストが常に利用可能で `revert` メッセージにも使えるよう、オンチェーンのテキストを選びました。\n- グローバルなレジストリは義務づけられていません。プロジェクトは独自のプロキシを運用することも、共通のものを共有することもできます。\n"},"ko":{"lang":"ko","tldr":"기계 코드(bytes32 키, enum, 상태 코드)를 사용자가 선호하는 언어의 사람이 읽을 수 있는 텍스트로 바꿔 주는 온체인 시스템. 번역이 없을 때도 보장된 폴백이 있다.","tags":["localization","i18n","ux","messages","erc"],"related":[1066],"updated":"2026-10-19","url":"https://eips.huatuo.xyz/ko/eip-1444/","markdown":"## 어떤 문제를 해결하나요?\n\n컨트랙트는 결과를 불리언, enum, [ERC-1066](/eip-1066/) 같은 상태 코드, 또는 하드코딩된 영어 `revert` 문자열처럼 간결한 기계용 값으로 전달합니다. 원시 코드는 사용자에게 불친절하고, 영어뿐인 문자열은 세계의 일부에게만 도움이 됩니다.\n\nERC-1444는 누구나 이런 코드의 번역을 온체인에 게시할 수 있게 하고, 각 사용자가 원하는 번역을 고를 수 있게 합니다. 그러면 컨트랙트나 프론트엔드는 같은 기반 코드에 대해 \"Insufficient funds\", \"잔액 부족\", 또는 쉽게 풀어 쓴 설명을 보여 줄 수 있습니다.\n\n## 어떻게 동작하나요?\n\n컨트랙트는 두 종류가 있습니다.\n\n- **`Localization`**: `bytes32` 코드에서 UTF-8 텍스트로 가는 단순한 조회 테이블로, `textFor(bytes32 code) returns (string)`을 노출합니다. 누구나 언어, 방언, 상세 수준별로 배포할 수 있습니다.\n- **`LocalizationPreferences`**: 각 사용자가 `set(localization)`으로 선호하는 `Localization`을 등록하는 프록시입니다. 이 프록시의 `textFor(code)`는 `(bool wasFound, string text)`를 반환합니다.\n\n조회 규칙:\n\n1. 프록시는 사용자가 선택한 `Localization`에 코드를 요청합니다.\n2. 빈 문자열이 반환되면 프록시는 모든 키가 채워진 기본 `Localization`으로 **반드시** 폴백하고 `wasFound = false`를 반환합니다.\n3. 그렇지 않으면 `wasFound = true`와 함께 텍스트를 반환합니다.\n\n이 플래그 덕분에 UI는 메시지가 다른 언어로 나타나는 이유를 설명할 수 있습니다.\n\n문자열은 C `printf` 스타일(`%s`, `%d`) 템플릿일 수 있습니다. 인자가 둘 이상인 메시지는 언어마다 어순이 다르므로 위치 매개변수(`%1$s`, `%2$s`)를 써야 합니다. 명세는 템플릿과 인자를 따로 반환하고 보간은 오프체인에서 하라고 권장합니다.\n\n`bytes32` 키를 쓰는 이유는 EVM 워드 크기와 맞기 때문입니다. ERC-1066의 `bytes1`처럼 더 작은 코드는 그 안에 그대로 들어갑니다.\n\n## 샘플 코드\n\n최소한의 `Localization`과 선호도 프록시를 통한 오프체인 조회(ethers v6):\n\n```solidity\n// SPDX-License-Identifier: MIT\npragma solidity ^0.8.20;\n\ncontract JapaneseMessages {\n    mapping(bytes32 =\u003e string) private text;\n\n    constructor() {\n        text[bytes32(uint256(0x10))] = unicode\"拒否されました\";\n        text[bytes32(uint256(0x11))] = unicode\"承認されました\";\n    }\n\n    function textFor(bytes32 code) external view returns (string memory) {\n        return text[code]; // \"\" means not translated -\u003e proxy falls back\n    }\n}\n```\n\n```ts\nimport { Contract, JsonRpcProvider, zeroPadValue } from \"ethers\";\n\nconst provider = new JsonRpcProvider(process.env.RPC_URL);\nconst prefs = new Contract(\n  process.env.PREFS_ADDRESS!,\n  [\"function textFor(bytes32) view returns (bool, string)\"],\n  provider,\n);\n\nconst code = zeroPadValue(\"0x11\", 32);\nconst [wasFound, template] = await prefs.textFor(code);\nconsole.log(wasFound ? template : `${template} (fallback language)`);\n```\n\n## 알아둘 점\n\n- 상태는 **Stagnant**입니다. 공유되고 널리 쓰이는 현지화 레지스트리는 등장하지 않았습니다.\n- 명세는 `set`에서 `tx.origin`을 등록하는 사용자로 취급하자고 제안합니다. `tx.origin`에 의존하는 것은 일반적으로 권장되지 않으며 스마트 컨트랙트 지갑에서는 동작하지 않습니다.\n- 많은 문자열을 온체인에 저장하는 것은 비용이 큽니다. 명세는 오프체인 저장도 따져 보았지만, 텍스트가 항상 사용 가능하고 `revert` 메시지에도 쓸 수 있도록 온체인 텍스트를 택했습니다.\n- 전역 레지스트리는 강제되지 않습니다. 프로젝트는 자체 프록시를 운영하거나 공통 프록시를 공유할 수 있습니다.\n"},"zh":{"lang":"zh","tldr":"一个链上系统，把机器码（bytes32 键、枚举、状态码）转换成每位用户偏好语言的人类可读文本，并在没有翻译时保证有后备文本。","tags":["localization","i18n","ux","messages","erc"],"related":[1066],"updated":"2026-10-19","url":"https://eips.huatuo.xyz/zh/eip-1444/","markdown":"## 它解决什么问题？\n\n合约用紧凑的机器值来传达结果：布尔值、枚举、[ERC-1066](/eip-1066/) 这样的状态码，或者硬编码的英文 `revert` 字符串。原始代码对用户不友好，而纯英文字符串只服务于世界的一部分。\n\nERC-1444 让任何人都可以在链上发布这些代码的翻译，并让每位用户选择自己想要的翻译。这样，合约或前端就可以针对同一个底层代码显示“Insufficient funds”、“余额不足”或一段通俗的解释。\n\n## 它如何运作\n\n有两种合约：\n\n- **`Localization`**：从 `bytes32` 代码到 UTF-8 文本的简单查找表，公开 `textFor(bytes32 code) returns (string)`。任何人都可以按语言、方言或详细程度部署一个。\n- **`LocalizationPreferences`**：一个代理，每位用户通过 `set(localization)` 登记自己偏好的 `Localization`。它的 `textFor(code)` 返回 `(bool wasFound, string text)`。\n\n查找规则：\n\n1. 代理向用户选择的 `Localization` 查询该代码。\n2. 如果返回空字符串，代理**必须**回退到一个填满所有键的默认 `Localization`，并返回 `wasFound = false`。\n3. 否则，返回该文本，并令 `wasFound = true`。\n\n这个标志让 UI 可以解释消息为什么以另一种语言显示。\n\n字符串可以是 C `printf` 风格（`%s`、`%d`）的模板。带有两个或更多参数的消息应使用位置参数（`%1$s`、`%2$s`），因为不同语言的语序不同。规范建议把模板和参数分开返回，并在链下做插值。\n\n使用 `bytes32` 键是因为它与 EVM 字长一致。较小的代码，例如 ERC-1066 的 `bytes1`，可以直接放进去。\n\n## 示例代码\n\n一个最小的 `Localization`，以及通过偏好代理进行的链下查找（ethers v6）：\n\n```solidity\n// SPDX-License-Identifier: MIT\npragma solidity ^0.8.20;\n\ncontract JapaneseMessages {\n    mapping(bytes32 =\u003e string) private text;\n\n    constructor() {\n        text[bytes32(uint256(0x10))] = unicode\"拒否されました\";\n        text[bytes32(uint256(0x11))] = unicode\"承認されました\";\n    }\n\n    function textFor(bytes32 code) external view returns (string memory) {\n        return text[code]; // \"\" means not translated -\u003e proxy falls back\n    }\n}\n```\n\n```ts\nimport { Contract, JsonRpcProvider, zeroPadValue } from \"ethers\";\n\nconst provider = new JsonRpcProvider(process.env.RPC_URL);\nconst prefs = new Contract(\n  process.env.PREFS_ADDRESS!,\n  [\"function textFor(bytes32) view returns (bool, string)\"],\n  provider,\n);\n\nconst code = zeroPadValue(\"0x11\", 32);\nconst [wasFound, template] = await prefs.textFor(code);\nconsole.log(wasFound ? template : `${template} (fallback language)`);\n```\n\n## 需要注意\n\n- 状态为 **Stagnant**。没有出现共享的、被广泛使用的本地化注册表。\n- 规范建议在 `set` 中把 `tx.origin` 视为登记的用户。依赖 `tx.origin` 通常不被提倡，而且对智能合约钱包不起作用。\n- 在链上存储大量字符串成本很高。规范权衡过链下存储，但选择了链上文本，以便它始终可用，并可用于 `revert` 消息。\n- 不强制要求全局注册表：项目可以运行自己的代理，也可以共用通用的代理。\n"}}}
