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

@omnicar/sam-translate

Package Overview
Dependencies
Maintainers
1
Versions
14
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@omnicar/sam-translate

Handles fetching translations, looking up individual translations, and error reporting of missing translations

  • 1.0.0
  • latest
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

SAM-translate

Client js library for fetching translations in a given format (see ILocaleTranslation), translating strings, and reporting issues when found.

Installation (for development)

yarn or npm i (examples below are using yarn)

Installation on clients

yarn add OmniCar/sam-translate#0.0.1

Where #0.0.1 indicates the Github release tag.

Usage

First call the init function with the parameters that match your environment (dev/staging/prod etc.) or current needs.

These parameters are available:

  • translationFileUrl - endpoint from where to fetch the translations
  • errorCallback - function used for reporting errors. Defaults to window.alert
  • notify - whether the library should report errors to an endpoint (see below)
  • notificationEndpoint - endpoint for POSTing errors
  • cache - whether the library should use cache expiration (see below)
  • cacheExpirationTime - cache expiration time for local storage
  • useLocalStorage - whether the library should save translations to localStorage
  • locale - the locale to use. Defaults to the first one from the received translations

Tests

To run jest tests either run:

yarn test

or to run tests in watch mode run:

yarn test-watch

Compile application (tsc):

yarn tsc

FAQs

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