Skip to content

Commit

Permalink
remove debug console logs
Browse files Browse the repository at this point in the history
  • Loading branch information
WillTDA committed Jun 17, 2023
1 parent 7d7ec18 commit e42cff8
Showing 1 changed file with 0 additions and 2 deletions.
2 changes: 0 additions & 2 deletions src/translate.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ module.exports = async function translate(string, language, cachingOptions) {
if (cachingOptions.enabled === true) {
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 currentCache[hashedString]; //return cached translation if it exists
}
}
Expand All @@ -49,7 +48,6 @@ module.exports = async function translate(string, language, cachingOptions) {
let cacheToSave = JSON.parse(fs.readFileSync(cacheFile));
cacheToSave[hashedString] = translation; //add the translation to the cache
fs.writeFileSync(cacheFile, JSON.stringify(cacheToSave)); //save the new state of the cache
console.log("Translator: Cache entry created for " + string);
}

//return the translation
Expand Down

0 comments on commit e42cff8

Please sign in to comment.