diff --git a/components/VcDetails.tsx b/components/VcDetails.tsx index 4df855775a..5326c4ed54 100644 --- a/components/VcDetails.tsx +++ b/components/VcDetails.tsx @@ -10,6 +10,7 @@ import { Theme } from './ui/styleUtils'; import { TextItem } from './ui/TextItem'; import { VcItemTags } from './VcItemTags'; import VerifiedIcon from './VerifiedIcon'; +import i18n from '../i18n'; export const VcDetails: React.FC = (props) => { const { t, i18n } = useTranslation('VcDetails'); @@ -352,6 +353,12 @@ function getLocalizedField(rawField: string | LocalizedField[]) { } try { const locales: LocalizedField[] = JSON.parse(JSON.stringify(rawField)); + const language = i18n.language; + if (locales.length > 1 && language === 'ar') { + return locales[1].language === 'ara' + ? locales[1].value + : locales[0].value; + } return locales[0].value; } catch (e) { return ''; diff --git a/components/VcItem.tsx b/components/VcItem.tsx index 9fd017e1cc..2f11e2940b 100644 --- a/components/VcItem.tsx +++ b/components/VcItem.tsx @@ -26,6 +26,7 @@ import { useTranslation } from 'react-i18next'; import { LocalizedField } from '../types/vc'; import { VcItemTags } from './VcItemTags'; import VerifiedIcon from './VerifiedIcon'; +import i18n from '../i18n'; const getDetails = (arg1, arg2, verifiableCredential) => { if (arg1 === 'Status') { @@ -311,6 +312,12 @@ function getLocalizedField(rawField: string | LocalizedField) { } try { const locales: LocalizedField[] = JSON.parse(JSON.stringify(rawField)); + const language = i18n.language; + if (locales.length > 1 && language === 'ar') { + return locales[1].language === 'ara' + ? locales[1].value + : locales[0].value; + } return locales[0].value; } catch (e) { return '';