import { AvailableOriginLanguages , TOriginLanguage , } from '@energyweb/origin-ui-localization' ; import { ORIGIN_LANGUAGE } from '../utils' ; import { TGetOriginLanguage , TSetOriginLanguage } from './types' ; export const setOriginLanguage = ( language ) => { localStorage . setItem ( ORIGIN_LANGUAGE , language ) ; } ; export const getOriginLanguage = ( ) => { const storedLanguage = localStorage . getItem ( ORIGIN_LANGUAGE ) ; if ( AvailableOriginLanguages . includes ( storedLanguage ) ) { return storedLanguage as TOriginLanguage ; } return 'en' ; } ;