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.55 to 0.4.56

25

lib/tokenizers/dom.js

@@ -263,3 +263,3 @@ /**

sentences.forEach(function (sentence) {
var sentenceTranslation = self.translateTmlFragment(sentence, data, label);
var sentenceTranslation = self.translateTmlFragment(sentence, data, {label: label});
if (sentenceTranslation)

@@ -272,3 +272,3 @@ translation = translation.replace(sentence, sentenceTranslation);

return this.translateTmlFragment(tml, data, label);
return this.translateTmlFragment(tml, data, {label: label, reset: true});
},

@@ -281,6 +281,8 @@

* @param data
* @param label
* @param opts
* @returns {*}
*/
translateTmlFragment: function(tml, data, label) {
translateTmlFragment: function(tml, data, opts) {
opts = opts || {};
tml = this.generateDataTokens(tml);

@@ -290,8 +292,17 @@ data = data || this.tokens;

// if (!this.isValidTml(tml)) return null;
console.log(tml, data);
// console.log(tml, data);
var translation = tml;
tml = tml.replace(/[\n]/g, '').replace(/\s\s+/g, ' ').trim();
translation = this.getOption("debug") ? this.debugTranslation(tml) : window[label ? "trl" : "tr"](tml, data, this.options);
this.resetContext();
if (this.getOption("debug"))
translation = this.debugTranslation(tml);
else if (opts.label)
translation = window.trl(tml, data, this.options);
else
translation = window.tr(tml, data, this.options);
if (opts.reset)
this.resetContext();
return translation;

@@ -298,0 +309,0 @@ },

{
"name": "tml-js-browser",
"description": "Translation plugin for browsers.",
"version": "0.4.55",
"version": "0.4.56",
"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