@@ -1,15 +1,10 @@
|
||||
import { toast } from '@zerodevx/svelte-toast';
|
||||
import { t } from '$lib/translations';
|
||||
|
||||
let formatMessage;
|
||||
t.subscribe((storeFormat) => (formatMessage = storeFormat));
|
||||
|
||||
export function errorNotification(message: string): void {
|
||||
export function errorNotification(message: string) {
|
||||
console.error(message);
|
||||
if (typeof message !== 'string') {
|
||||
toast.push(formatMessage('error.generic_message'));
|
||||
toast.push('Ooops, something is not okay, are you okay?');
|
||||
} else {
|
||||
toast.push(formatMessage(message));
|
||||
toast.push(message);
|
||||
}
|
||||
}
|
||||
export function enhance(
|
||||
|
||||
@@ -1,4 +0,0 @@
|
||||
{
|
||||
"en": "English",
|
||||
"fr": "Français"
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
const publicPaths = [
|
||||
export const publicPaths = [
|
||||
'/login',
|
||||
'/register',
|
||||
'/reset',
|
||||
@@ -8,7 +8,3 @@ const publicPaths = [
|
||||
'/webhooks/github/install',
|
||||
'/webhooks/gitlab'
|
||||
];
|
||||
|
||||
export function isPublicPath(path: string): boolean {
|
||||
return publicPaths.includes(path);
|
||||
}
|
||||
|
||||
@@ -1,26 +0,0 @@
|
||||
import i18n from 'sveltekit-i18n';
|
||||
import lang from './lang.json';
|
||||
|
||||
/** @type {import('sveltekit-i18n').Config} */
|
||||
export const config = {
|
||||
fallbackLocale: 'en',
|
||||
translations: {
|
||||
en: { lang },
|
||||
fr: { lang }
|
||||
},
|
||||
loaders: [
|
||||
{
|
||||
locale: 'en',
|
||||
key: '',
|
||||
loader: async () => (await import('../../static/locales/en.json')).default
|
||||
},
|
||||
{
|
||||
locale: 'fr',
|
||||
key: '',
|
||||
loader: async () => (await import('../../static/locales/fr.json')).default
|
||||
}
|
||||
]
|
||||
};
|
||||
|
||||
export const { t, loading, locales, locale, loadTranslations } = new i18n(config);
|
||||
loading.subscribe(($loading) => $loading && console.log('Loading translations...'));
|
||||
Reference in New Issue
Block a user