@qualityunit/liveagent-components-utils
v0.0.5
Published
Utils for LiveAgent components
Downloads
170
Keywords
Readme
Utils for LiveAgent components
Localization example:
<script>
import {initI18N, fallbackLocale, initialLocale, initDayJS} from '@qualityunit/liveagent-components-utils/i18n';
import {_, isLoading} from 'svelte-i18n';
const options: {
thousandsSeparator: 'S',
decimalSeparator: 'D',
dateFormat: 'MM/d/yyyy',
timeFormat: 'HH:mm:ss',
timeShortFormat: 'HH:mm',
locale: 'sk'
};
initI18N(options, () => import(`./locales/${fallbackLocale}.json`), () => import(`./locales/${initialLocale}.json`));
// needed only if you use svelte-time with relative time
initDayJS(options.locale);
</script>
{#if $isLoading}
<p>Loading translations...</p>
{:else}
<p>{$_("Translated string")}</p>
{/if}