Skip to content

Commit

Permalink
Merge pull request #1003 from Onlineberatung/OB-9500
Browse files Browse the repository at this point in the history
fix: translation cached file structure fix
  • Loading branch information
web-mi authored Feb 2, 2024
2 parents a7783e2 + 86ffd90 commit a43c3a2
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions proxy/routes/weblate.js
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ module.exports = (storagePath) => {
fs.promises
.writeFile(
localeFilePath,
JSON.stringify({ ts: new Date().getTime(), ...data })
JSON.stringify({ ...data, ts: new Date().getTime() })
)
.then(() => {
console.log(`Translation ${cacheFile} renewed`);
Expand Down Expand Up @@ -186,7 +186,10 @@ module.exports = (storagePath) => {

// Save the new loaded data to file system and reset require cache
try {
saveFilesystem(`${ns}.${lng}.json`, data);
saveFilesystem(
`${ns}.${lng}.json`,
translationData
);
} catch {
// Do nothing we already show an error on loading
}
Expand Down

0 comments on commit a43c3a2

Please sign in to comment.