New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@runeai/hermes

Package Overview
Dependencies
Maintainers
3
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@runeai/hermes

Hermes provides utility functions that help automate the machine translation workflow. It doesn't perform any extraction for strings to be translated, handle resolving human & machine translations, nor logic for when files should be committed.

  • 1.1.2
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
24
decreased by-60.66%
Maintainers
3
Weekly downloads
 
Created
Source
Usage

Hermes provides utility functions that help automate the machine translation workflow. It doesn't perform any extraction for strings to be translated, handle resolving human & machine translations, nor logic for when files should be committed.

const trSync = require("@runeai/hermes")

;(async function() {
  await trSync({
    "languageData": {
      "15": { "iso6391code": "zh", "crowdinLocaleCode": "zh-CN" },
      "17": { "iso6391code": "es", "crowdinLocaleCode": "es-ES" },
      "22": { "iso6391code": "ru", "crowdinLocaleCode": "ru" },
    },
    "filePaths": ["translations/en/messages.po"],
    "crowdinInfo": {
      "projectName": "superawesomeproject",
      "apiKey": "xxxxxxxxx"
    },
    "processables": [
      { "phrase": "Friend Boost", "processor": "lowercase" },
      { "phrase": "Quick Match", "processor": "lowercase" }
    ]
  })
})()
How it works
  1. The function will first create a copy of the provided file paths. This is the source of truth to help ensure integrity of original strings after the processing step.
  2. If processables are provided, the function will match the phrase in any locale files and process it by one of the predetermined processors (see list below).
  3. Update the source file in Crowdin, so any strings added/modified will be there ready to be translated.
  4. Next, it'll machine translate the files using Google translate into the specified locales in the languageData payload when invoked.
  5. When translations are done, the function will download all files into their respective locale folder, based on the language's ISO 639-1 code.
  6. Finally, it'll replace all message strings to the original and clean up any of the copies made in the first step.
Existing list of processors

lowercase - lowercases the entire string ...more to come!

FAQs

Package last updated on 22 Nov 2023

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