@w3cub/locize-actions

5.1.3 • Public • Published

Travis npm version David

This is an standalone scriot to be used for locize api service.

Getting started

Source can be loaded via npm.

# npm package
$ npm install @w3cub/locize-actions

Options

IMPORTANT make sure you do not add your apiKey in the production build to avoid misuse by strangers

{
  // the id of your locize project
  projectId: '[PROJECTID]',

  // add an api key if you want to send missing keys
  apiKey: '[APIKEY]',

  // the reference language of your project
  referenceLng: '[LNG]',

  // version - defaults to latest
  version: '[VERSION]',

  // debounce interval to send data in milliseconds
  debounceSubmit: 90000,

  // action path formatter
  actionPath: 'https://api.locize.app/{{action}}/{{projectId}}/{{version}}/{{lng}}/{{ns}}',

  // hostnames that are allowed to send last used data
  // please keep those to your local system, staging, test servers (not production)
  allowedHosts: ['localhost']
}

Directly call locizeActions.init:

import locizeActions from "locize-actions";

locizeActions.init(options);

then call used function with namespace and key:

import locizeActions from "locize-actions";

locizeActions.actions('action', "myNamespace", "myKey.as.in.locize", "myKey.as.the.value", (obj)=> {
  // parse function 
  // for missing action
  return Object.keys(obj)
  // 
});

Readme

Keywords

Package Sidebar

Install

npm i @w3cub/locize-actions

Weekly Downloads

3

Version

5.1.3

License

MIT

Unpacked Size

37 kB

Total Files

13

Last publish

Collaborators

  • icai