fix: improve lingui configuration (#1388)

## Description

Currently merge conflicts arise due to the compiled JS and PO
translation files.

This PR is a rework on how we handle extracting and compiling
translations to streamline PRs and merging branches.

## Changes Made

- Remove compiled translation files from being committed
- Extract and compile translations only on build
- Extract will still occur when commits land on main to sync and pull
new translations with Crowdin
This commit is contained in:
David Nguyen
2024-10-09 14:13:52 +11:00
committed by GitHub
parent 2c1a18bafc
commit 9ffdbe9c81
18 changed files with 22 additions and 64 deletions

View File

@ -15,9 +15,10 @@ type SupportedLanguages = (typeof SUPPORTED_LANGUAGE_CODES)[number];
async function loadCatalog(lang: SupportedLanguages): Promise<{
[k: string]: Messages;
}> {
const { messages } = await import(
`../../translations/${lang}/${IS_APP_WEB ? 'web' : 'marketing'}.js`
);
const extension = process.env.NODE_ENV === 'development' ? 'po' : 'js';
const context = IS_APP_WEB ? 'web' : 'marketing';
const { messages } = await import(`../../translations/${lang}/${context}.${extension}`);
return {
[lang]: messages,