Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@steadycursor/i18n-gpt-translate

Package Overview
Dependencies
Maintainers
0
Versions
18
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@steadycursor/i18n-gpt-translate

A CLI tool for translating internationalization (i18n) json files using Open AI.

  • 1.1.3
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
33
decreased by-29.79%
Maintainers
0
Weekly downloads
 
Created
Source

i18n-gpt-translate

A CLI tool for translating internationalization (i18n) json files using Open AI.

Run with script with command i18n-gpt-translate.

preview

Features

  • Automatically translates missing keys and and also it translate values, where value is empty ("").
  • Translate as many json files for as many languages as you wish.
  • You do not need to specify what languages do you have, script will automatically detect it.

Options

  • --localesPath (required) - path to folder, where your locales folders (en, fr, it, etc.) exists.
  • --defaultLanguage (required) - default language, that will be used as source for translation. This has to be one of the folders of --localesPath.
  • --token (required) - ChatGPT token, that you can generate here.

Installation

npm install @steadycursor/i18n-gpt-translate

Example Usage

i18n-gpt-translate run --localesPath=./tests/working/locales --defaultLanguage=en --token=YOUR_TOKEN_HERE

Demo

Before running script

# /locales/en/common.json
{
  "AccountsCommandPalette": {
    "inputPlaceholder": "Account name...",
    "noResults": {
      "title": "No results found"
    }
  },
  "AccountSetting": {
    "enableDeviceSosImporter": {
      "card": {
        "description": "This setting affects whether devices available on platform will be automatically registered in this CMS.",
        "title": "Setting up automatic device importing"
      }
    }
  }
}
# /locales/cs/common.json
{
  "AccountsCommandPalette": {
    // 👉 missing key inputPlaceholder with translation
    "noResults": {
      "title": "Nebyly nalezeny žádné výsledky"
    }
  },
  "AccountSetting": {
    "enableDeviceSosImporter": {
      "card": {
        "description": "", // 👈 translation is missing, value is empty
        "title": "Nastavení automatického importu zařízení"
      }
    }
  }
}

After running script

# /locales/cs/common.json
{
  "AccountsCommandPalette": {
    "inputPlaceholder": "Název účtu...", 👈
    "noResults": {
      "title": "Nebyly nalezeny žádné výsledky"
    }
  },
  "AccountSetting": {
    "enableDeviceSosImporter": {
      "card": {
        "description": "Toto nastavení ovlivňuje, zda zařízení dostupná na platformě budou automaticky registrována v tomto CMS.", 👈
        "title": "Nastavení automatického importu zařízení"
      }
    }
  }
}

FAQs

Package last updated on 17 Jul 2024

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

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc