Skip to content

Commit

Permalink
Fix translation cache hits
Browse files Browse the repository at this point in the history
  • Loading branch information
WillTDA committed Jun 17, 2023
1 parent cccbc5c commit 557d0fc
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/translate.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
}

Expand Down

0 comments on commit 557d0fc

Please sign in to comment.