mirror of
https://github.com/vector-im/element-web.git
synced 2026-05-05 04:06:44 +02:00
Fix format for i18n files in storybook build (#31992)
* fix: correct format for i18n files in storybook build * refactor: rename `json` var to `jsonStr`
This commit is contained in:
parent
c2f1793bb0
commit
1053f99bda
@ -55,12 +55,12 @@ function prepareLangFiles(): LangFileMap {
|
||||
function createHashFromFile(lang: string): [filename: string, json: string] {
|
||||
const translationsPath = `${I18N_BASE_PATH}${lang}.json`;
|
||||
|
||||
const json = JSON.stringify(fs.readFileSync(translationsPath).toString(), null, 4);
|
||||
const jsonBuffer = Buffer.from(json);
|
||||
const jsonStr = fs.readFileSync(translationsPath).toString();
|
||||
const jsonBuffer = Buffer.from(jsonStr);
|
||||
const digest = createHash("sha256").update(jsonBuffer).digest("hex").slice(0, 7);
|
||||
const filename = `${lang}.${digest}.json`;
|
||||
|
||||
return [filename, json];
|
||||
return [filename, jsonStr];
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user