Skip to content

Commit

Permalink
Merge pull request #13 from db1group/fix/internacionalization-body
Browse files Browse the repository at this point in the history
fix body translation of items
  • Loading branch information
AlexandroHervis authored Jul 10, 2023
2 parents ea9d929 + cf51eab commit f995a19
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/hooks/get-item-body.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,17 @@ import i18n from "i18next";
import { Item } from "../model";

export function getItemBody(item: Item) {
let language;
const body: any = {
pt: item.bodyPt,
en: item.bodyEn,
es: item.bodyEs,
};

return body[i18n.language];

i18n.language.includes('-')
? language = i18n.language.split('-')[0]
: language = i18n.language;

return body[language];
}

0 comments on commit f995a19

Please sign in to comment.