Refactor i18n structure and update language files
- Removed old validation and common language files for English and Indonesian. - Created new language files for English and Indonesian under the updated directory structure. - Updated setup to reflect new language file paths and changed default language to English. - Modified storage keys from 'locale' to 'language' for consistency. - Added new language files for various modules including bookmarks, history, navigation, and system settings. - Introduced new booking module language files for both English and Indonesian. - Implemented a login page component with basic structure.
This commit is contained in:
+17
-13
@@ -4,11 +4,11 @@
|
||||
import { initTelemetry } from '@repo/core-api/observability/setup';
|
||||
|
||||
initTelemetry({
|
||||
appName: import.meta.env.VITE_APP_NAME || 'fe-monorepo-web',
|
||||
appVersion: import.meta.env.VITE_APP_VERSION || '0.0.0',
|
||||
telemetryUrl: import.meta.env.VITE_FARO_URL || 'https://telemetry.eigen.co.id/collect',
|
||||
otlpTraceUrl: import.meta.env.VITE_OTLP_TRACE_URL || 'https://telemetry.eigen.co.id/v1/traces',
|
||||
environment: import.meta.env.VITE_ENV || 'development',
|
||||
appName: ENV.APP_NAME,
|
||||
appVersion: ENV.APP_VERSION,
|
||||
telemetryUrl: ENV.FARO_URL,
|
||||
otlpTraceUrl: ENV.OTLP_TRACE_URL,
|
||||
environment: ENV.APP_ENV,
|
||||
});
|
||||
|
||||
// ─── Application Bootstrap ──────────────────────────────────────
|
||||
@@ -17,21 +17,25 @@ import { lazy, StrictMode } from 'react';
|
||||
import { createRoot } from 'react-dom/client';
|
||||
import { setupI18n } from '@repo/core-i18n';
|
||||
import { secureStorage, AppStorageKey } from './core/storage/local';
|
||||
import { ENV } from './core/environment';
|
||||
|
||||
const App = lazy(() => import('./apps'));
|
||||
|
||||
async function bootstrap() {
|
||||
// Initialize i18next and load language from secureStorage
|
||||
await setupI18n({
|
||||
storageAdapter: {
|
||||
getLanguage: async () => {
|
||||
return secureStorage.getItem<string>(AppStorageKey.LOCALE);
|
||||
},
|
||||
setLanguage: async (lng: string) => {
|
||||
await secureStorage.setItem(AppStorageKey.LOCALE, lng);
|
||||
await setupI18n(
|
||||
{
|
||||
storageAdapter: {
|
||||
getLanguage: async () => {
|
||||
return secureStorage.getItem<string>(AppStorageKey.LANGUAGE);
|
||||
},
|
||||
setLanguage: async (lng: string) => {
|
||||
await secureStorage.setItem(AppStorageKey.LANGUAGE, lng);
|
||||
},
|
||||
},
|
||||
},
|
||||
});
|
||||
ENV.DEFAULT_LANGUAGE,
|
||||
);
|
||||
|
||||
createRoot(document.getElementById('app')!).render(
|
||||
<StrictMode>
|
||||
|
||||
Reference in New Issue
Block a user