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

tml-js-browser

Package Overview
Dependencies
Maintainers
1
Versions
47
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

tml-js-browser - npm Package Compare versions

Comparing version 0.4.64 to 0.4.65

22

lib/helpers.js

@@ -190,13 +190,25 @@ /**

getCurrentSource: function (options) {
var source_method = options.current_source || options.source;
var source_method = options.source || options.current_source;
var path = window.location.pathname;
if (path == '/') path = '/index';
// current_source can be a function, hash or a string
if (source_method) {
if (utils.isString(source_method))
if (utils.isString(source_method)) {
return source_method;
}
if (utils.isFunction(source_method))
return source_method();
if (utils.isFunction(source_method)) {
return source_method(path);
}
// TODO: handle the hash method - for dynamic mapping using regular expressions
if (utils.isObject(source_method)) {
for (var exp in source_method) {
var re = new RegExp(exp);
if (path.match(re))
return source_method[exp];
}
return path;
}
}

@@ -203,0 +215,0 @@

@@ -141,2 +141,6 @@ /**

options.current_source = helpers.getCurrentSource(options);
options.current_locale = helpers.getCurrentLocale(options);
options.current_translator = cookie.translator ? new tml.Translator(cookie.translator) : null;
// updating options and configuring the SDK

@@ -147,12 +151,2 @@ options = tml.utils.merge(tml.config, {

// current source can be a method, a hash or a string
current_source: helpers.getCurrentSource(options),
// for backwards compatibility we support current_locale - but we should switch documentation
// to user "locale" instead. "locale" now supports strategies
current_locale: helpers.getCurrentLocale(options),
// translator information can only be extracted from the cookie
current_translator: cookie.translator ? new tml.Translator(cookie.translator) : null,
// get the list of locales from the browser

@@ -223,2 +217,3 @@ accepted_locales: helpers.getBrowserLanguages(),

domains: options.agent.domains || {},
tools: options.agent.tools || {},
locale_strategy: options.locale,

@@ -225,0 +220,0 @@ config: tml.config,

{
"name": "tml-js-browser",
"description": "Translation plugin for browsers.",
"version": "0.4.64",
"version": "0.4.65",
"author": {

@@ -6,0 +6,0 @@ "name": "Michael Berkovich",

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

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