Initial commit: OAuth IAM Laravel application
Laravel-based OAuth/IAM service with Passport, Vue 3 frontend, and Docker Compose setup for local and production deployment. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
20
resources/js/i18n/index.ts
Normal file
20
resources/js/i18n/index.ts
Normal file
@@ -0,0 +1,20 @@
|
||||
import { createI18n } from 'vue-i18n';
|
||||
import ca from './ca';
|
||||
import en from './en';
|
||||
import es, { type MessageSchema } from './es';
|
||||
|
||||
const SUPPORTED = ['es', 'en', 'ca'] as const;
|
||||
type Locale = (typeof SUPPORTED)[number];
|
||||
|
||||
function isSupported(locale: string): locale is Locale {
|
||||
return (SUPPORTED as readonly string[]).includes(locale);
|
||||
}
|
||||
|
||||
const i18n = createI18n<[MessageSchema], Locale>({
|
||||
legacy: false,
|
||||
locale: isSupported(window.__LOCALE__) ? window.__LOCALE__ : 'es',
|
||||
fallbackLocale: 'es',
|
||||
messages: { en, es, ca },
|
||||
});
|
||||
|
||||
export default i18n;
|
||||
Reference in New Issue
Block a user