Skip to content

Commit

Permalink
Fallback to formatjs pt for brazilian pt (#22570)
Browse files Browse the repository at this point in the history
* Fallback to formatjs pt for brazilian pt

* Update build-scripts/gulp/locale-data.js

Co-authored-by: Paul Bottein <[email protected]>

---------

Co-authored-by: Paul Bottein <[email protected]>
  • Loading branch information
wendevlin and piitaya authored Oct 29, 2024
1 parent 3e0c998 commit e55f32a
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion build-scripts/gulp/locale-data.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit e55f32a

Please sign in to comment.