From 557d0fc585ebd1e754ecbfbdee77f96e624786b0 Mon Sep 17 00:00:00 2001 From: WillTDA <62032600+WillTDA@users.noreply.github.com> Date: Sat, 17 Jun 2023 21:02:28 +0100 Subject: [PATCH] Fix translation cache hits --- src/translate.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/translate.js b/src/translate.js index 876a714..695b48f 100644 --- a/src/translate.js +++ b/src/translate.js @@ -23,7 +23,7 @@ module.exports = async function translate(string, language, cachingOptions) { let currentCache = fs.existsSync(path.join(process.cwd(), cachingOptions.path, `${language}.json`)) ? JSON.parse(fs.readFileSync(path.join(process.cwd(), cachingOptions.path, `${language}.json`))) : {}; //load the cache file if (currentCache[hashedString]) { console.log("Translator: Cache hit for " + string); - return cache[hashedString]; //return cached translation if it exists + return currentCache[hashedString]; //return cached translation if it exists } }