Skip to content

Commit

Permalink
forgot to update lockfile
Browse files Browse the repository at this point in the history
  • Loading branch information
wkelly17 committed Feb 6, 2025
1 parent 2feb684 commit e3251d7
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 15 deletions.
18 changes: 5 additions & 13 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

28 changes: 26 additions & 2 deletions src/data/pubDataApi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,12 @@ export async function getLanguageContents({
if (!lang) {
throw new Error(`no language found for ${language}`);
}
if (lang.wa_language_metadata && !lang.wa_language_metadata?.is_gateway) {
if (
doCollateContent({
ietf: lang.ietf_code,
isGateway: lang.wa_language_metadata?.is_gateway,
})
) {
lang.contents = collateGatewayContent({
contents: lang.contents,
langName: lang.national_name,
Expand Down Expand Up @@ -290,7 +295,12 @@ export async function getLangsWithContentNames({
new Map()
);
json.data.language.forEach((lang) => {
if (!lang.wa_language_metadata?.is_gateway) {
if (
doCollateContent({
ietf: lang.ietf_code,
isGateway: lang.wa_language_metadata?.is_gateway,
})
) {
// @ts-ignore: I know that collateGatewayContent isn't going to set a displayName: I'm doing that below for all languages regardless of is gateway status
lang.contents = collateGatewayContent({
contents: lang.contents,
Expand Down Expand Up @@ -549,3 +559,17 @@ async function refreshCfCache({
console.error(error);
}
}

function isKnownGatewayContentFormatException(ietf: string) {
const exceptions = ["ceb"];
return exceptions.includes(ietf);
}
function doCollateContent({
isGateway,
ietf,
}: {
isGateway: boolean | undefined;
ietf: string;
}) {
return isGateway || isKnownGatewayContentFormatException(ietf);
}

0 comments on commit e3251d7

Please sign in to comment.