# Lingo.dev Localizer (`igolaizola/lingo-dev-localizer`) Actor

Translate a single JSON/YAML/plain-text file into multiple languages using lingo.dev. Provide a URL, upload, or paste content and get one dataset row per language with translated text or a download URL. Perfect for fast i18n workflows, CI automation, and asset localization.

- **URL**: https://apify.com/igolaizola/lingo-dev-localizer.md
- **Developed by:** [Iñigo Garcia Olaizola](https://apify.com/igolaizola) (community)
- **Categories:** Developer tools, Automation, Integrations
- **Features:** Limited permissions
- **Stats:** 1 total users, 0 monthly users, 0.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

Pay per usage

This Actor is paid per platform usage. The Actor is free to use, and you only pay for the Apify platform usage, which gets cheaper the higher subscription plan you have.

Learn more: https://docs.apify.com/actors/running/actors-in-store.md#pay-per-usage

## What's an Apify Actor?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For examples already wired to this Actor's own input schema, see the [API](#api) section below.

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).

# README

## Lingo.dev Localizer

### 🤖 What does Lingo Localizer do?

Lingo Localizer translates a **single file** (JSON/YAML/plain text) or **pasted content** using the **lingo.dev CLI**.
It produces one translated file per target language and stores the results in the dataset.

**Two input modes:**

- **URL / Upload**: The actor downloads the file, translates it, stores each translated file in the default key‑value store, and writes dataset rows with URLs.
- **Direct content**: The actor translates the pasted content and stores the translated content directly in dataset rows.

### 🚀 How to use the actor

1. **Choose an input source**
   - URL, Upload, or Direct content.
2. **Set source and target languages**
   - Example: source `en`, targets `es`, `fr`.
3. **Run the actor**
   - One dataset row is created per target language.

### 💡 Use cases

- **App UI strings** stored in JSON/YAML for web or mobile projects.
- **Videogame text packs** and in‑game dialog files.
- **Backend/email templates** kept as plain text snippets.
- **Marketing copy** and product descriptions.
- **Help center / FAQ content** managed as flat files.
- **Configuration-driven prompts** for AI assistants in multiple languages.

### 📝 Input parameters

| Parameter         | Type   | Required      | Description                                                                      |
| ----------------- | ------ | ------------- | -------------------------------------------------------------------------------- |
| `inputSource`     | String | Yes           | `url`, `upload`, or `content`.                                                   |
| `inputUrl`        | String | Conditionally | Public URL to a single JSON/YAML/plain-text file. Required if `inputSource=url`. |
| `inputUpload`     | String | Conditionally | Upload a single JSON/YAML/plain-text file. Required if `inputSource=upload`.     |
| `inputContent`    | String | Conditionally | Paste content directly. Required if `inputSource=content`.                       |
| `sourceLanguage`  | String | Yes           | Source language code (e.g., `en`).                                               |
| `targetLanguages` | Array  | Yes           | Target language codes (e.g., `es`, `fr`).                                        |
| `lingoCommand`    | String | No            | `run` (default) or `i18n`.                                                       |
| `lingoArgs`       | Array  | No            | Additional CLI arguments.                                                        |
| `lingoApiKey`     | String | Yes           | lingo.dev API key used for authentication.                                       |

Example input (URL):

```json
{
  "inputSource": "url",
  "inputUrl": "https://example.com/messages.json",
  "sourceLanguage": "en",
  "targetLanguages": ["es", "fr"],
  "lingoApiKey": "your_api_key"
}
```

Example input (Content):

```json
{
  "inputSource": "content",
  "inputContent": "Hello world",
  "sourceLanguage": "en",
  "targetLanguages": ["es"],
  "lingoApiKey": "your_api_key"
}
```

### 📦 Output

The dataset always has **one row per target language**.

**If input source is URL/Upload**, each row includes a URL to the translated file:

```json
{
  "language": "es",
  "url": "https://api.apify.com/v2/key-value-stores/.../records/OUTPUT_ES"
}
```

**If input source is Content**, each row includes translated text:

```json
{
  "language": "es",
  "content": "Hola mundo"
}
```

# Actor input Schema

## `lingoApiKey` (type: `string`):

API key used by lingo.dev CLI.

## `sourceLanguage` (type: `string`):

Source language code (e.g., en).

## `targetLanguages` (type: `array`):

Target language codes (e.g., es, fr).

## `inputSource` (type: `string`):

Where the input file should be loaded from.

## `inputUrl` (type: `string`):

Public URL to a single JSON/YAML/plain-text file.

## `inputUpload` (type: `string`):

Upload a single JSON/YAML/plain-text file. Apify will turn it into a URL.

## `inputContent` (type: `string`):

Paste content directly (single-file mode).

## `lingoCommand` (type: `string`):

Command to execute within the lingo.dev CLI.

## `lingoArgs` (type: `array`):

Additional arguments passed to the lingo.dev CLI.

## Actor input object example

```json
{
  "sourceLanguage": "en",
  "targetLanguages": [
    "es"
  ],
  "inputSource": "content",
  "inputContent": "Paste here the content you want to translate.",
  "lingoCommand": "run"
}
```

# Actor output Schema

## `results` (type: `string`):

No description

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {
    "sourceLanguage": "en",
    "targetLanguages": [
        "es"
    ],
    "inputContent": "Paste here the content you want to translate."
};

// Run the Actor and wait for it to finish
const run = await client.actor("igolaizola/lingo-dev-localizer").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = {
    "sourceLanguage": "en",
    "targetLanguages": ["es"],
    "inputContent": "Paste here the content you want to translate.",
}

# Run the Actor and wait for it to finish
run = client.actor("igolaizola/lingo-dev-localizer").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
for item in client.dataset(run.default_dataset_id).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "sourceLanguage": "en",
  "targetLanguages": [
    "es"
  ],
  "inputContent": "Paste here the content you want to translate."
}' |
apify call igolaizola/lingo-dev-localizer --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,igolaizola/lingo-dev-localizer"
        }
    }
}
```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/HuVx04O5CpQ28E6DV/builds/5s1LGQT7s8zoVBpzh/openapi.json
