From e55f32ae91a3fbfea6b177ac5154cddfa0df9531 Mon Sep 17 00:00:00 2001 From: Wendelin <12148533+wendevlin@users.noreply.github.com> Date: Tue, 29 Oct 2024 08:50:21 +0100 Subject: [PATCH] Fallback to formatjs pt for brazilian pt (#22570) * Fallback to formatjs pt for brazilian pt * Update build-scripts/gulp/locale-data.js Co-authored-by: Paul Bottein --------- Co-authored-by: Paul Bottein --- build-scripts/gulp/locale-data.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/build-scripts/gulp/locale-data.js b/build-scripts/gulp/locale-data.js index 4da1d8f218cd..4cf91711d495 100755 --- a/build-scripts/gulp/locale-data.js +++ b/build-scripts/gulp/locale-data.js @@ -24,8 +24,11 @@ const convertToJSON = async ( ) => { let localeData; try { + // use "pt" for "pt-BR", because "pt-BR" is unsupported by @formatjs + const language = lang === "pt-BR" ? "pt" : lang; + localeData = await readFile( - join(formatjsDir, pkg, subDir, `${lang}.js`), + join(formatjsDir, pkg, subDir, `${language}.js`), "utf-8" ); } catch (e) {