Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
114 changes: 114 additions & 0 deletions packages/prompts-i18n/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,114 @@
<img width="75px" height="75px" align="right" alt="Inquirer Logo" src="https://raw.githubusercontent.com/SBoudrias/Inquirer.js/main/assets/inquirer_readme.svg?sanitize=true" title="Inquirer.js"/>
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note to self: gotta edit README and adding a contribution guide.


# @inquirer/prompts-i18n

[![npm](https://badge.fury.io/js/@inquirer%2Fprompts-i18n.svg)](https://www.npmjs.com/package/@inquirer/prompts-i18n)

Internationalized Inquirer prompts - 100% drop-in replacements for `@inquirer/prompts` with built-in localization support.

# Installation

<table>
<tr>
<th>npm</th>
<th>yarn</th>
<th>pnpm</th>
<th>bun</th>
</tr>
<tr>
<td>

```sh
npm install @inquirer/prompts-i18n
```

</td>
<td>

```sh
yarn add @inquirer/prompts-i18n
```

</td>
<td>

```sh
pnpm add @inquirer/prompts-i18n
```

</td>
<td>

```sh
bun add @inquirer/prompts-i18n
```

</td>
</tr>
</table>

# Usage

Simply replace your import from `@inquirer/prompts` with a language-specific import:

```js
// Before
import { input, select, confirm } from '@inquirer/prompts';

// After (French)
import { input, select, confirm } from '@inquirer/prompts-i18n/fr';

// After (Spanish)
import { input, select, confirm } from '@inquirer/prompts-i18n/es';
```

All prompts work exactly the same way as the original package. The only difference is that help text, validation messages, and UI labels are automatically translated to your chosen language.

# Supported Languages

- `@inquirer/prompts-i18n/en` - English (default, re-export of original)
- `@inquirer/prompts-i18n/fr` - French
- `@inquirer/prompts-i18n/es` - Spanish
- `@inquirer/prompts-i18n/zh` - Chinese (Simplified)
- `@inquirer/prompts-i18n/pr` - Portuguese

# Example

```js
import { input, confirm, select } from '@inquirer/prompts-i18n/fr';

const name = await input({ message: 'Quel est votre nom ?' });

const confirmed = await confirm({ message: 'Continuer ?' });

const choice = await select({
message: 'Choisissez une option',
choices: [
{ name: 'Option 1', value: 'opt1' },
{ name: 'Option 2', value: 'opt2', disabled: true },
],
});
```

# Available Prompts

All prompts from `@inquirer/prompts` are available:

- `input`
- `select`
- `checkbox`
- `confirm`
- `search`
- `password`
- `expand`
- `editor`
- `number`
- `rawlist`
- `Separator`

See the [@inquirer/prompts documentation](https://github.com/SBoudrias/Inquirer.js/tree/main/packages/prompts) for full usage details.

# License

Copyright (c) 2025 Simon Boudrias (twitter: [@vaxilart](https://twitter.com/Vaxilart))<br/>
Licensed under the MIT license.
124 changes: 124 additions & 0 deletions packages/prompts-i18n/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,124 @@
{
"name": "@inquirer/prompts-i18n",
"version": "0.0.0",
"description": "Internationalized Inquirer prompts - drop-in package with i18n support",
"keywords": [
"answer",
"answers",
"ask",
"base",
"cli",
"command",
"command-line",
"confirm",
"enquirer",
"generate",
"generator",
"hyper",
"input",
"inquire",
"inquirer",
"interface",
"iterm",
"javascript",
"menu",
"node",
"nodejs",
"prompt",
"promptly",
"prompts",
"question",
"readline",
"scaffold",
"scaffolder",
"scaffolding",
"stdin",
"stdout",
"terminal",
"tty",
"ui",
"yeoman",
"yo",
"zsh",
"internationalization",
"i18n",
"localization",
"l10n",
"types",
"typescript"
],
"homepage": "https://github.com/SBoudrias/Inquirer.js/blob/main/packages/prompts-i18n/README.md",
"repository": {
"type": "git",
"url": "https://github.com/SBoudrias/Inquirer.js.git"
},
"license": "MIT",
"author": "Simon Boudrias <[email protected]>",
"sideEffects": false,
"type": "module",
"exports": {
"./package.json": "./package.json",
".": "./src/index.ts",
"./en": "./src/locales/en.ts",
"./fr": "./src/locales/fr.ts",
"./zh": "./src/locales/zh.ts",
"./pr": "./src/locales/pr.ts",
"./es": "./src/locales/es.ts"
},
"files": [
"dist"
],
"dependencies": {
"@inquirer/core": "^11.0.0",
"@inquirer/prompts": "^8.0.0"
},
"devDependencies": {
"@inquirer/testing": "^3.0.0",
"@repo/tsconfig": "workspace:*",
"typescript": "^5.9.3"
},
"engines": {
"node": ">=23.5.0 || ^22.13.0 || ^21.7.0 || ^20.12.0"
},
"peerDependencies": {
"@types/node": ">=18"
},
"peerDependenciesMeta": {
"@types/node": {
"optional": true
}
},
"publishConfig": {
"access": "public",
"exports": {
"./package.json": "./package.json",
".": {
"types": "./dist/index.d.ts",
"default": "./dist/index.js"
},
"./en": {
"types": "./dist/locales/en.d.ts",
"default": "./dist/locales/en.js"
},
"./fr": {
"types": "./dist/locales/fr.d.ts",
"default": "./dist/locales/fr.js"
},
"./zh": {
"types": "./dist/locales/zh.d.ts",
"default": "./dist/locales/zh.js"
},
"./pr": {
"types": "./dist/locales/pr.d.ts",
"default": "./dist/locales/pr.js"
},
"./es": {
"types": "./dist/locales/es.d.ts",
"default": "./dist/locales/es.js"
}
}
},
"scripts": {
"tsc": "tsc"
}
}
Loading
Loading