Quick Start
The fastest way to run Loco — no cloning required.
Option A: npx (no install)
npx @hkonda/loco-translate
Option B: global install
npm install -g @hkonda/loco-translate
loco
On first run the terminal prints your dashboard URL, CDN snippet, and API key:
🌐 Loco Translation Manager
Dashboard : http://<your-ip>:6101/dashboard/
CDN script: http://<your-ip>:6101/cdn/loco.js
API key : <auto-generated>
Steps
1. Open the Dashboard
Navigate to the Dashboard URL printed in your terminal.
2. Add the snippet to your page
Copy the <script> tags and paste them into any HTML page. Add Loco.widget() to give users a floating language picker right out of the box — no extra configuration needed:
<script src="http://<your-ip>:6101/cdn/loco.js"></script>
<script>
Loco.init({
apiUrl: 'http://<your-ip>:6101',
apiKey: '<your-key>'
});
// Floating language switcher — users can switch language immediately
Loco.widget({ position: 'bottom-right' });
</script>
When the page loads, Loco discovers all text and sends it to the dashboard as Pending items. The widget appears in the corner and lets users pick from any language you've translated.
3. Translate
- In the dashboard, go to the Pending tab and approve phrases you want to translate
- Switch to Approved, then click AI Translate (requires a BlueHive API key) or edit manually
- The widget automatically reflects new translations — no page reload required
4. Programmatic control (optional)
You can also trigger translations in code:
<script>
Loco.init({ apiUrl: '...', apiKey: '...' });
Loco.apply('fr'); // swap text to French programmatically
</script>
CLI options
Options:
-p, --port <number> Port to listen on (default: 6101)
-d, --data-dir <path> Directory for loco.db (default: .loco/ in cwd)
-h, --help Show this help message
Environment variables
| Variable | Default | Description |
|---|---|---|
PORT | 6101 | Server port |
LOCO_DATA_DIR | .loco/ in cwd | Directory where loco.db is stored |
BASE_PATH | (empty) | URL prefix for reverse-proxy deployments |
BLUEHIVE_API_KEY | (none) | BlueHive key for AI translations |
PUBLIC_URL | (auto) | Override the printed public URL |