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

angular-translate-loader-zanata

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

angular-translate-loader-zanata

This is a custom loader for angular translate using zanata backend

  • 0.1.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
0
Maintainers
1
Weekly downloads
 
Created
Source

angular-translate-zanata

This is a custom loader for angular translate with zanata backend

This project is originally based on i18next-node-zanata-backend

Warning : This has only been tested in specific cases and might not suit everyone, do not hesitate to make a PR :)

Usage

Install it using yarn or npm :

$ yarn add angular-translate-loader-zanata
$ npm install angular-translate-loader-zanata --save

Then in your angular project :

...
import angularTranslateLoaderZanata from 'angular-translate-loader-zanata';

angular.module('yourApp', [ ..., angularTranslateLoaderZanata ])
...
.config(($translateProvider) => {
  ...
  $translateProvider.use('translateZanataLoader', options);
  ...
})
...

Options

The options are :

{
  // url to the Zanata server
  url: 'https://translate.zanata.org', (default to 'https://translate.zanata.org')

  // Username for Zanata
  username: 'username',

  // API key for Zanata
  apiKey: 'API key',

  // project name
  projectId: 'project id in zanata',

  // project version
  versionId: 'version',

  // document id
  docId: 'docId'
}

Configure Zanata and make it run

In order to make it run, you need to enable CORS in your instance, add the following property :

<property name="zanata.origin.whitelist" value="http://our-domain" />

It has been tested on zanata version 4.1.0 using the docker image. Please see the repo for details.

Because Zanata does not support i18next JSON format (yet ?), the following i18next format :

{
  NAMESPACE: {
    key: 'value'
  }
}

Is obtained from a po file like this :

msgid="NAMESPACE##key"
msgstr="value"

Be careful we uploading your documents. One thing you could do is use the gulp-angular-translate-extract module in combinaison with i18next-conv to generate the po files.

License

MIT

FAQs

Package last updated on 18 Jun 2017

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