Skip to content

Commit

Permalink
Update index.ts
Browse files Browse the repository at this point in the history
Updated language indexer file to include Portuguese (Brazil) as an option
  • Loading branch information
thedmmatt authored May 13, 2024
1 parent 5cf2f6d commit aeab697
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/i18n/index.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
import { createI18n } from 'vue-i18n';
import de from './locales/de.json';
import en from './locales/en.json';
import br from './locales/br.json';

export type MessageSchema = typeof en;

const browserLocale = navigator.language.slice(0, 2).toLowerCase();
const messages: Record<string, MessageSchema> = { en, de } as const;
const messages: Record<string, MessageSchema> = { en, de, br } as const;

export const availableLocales = ['en', 'de'];
export const availableLocales = ['en', 'de', 'br'];
export const initialLocale = availableLocales.includes(browserLocale) ? browserLocale : 'en';

export type AvailableLocale = keyof typeof messages;
Expand Down

0 comments on commit aeab697

Please sign in to comment.