gptrans 1.5.2 → 1.5.6
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.
- package/index.js +5 -5
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -98,17 +98,17 @@ class GPTrans {
|
|
|
98
98
|
|
|
99
99
|
if (!translation) {
|
|
100
100
|
|
|
101
|
-
if (!this.dbFrom.get(this.context, key)) {
|
|
101
|
+
if (!this.freeze && !this.dbFrom.get(this.context, key)) {
|
|
102
102
|
this.dbFrom.set(this.context, key, text);
|
|
103
103
|
}
|
|
104
104
|
|
|
105
|
-
if
|
|
106
|
-
|
|
105
|
+
// Skip translation if context is empty and languages are the same
|
|
106
|
+
if (!this.context && this.replaceFrom.FROM_ISO === this.replaceTarget.TARGET_ISO) {
|
|
107
107
|
return text;
|
|
108
108
|
}
|
|
109
109
|
|
|
110
|
-
|
|
111
|
-
|
|
110
|
+
if (this.freeze) {
|
|
111
|
+
console.log(`Freeze mode: [${key}] ${text}`);
|
|
112
112
|
return text;
|
|
113
113
|
}
|
|
114
114
|
|