Skip to content

Commit

Permalink
Fix language for webpages (#335)
Browse files Browse the repository at this point in the history
  • Loading branch information
tyaginidhi authored Nov 3, 2022
1 parent ace23ac commit cfbd3cb
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/web/client/common/remoteFetchProvider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -126,12 +126,11 @@ async function createContentFiles(

const languageCodeAttribute = entitiesSchemaMap.get(Constants.pathParamToSchema.get(entity) as string)?.get(Constants.LANGUAGE_FIELD);

if (languageCodeAttribute) {
const languageCodeId = result[languageCodeAttribute];
lcid = websiteIdToLanguage.get(languageCodeId) ?? '';
if (languageCodeAttribute && result[languageCodeAttribute]) {
lcid = websiteIdToLanguage.get(result[languageCodeAttribute]) ?? '';
}
let languageCode: string = Constants.DEFAULT_LANGUAGE_CODE;

let languageCode: string = Constants.DEFAULT_LANGUAGE_CODE;
if (languageIdCodeMap?.size && lcid) {
languageCode = languageIdCodeMap.get(lcid) as string ?? Constants.DEFAULT_LANGUAGE_CODE;
}
Expand Down

0 comments on commit cfbd3cb

Please sign in to comment.