Product
Socket Now Supports uv.lock Files
Socket now supports uv.lock files to ensure consistent, secure dependency resolution for Python projects and enhance supply chain security.
ab-translate
Advanced tools
Quickly create AB Tests for texts without coding via [Wix Babel](https://bo.wix.com/wix-babel-webapp/babel) & [Guineapig](https://guineapig.wix.com/home).
Quickly create AB Tests for texts without coding via Wix Babel & Guineapig.
The process requries two simple steps:
Do this once, for each project that you want to run translations tests in
npm i ab-translate --save
or yarn add ab-translate
package.json
file (example):"yoshi": {
"petriSpecs": {
onlyForLoggedInUsers: false, // default: true
scopes: ['my-projects-translation-scope'] // default: [<artifactId>]
}
}
window.__EXPERIMENTS__ = '<%= experiments %>';
). Notice: make sure that you conduct the experiments for the scope in step #2src/i18n.js
file add the following code to the backend task (example)import abTranslate from 'ab-translate/dist/src/abTranslate-runtime';
backend: {
crossDomain: true,
parse: translations => {
try {
return abTranslate(window.__EXPERIMENTS__, JSON.parse(translations));
} catch (e) {
return translations;
}
}
}
middleware-i18n.js
instead, see example herebower install ab-translate --save
Gruntfile.js
file:grunt.modifyTask('petriExperiments', {
options: {
onlyForLoggedInUsers: false, // default: true
scopes: ['my-projects-translation-scope'] // default: [<artifactId>]
}
});
abTranslateProvider
to your index.vm
file (example)<script src="bower_components/ab-translate/abTranslate.angular-runtime.bundle.min.js"></script>
abTranslateProvider
and the project's experimentManagerProvider
(example). Notice: make sure that you conduct the experiments for the scope in step #2angular.module('myApp', ['wix.ab-translate'])
.config(function($translateProvider, abTranslateProvider, experimentManagerProvider) {
const preferredLanguage = $translateProvider.preferredLanguage();
const translations = $translateProvider.translations()[preferredLanguage];
const translationsWithExperiments = abTranslateProvider.abTranslate.default(
experimentManagerProvider.experiments,
translations
);
$translateProvider.translations(preferredLanguage, translationsWithExperiments);
});
Current Project
dropdown and select the Update
tab
Edit
button
Create AB Test
button at the bottom of the modal
my-projects-translation-scope
is the one defined in package.json
-> yoshi
-> petriScopes
(or artifact id by default).Set
button. A 🔀 sign should appear next to your key.Commit
button.
specs.abTranslate.<scope>.<key>
.Note1: When creating the experiment verify that you open it only for the languages where the keys were updated Note2: If the experiment is paused/killed/theres a bug in the system the first alternative (String #0) will be chosen so there shouldn't be any risks with this mechanism.
Unfurtunately, at the moment there's no Quick Merge
button that allows you to select the winning text. We'll work on one once the demand will rise. In the mean time you can simply set all the alternatives to the same text, close the experiments, and finally ask your dev to remove the unnecessary keys.
Creating an experiment in other languages is possible, however there's a few things you should keep in mind:
FAQs
Quickly create AB Tests for texts without coding via [Wix Babel](https://bo.wix.com/wow/babel) & [Guineapig (Petri)](https://bo.wix.com/petri).
The npm package ab-translate receives a total of 685 weekly downloads. As such, ab-translate popularity was classified as not popular.
We found that ab-translate demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 8 open source maintainers collaborating on the project.
Did you know?
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.
Product
Socket now supports uv.lock files to ensure consistent, secure dependency resolution for Python projects and enhance supply chain security.
Research
Security News
Socket researchers have discovered multiple malicious npm packages targeting Solana private keys, abusing Gmail to exfiltrate the data and drain Solana wallets.
Security News
PEP 770 proposes adding SBOM support to Python packages to improve transparency and catch hidden non-Python dependencies that security tools often miss.