gptrans 1.6.2 → 1.6.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/index.js +6 -1
  2. package/package.json +1 -1
package/index.js CHANGED
@@ -98,7 +98,7 @@ class GPTrans {
98
98
  const translation = this.dbTarget.get(contextHash, key);
99
99
 
100
100
  if (!translation) {
101
-
101
+
102
102
  if (!this.freeze && !this.dbFrom.get(this.context, key)) {
103
103
  this.dbFrom.set(this.context, key, text);
104
104
  }
@@ -213,6 +213,11 @@ class GPTrans {
213
213
  }
214
214
 
215
215
  async preload() {
216
+
217
+ if (!this.context && this.replaceFrom.FROM_ISO === this.replaceTarget.TARGET_ISO) {
218
+ return this;
219
+ }
220
+
216
221
  for (const [context, pairs] of this.dbFrom.entries()) {
217
222
  this.setContext(context);
218
223
  for (const [key, text] of Object.entries(pairs)) {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "gptrans",
3
3
  "type": "module",
4
- "version": "1.6.2",
4
+ "version": "1.6.4",
5
5
  "description": "🚆 GPTrans - The smarter AI-powered way to translate.",
6
6
  "keywords": [
7
7
  "translate",