Skip to content

Commit

Permalink
docs: updating translate doc with project-dir option
Browse files Browse the repository at this point in the history
  • Loading branch information
TaylorKrusen committed Sep 5, 2024
1 parent 4f75b4f commit aa1d8f6
Showing 1 changed file with 40 additions and 6 deletions.
46 changes: 40 additions & 6 deletions docs/commands/translate.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,13 @@ redocly translate --version

## Options

| Option | Type | Description |
| --------------- | ------- | -------------------------------------------------------------------------------------------------------------------------------------- |
| `locale` | string | **REQUIRED** Name of a locale folder, inside your project's `l10n` directory, to generate translations for. Use `all` for all locales. |
| `--lint-config` | string | Severity level for config file linting. Possible values: `warn`, `error`, `off`. Defaults to `warn`. |
| `--help` | boolean | Show help. |
| `--version` | boolean | Show version number. |
| Option | Type | Description |
| --------------------- | ------- | -------------------------------------------------------------------------------------------------------------------------------------- |
| `locale` | string | **REQUIRED** Name of a locale folder, inside your project's `l10n` directory, to generate translations for. Use `all` for all locales. |
| `--lint-config` | string | Severity level for config file linting. Possible values: `warn`, `error`, `off`. Defaults to `warn`. |
| `--project-dir`, `-d` | string | Specifies the project folder to execute `translate` command in. Used for managing multiple projects. |
| `--help` | boolean | Show help. |
| `--version` | boolean | Show version number. |

## Examples

Expand Down Expand Up @@ -69,6 +70,39 @@ your-awesome-project
└── ...
```

### Populate translation keys in a specific project

Use the `--project-dir` option to run the `translate` command from a parent folder and populate translation keys inside a specific project:

```bash
redocly translate all --project-dir='museum-docs'
```

The following project structure represents the output of running this command from the `projects` folder:

```treeview {% title="Multiple projects in same folder" %}
projects/
├── storage-docs/
├── authentication-docs/
└── museum-docs/
├── @l10n/
│ ├── es-ES/
│ │ ├── transcriptions.yaml
│ │ └── ...
│ ├── fr/
│ │ ├── transcriptions.yaml
│ │ └── ...
│ └── nl-NL/
│ ├── transcriptions.yaml
│ └── ...
├── index.md
├── sidebars.md
├── redocly.yaml
└── ...
```

The `--project-dir` option is designed to help manage multiple projects by reducing the need for traversal.

## Tips for using `translate`

- The command is additive; it doesn't overwrite existing translation keys.
Expand Down

0 comments on commit aa1d8f6

Please sign in to comment.