Socket
Book a DemoInstallSign in
Socket

@orbio/language-translator

Package Overview
Dependencies
Maintainers
0
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install
Package was removed
Sorry, it seems this package was removed from the registry

@orbio/language-translator

Tool to translate web ui text to multiple languages

1.0.4
latest
npmnpm
Version published
Weekly downloads
0
Maintainers
0
Weekly downloads
 
Created
Source

Language Translator CLI Tool

Command-line tool for translating web UI text to multiple languages using Playwright and Google Translate. This tool automatically detects text content on web pages and translates it in real-time, making it perfect for testing internationalization (i18n) across different language versions of your applications.

🌟 Features

  • Multi-language Translation: Support for 25+ languages including Arabic, Chinese, Czech, Danish, Dutch, Finnish, French, German, Greek, Hebrew, Hungarian, Italian, Japanese, Norwegian, Polish, Portuguese, Romanian, Slovak, Slovenian, Spanish, Swedish, Turkish, and more
  • Real-time Web Page Translation: Opens multiple browser tabs with translated versions of your web application
  • Smart Text Detection: Automatically identifies visible text nodes, alt attributes, title attributes, and placeholder text
  • Batch Translation: Efficiently translates content in parallel batches to avoid API rate limits
  • Interactive CLI: User-friendly command-line interface with prompts for URL and language selection
  • Project-specific Language Mapping: Configure supported languages per project using languageMap.json

📦 Installation

Prerequisites

  • Node.js (v14 or higher)
  • npm or yarn

Install as a Global Package

npm install -g @orbio/language-translator

🚀 Usage

Global Installation

translate

📋 How It Works

  • URL Input: Enter the URL of the web page you want to translate
  • Language Detection: The tool automatically detects which project configuration to use based on the URL
  • Language Selection: Choose one or more target languages from the available options
  • Browser Launch: Opens multiple browser tabs (one per selected language)
  • Content Translation:
    • Scans the page for all visible text content
    • Translates text nodes, alt attributes, title attributes, and placeholder text
    • Appends language parameter to URL for proper routing
    • Displays a language badge on each translated page
  • Manual Review: Review each translated page and close tabs when finished

⚙️ Configuration

Language Mapping

The tool uses languageMap.json to define which languages are supported for each project. The configuration maps project identifiers (found in URLs) to their supported language codes.

Supported Language Codes

  • ar - Arabic
  • bg - Bulgarian
  • cs - Czech
  • da - Danish
  • de - German
  • el - Greek
  • es - Spanish
  • es-mx - Mexican Spanish
  • fi - Finnish
  • fr - French
  • he - Hebrew
  • hr - Croatian
  • hu - Hungarian
  • it - Italian
  • ja - Japanese
  • nb - Norwegian Bokmål
  • nl - Dutch
  • pl - Polish
  • pt - Portuguese
  • pt-br - Brazilian Portuguese
  • ro - Romanian
  • sk - Slovak
  • sl - Slovenian
  • sv - Swedish
  • tr - Turkish
  • sr - Serbian

🔧 Technical Details

Translation Engine

The tool uses Google Translate as the default translation engine. You can modify the engine in the code:

  • google (default) - Google Translate
  • libre - LibreTranslate
  • deepl - DeepL

Performance Optimizations

  • Parallel Processing: Translates content in batches of 5 items simultaneously
  • Rate Limiting: Includes 250ms delays between batches to respect API limits
  • Error Handling: Gracefully handles translation failures and falls back to original text
  • Memory Management: Efficiently processes large pages without memory issues

🛠️ Dependencies

  • playwright: Browser automation and web page interaction
  • inquirer: Interactive command-line prompts
  • translate: Translation API wrapper for multiple engines

👨‍💻 Author

Dovydas Pečkys

FAQs

Package last updated on 22 Jul 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.