Merge remote-tracking branch 'origin/main' into more-eslint

This commit is contained in:
Yury Bondarenko
2023-12-12 18:32:22 +01:00
447 changed files with 15918 additions and 5088 deletions

View File

@@ -30,8 +30,9 @@ export class TranslateServerLoader implements TranslateLoader {
* @param lang the language code
*/
public getTranslation(lang: string): Observable<any> {
const translationHash: string = (process.env.languageHashes as any)[lang + '.json5'];
// Retrieve the file for the given language, and parse it
const messages = JSON.parse(readFileSync(`${this.prefix}${lang}${this.suffix}`, 'utf8'));
const messages = JSON.parse(readFileSync(`${this.prefix}${lang}.${translationHash}${this.suffix}`, 'utf8'));
// Store the parsed messages in the transfer state so they'll be available immediately when the
// app loads on the client
this.storeInTransferState(lang, messages);