New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

react-locomigo

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-locomigo

React SDK for Locomigo localization

latest
npmnpm
Version
1.1.0
Version published
Maintainers
1
Created
Source

react-locomigo

React SDK for Locomigo localization platform.

Installation

npm install react-locomigo

Usage

import locomigo from "react-locomigo";

// Initialize with default options - automatically extracts all text from DOM
locomigo.initialize();

// Initialize with custom options
locomigo.initialize({
  locale: "es-ES",
  supportedLocales: ["en-US", "es-ES", "fr-FR"],
  realtime: false,
});

// Access extracted texts and translation matrix
const extractedTexts = locomigo.getExtractedTexts();
const translations = locomigo.getTranslations();

console.log("Extracted texts:", extractedTexts);
console.log("Translation matrix:", translations);

Features

Auto Text Extraction

When you call locomigo.initialize(), the SDK automatically:

  • Scans the DOM for text content in common elements (p, h1-h6, span, button, a, label, li)
  • Extracts and deduplicates all translatable text
  • Creates a translation matrix with the current locale
  • Excludes non-translatable content (numbers, symbols, very short text)

Available Methods

  • locomigo.initialize(options) - Initialize SDK and auto-extract DOM text
  • locomigo.getExtractedTexts() - Returns array of all extracted text strings
  • locomigo.getTranslations() - Returns translation matrix (keys = text, values = locale translations)

Options

  • locale (string, default: 'en-US') - The default locale
  • supportedLocales (string[], default: []) - Array of supported locales (will be synced from platform in future)
  • realtime (boolean, default: true) - Enable realtime updates (will be implemented in future)

TypeScript Support

This package includes TypeScript definitions.

import locomigo, { LocomigOptions } from "react-locomigo";

const options: LocomigOptions = {
  locale: "en-US",
  supportedLocales: ["en-US", "es-ES"],
  realtime: true,
};

locomigo.initialize(options);

Keywords

react

FAQs

Package last updated on 23 Jun 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