@ewb/translate
Advanced tools
Comparing version 1.7.0 to 1.8.0
@@ -46,2 +46,4 @@ import Tree, { WordTranslations, TreeOptions } from './Tree'; | ||
setLocale(locale: string): void; | ||
addWords(words: WordTranslations): void; | ||
addTexts(texts: WordTranslations): void; | ||
private _branch; | ||
@@ -48,0 +50,0 @@ private replaceVariables; |
@@ -98,2 +98,8 @@ "use strict"; | ||
} | ||
addWords(words) { | ||
Object.keys(words).forEach(key => this.tree.addText(key, words[key])); | ||
} | ||
addTexts(texts) { | ||
Object.keys(texts).forEach(key => this.tree.addText(key, texts[key])); | ||
} | ||
_branch(wordOrText, isText = false) { | ||
@@ -100,0 +106,0 @@ if (!isText) { |
{ | ||
"name": "@ewb/translate", | ||
"version": "1.7.0", | ||
"version": "1.8.0", | ||
"description": "Translate as you create your app. Saves the words and text in a tree structure for fast and easy lookup.", | ||
@@ -5,0 +5,0 @@ "main": "./lib/index.js", |
@@ -135,2 +135,10 @@ import Tree, { WordTranslations, TreeOptions } from './Tree'; | ||
public addWords(words: WordTranslations) { | ||
Object.keys(words).forEach(key => this.tree.addText(key, words[key])); | ||
} | ||
public addTexts(texts: WordTranslations) { | ||
Object.keys(texts).forEach(key => this.tree.addText(key, texts[key])); | ||
} | ||
private _branch(wordOrText: string, isText = false) { | ||
@@ -137,0 +145,0 @@ if (!isText) { |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
177991
1619