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
parent
3e0c998e74
commit
e55f32ae91
|
@ -24,8 +24,11 @@ const convertToJSON = async (
|
||||||
) => {
|
) => {
|
||||||
let localeData;
|
let localeData;
|
||||||
try {
|
try {
|
||||||
|
// use "pt" for "pt-BR", because "pt-BR" is unsupported by @formatjs
|
||||||
|
const language = lang === "pt-BR" ? "pt" : lang;
|
||||||
|
|
||||||
localeData = await readFile(
|
localeData = await readFile(
|
||||||
join(formatjsDir, pkg, subDir, `${lang}.js`),
|
join(formatjsDir, pkg, subDir, `${language}.js`),
|
||||||
"utf-8"
|
"utf-8"
|
||||||
);
|
);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
|
|
Loading…
Reference in New Issue