Skip to content

Commit

Permalink
Support for condition in oria (#214)
Browse files Browse the repository at this point in the history
* Support for condition in oria

* oria translate for weather condition
  • Loading branch information
amit-s19 authored Jan 29, 2024
1 parent 914aab4 commit fc994f7
Show file tree
Hide file tree
Showing 2 changed files with 85 additions and 42 deletions.
81 changes: 39 additions & 42 deletions apps/amakrushi/src/components/chat-message-item/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import React, {
} from 'react';

import { toast } from 'react-hot-toast';

import { oriaWeatherTranslates } from '../../utils/getWeatherTranslation';
import styles from './index.module.css';
import { analytics } from '../../utils/firebase';
import { logEvent } from 'firebase/analytics';
Expand Down Expand Up @@ -339,7 +339,7 @@ const ChatMessageItem: FC<ChatMessageItemPropType> = ({
}}>
{getFormatedTime(
content?.data?.sentTimestamp ||
content?.data?.repliedTimestamp
content?.data?.repliedTimestamp
)}
</span>
</div>
Expand Down Expand Up @@ -392,38 +392,38 @@ const ChatMessageItem: FC<ChatMessageItemPropType> = ({
<p>{t('message.helpful')}</p>
</div>
<div
className={styles.msgSpeaker}
onClick={!ttsLoader ? downloadAudio : () => { }}
style={
!content?.data?.isEnd
? {
pointerEvents: 'none',
filter: 'grayscale(100%)',
opacity: '0.5',
}
: {
pointerEvents: 'auto',
opacity: '1',
filter: 'grayscale(0%)',
}
}>
{context?.clickedAudioUrl === content?.data?.audio_url ? (
<Image
src={
!context?.audioPlaying
? SpeakerIcon
: SpeakerPauseIcon
}
width={!context?.audioPlaying ? 15 : 40}
height={!context?.audioPlaying ? 15 : 40}
alt=""
/>
) : ttsLoader ? (
<Loader />
) : (
<Image src={SpeakerIcon} width={15} height={15} alt="" />
)}
{/* <p
className={styles.msgSpeaker}
onClick={!ttsLoader ? downloadAudio : () => { }}
style={
!content?.data?.isEnd
? {
pointerEvents: 'none',
filter: 'grayscale(100%)',
opacity: '0.5',
}
: {
pointerEvents: 'auto',
opacity: '1',
filter: 'grayscale(0%)',
}
}>
{context?.clickedAudioUrl === content?.data?.audio_url ? (
<Image
src={
!context?.audioPlaying
? SpeakerIcon
: SpeakerPauseIcon
}
width={!context?.audioPlaying ? 15 : 40}
height={!context?.audioPlaying ? 15 : 40}
alt=""
/>
) : ttsLoader ? (
<Loader />
) : (
<Image src={SpeakerIcon} width={15} height={15} alt="" />
)}
{/* <p
style={{
fontSize: '11px',
color: 'var(--font)',
Expand All @@ -435,7 +435,7 @@ const ChatMessageItem: FC<ChatMessageItemPropType> = ({
}}>
{t('message.speaker')}
</p> */}
</div>
</div>
</div>
)
)}
Expand Down Expand Up @@ -466,7 +466,7 @@ const ChatMessageItem: FC<ChatMessageItemPropType> = ({
<span style={{ color: 'var(--font)', fontSize: '10px' }}>
{getFormatedTime(
content?.data?.sentTimestamp ||
content?.data?.repliedTimestamp
content?.data?.repliedTimestamp
)}
</span>
</div>
Expand Down Expand Up @@ -500,7 +500,7 @@ const ChatMessageItem: FC<ChatMessageItemPropType> = ({
<span style={{ color: 'var(--font)', fontSize: '10px' }}>
{getFormatedTime(
content?.data?.sentTimestamp ||
content?.data?.repliedTimestamp
content?.data?.repliedTimestamp
)}
</span>
</div>
Expand Down Expand Up @@ -538,7 +538,7 @@ const ChatMessageItem: FC<ChatMessageItemPropType> = ({
<span style={{ color: 'var(--font)', fontSize: '10px' }}>
{getFormatedTime(
content?.data?.sentTimestamp ||
content?.data?.repliedTimestamp
content?.data?.repliedTimestamp
)}
</span>
</div>
Expand Down Expand Up @@ -602,10 +602,7 @@ const ChatMessageItem: FC<ChatMessageItemPropType> = ({
<div>{el.precipprob} % </div>
<div>{el.windspeed} m/s</div>
<div>{el.cloudcover} %</div>
<div>
{' '}
{intl.locale == 'or' ? 'ପାର୍ଟିଆଲ କ୍ଲାଉଡି' : el.conditions}
</div>
<div> {intl.locale == 'or' ? oriaWeatherTranslates[el?.conditions?.trim()?.split(" ")?.join("")?.toLowerCase()] : el.conditions}</div>
</div>
))}
</div>
Expand Down
46 changes: 46 additions & 0 deletions apps/amakrushi/src/utils/getWeatherTranslation.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
//@ts-ignore
export const oriaWeatherTranslates: any = {
blowingordriftingsnow: 'ଝୋଡ଼ା ବା ଘସିଯିବା ବରଫ',
'heavyfreezingdrizzle/freezingrain': 'ଘନ ହିମବର୍ଷା/ହିମଜଳ',
'lightfreezingdrizzle/freezingrain': 'ଅଲ୍ପ ହିମବର୍ଷା/ହିମଜଳ',
freezingfog: 'ହିମ କୁହୁଡ଼ା',
heavyfreezingrain: 'ଘନ ହିମଜଳ',
lightfreezingrain: 'ଅଲ୍ପ ହିମଜଳ',
'funnelcloud/tornado': 'ଫନେଲ ମେଘ/ବାତୁଳି',
hailshowers: 'ବରଫ ଝଡ଼',
ice: 'ବରଫ',
lightningwithoutthunder: 'ବଜ୍ରପାତ ବିନା ଗୁଡ଼ଗୁଡ଼ି',
mist: 'କୁହୁଡ଼ା',
drizzle: 'ଅଲ୍ପ ବର୍ଷା',
precipitationinvicinity: 'ନିକଟବର୍ତୀ ବର୍ଷା',
rain: 'ବର୍ଷା',
heavyrainandsnow: 'ଘନ ବର୍ଷା ଓ ବରଫ',
lightrainandsnow: 'ଅଲ୍ପ ବର୍ଷା ଓ ବରଫ',
rainshowers: 'ବର୍ଷା ଝଡ଼',
heavyrain: 'ଘନ ବର୍ଷା',
lightrain: 'ଅଲ୍ପ ବର୍ଷା',
skycoveragedecreasing: 'ଆକାଶ ଆବରଣ କମିଯିବା',
skycoverageincreasing: 'ଆକାଶ ଆବରଣ ବୃଦ୍ଧି',
skyunchanged: 'ଆକାଶ ଅପରିବର୍ତିତ',
heavydrizzle: 'ଘନ ଅଲ୍ପ ବର୍ଷା',
smokeorhaze: 'ଧୂମ୍ର ବା ଧୂମଳତା',
snow: 'ବରଫ',
snowandrainshowers: 'ବରଫ ଏବଂ ବର୍ଷା ଝଡ଼',
snowshowers: 'ବରଫ ଝଡ଼',
heavysnow: 'ଘନ ବରଫ',
lightsnow: 'ଅଲ୍ପ ବରଫ',
squalls: 'ଝଡ଼',
thunderstorm: 'ବଜ୍ରପାତ',
thunderstormwithoutprecipitation: 'ବଜ୍ରପାତ ବିନା ବର୍ଷା',
diamonddust: 'ହୀରା ଧୂଳି',
lightdrizzle: 'ଅଲ୍ପ ଅଲ୍ପ ବର୍ଷା',
hail: 'କୁଆପଥର',
overcast: 'ମେଘାଚ୍ଛନ୍ନ',
partiallycloudy: 'ଆଂଶିକ ମେଘୁଆ',
clear: 'ସ୍ପଷ୍ଟ',
'heavydrizzle/rain': 'ଘନ ଅଲ୍ପ ବର୍ଷା/ବର୍ଷା',
'lightdrizzle/rain': 'ଅଲ୍ପ ଅଲ୍ପ ବର୍ଷା/ବର୍ଷା',
duststorm: 'ଧୂଳିଝଡ',
fog: 'କୁହୁଡ଼ି',
'freezingdrizzle/freezingrain': 'ହିମ ଅଲ୍ପ ବର୍ଷା/ହିମବର୍ଷା'
}

0 comments on commit fc994f7

Please sign in to comment.