Refactored i18n configuration, replacing `DEFAULT_LOCALE` with `DEFAULT_LOCALE_FALLBACK` and enhancing environment-based locale validation. Improved cookie persistence for cart and wishlist, ensuring fallback handling for unauthenticated users. Enhancements: - Added `createProjectKey` utility for consistent project key generation. - Reworked cart and wishlist composables (`useOrderOverwrite`, `useWishlistOverwrite`) to decouple product identifier and handle cookies robustly. - Centralized `DEFAULT_LOCALE` logic for better maintainability. - Refined `useOrderSync` and `useWishlistSync` for clean synchronization across auth states. - Updated SCSS in hero and header styles for alignment corrections. Breaking Changes: `DEFAULT_LOCALE` constant removed; replaced with runtime config and fallback logic. Consumers must adapt to `DEFAULT_LOCALE_FALLBACK` and `$appHelpers.DEFAULT_LOCALE`.
84 lines
No EOL
1.3 KiB
TypeScript
84 lines
No EOL
1.3 KiB
TypeScript
import type { LocaleDefinition } from '@types';
|
|
|
|
export const SUPPORTED_LOCALES: LocaleDefinition[] = [
|
|
{
|
|
code: 'en-gb',
|
|
file: 'en-gb.json'
|
|
},
|
|
// {
|
|
// code: 'ar-ar',
|
|
// file: 'ar-ar.json',
|
|
// default: false,
|
|
// },
|
|
// {
|
|
// code: 'cs-cz',
|
|
// file: 'cs-cz.json',
|
|
// default: false,
|
|
// },
|
|
// {
|
|
// code: 'da-dk',
|
|
// file: 'da-dk.json',
|
|
// default: false,
|
|
// },
|
|
// {
|
|
// code: 'de-de',
|
|
// file: 'de-de.json',
|
|
// default: false,
|
|
// },
|
|
// {
|
|
// code: 'en-us',
|
|
// file: 'en-us.json',
|
|
// default: false,
|
|
// },
|
|
// {
|
|
// code: 'es-es',
|
|
// file: 'es-es.json',
|
|
// default: false,
|
|
// },
|
|
// {
|
|
// code: 'fr-fr',
|
|
// file: 'fr-fr.json',
|
|
// default: false,
|
|
// },
|
|
// {
|
|
// code: 'it-it',
|
|
// file: 'it-it.json',
|
|
// default: false,
|
|
// },
|
|
// {
|
|
// code: 'ja-jp',
|
|
// file: 'ja-jp.json',
|
|
// default: false,
|
|
// },
|
|
// {
|
|
// code: 'nl-nl',
|
|
// file: 'nl-nl.json',
|
|
// default: false,
|
|
// },
|
|
// {
|
|
// code: 'pl-pl',
|
|
// file: 'pl-pl.json',
|
|
// default: false,
|
|
// },
|
|
// {
|
|
// code: 'pt-br',
|
|
// file: 'pt-br.json',
|
|
// default: false,
|
|
// },
|
|
// {
|
|
// code: 'ro-ro',
|
|
// file: 'ro-ro.json',
|
|
// default: false,
|
|
// },
|
|
{
|
|
code: 'ru-ru',
|
|
file: 'ru-ru.json'
|
|
},
|
|
// {
|
|
// code: 'zh-hans',
|
|
// file: 'zh-hans.json',
|
|
// default: false,
|
|
// },
|
|
];
|
|
|
|
export const DEFAULT_LOCALE_FALLBACK = 'en-gb'; |