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

load-phraseapp-translations

Package Overview
Dependencies
Maintainers
2
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

load-phraseapp-translations

Download PhraseApp translation files for your app. Default format is i18n-node-2 compliant.

  • 0.2.5
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
2
Created
Source

Build Status

load-phraseapp-translations

npm module for pulling down translation files from PhraseApp for a project using the v2 API. For use in build scripts.

Installation

npm install load-phraseapp-translations --save

Usage

var loadTranslations = require('load-phraseapp-translations');

loadTranslations.initialize({
  access_token: 1,
  project_id: 1,
  location: __dirname + '/locales'
});

> Translation for de downloaded successfully.
> Translation for en downloaded successfully.

Arguments

Options (required)
  • access_token: Required. Your PhraseApp access token.
  • project_id: Required. The ID of the project you want to pull down translations for.
  • location: Optional, defaults to current directory. If supplied, must be an existing path.
  • file_format: Optional, defaults to node_json, the format for i18n-node-2.
  • file_extension: Optional, defaults to js.
  • transform: Optional function that should be called with each locale's data if additional processing is required before it is saved. Takes a string containing the data from Phrase and should return a string containing the new data. Defaults to a no-op.
Callback

Initialize also accepts an optional callback that returns an error and a success response.

var loadTranslations = require('load-phraseapp-translations');

loadTranslations.initialize({
  access_token: 1,
  project_id: 1,
  location: __dirname + '/locales'
}, function(err, res) {
    if (!err) {
    // Do something
    }
    // Do something else
});

Tests

npm test

Release History

  • 0.1.1 Cleaned up unused dependencies; fixed erroneous API call.
  • 0.1.0 Initial release

Keywords

FAQs

Package last updated on 18 Sep 2015

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