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 <paul.bottein@gmail.com>

---------

Co-authored-by: Paul Bottein <paul.bottein@gmail.com>
pull/21878/head
Wendelin 2024-10-29 08:50:21 +01:00 committed by GitHub
parent 3e0c998e74
commit e55f32ae91
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 4 additions and 1 deletions

View File

@ -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) {