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

ab-translate

Package Overview
Dependencies
Maintainers
1
Versions
600
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ab-translate

Quickly create ab tests for texts without coding via [Wix Babel](https://bo.wix.com/wix-babel-webapp/babel).

  • 1.0.0
  • npm
  • Socket score

Version published
Weekly downloads
110
decreased by-19.71%
Maintainers
1
Weekly downloads
 
Created
Source

ab-translate

Quickly create ab tests for texts without coding via Wix Babel.

Installation - Yoshi

  1. Install the package npm i ab-translate --save
  2. Save the petri experiments object to the window (e.g. window.__EXPERIMENTS__ = '<%= experiments %>';)
  3. In the src/i18n.js file add the following code to the backend task
import abTranslate from 'ab-translate';
.
.
.
backend: {
  crossDomain: true,
  parse: function(translations) {
    try {
      return = abTranslate(JSON.parse(window.__EXPERIMENTS__), JSON.parse(translations));
    } catch (e) {
      return translations;
    }
  }
}

Installation - Other Configurations

  1. Install the package npm i ab-translate --save
  2. In a location where both the experiments and the translations json are available, use the abTranslate function to convert the regular translations json to a modified one that includes the experiments results
import abTranslate from 'ab-translate';
.
.
.
window.abTranslations = abTranslate(window.experiments, window.translations);
strValue = window.abTranslations[strKey];

Usage

FAQs

Package last updated on 18 Sep 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