/**
 * UI internationalization module
 * This file is maintained for backward compatibility
 * New code should import from translations.ts directly
 */

// Re-export from translations.ts
export { languages, defaultLang, translations as structuredUI } from './translations';

// Import flattened translations for compatibility layer
import { flatTranslations } from './translations';

/**
 * Create a backward compatible UI object
 * This maintains the old API for existing code
 */
function createCompatibleUi() {
  const compatibleUi: Record<string, any> = {};
  
  // Create a proxy for each language
  Object.keys(flatTranslations).forEach(lang => {
    compatibleUi[lang] = new Proxy({}, {
      get(target, prop) {
        if (typeof prop !== 'string') return undefined;
        
        // Return the translation from flattened translations
        return flatTranslations[lang][prop];
      }
    });
  });
  
  return compatibleUi;
}

// Export the compatible UI object
export const ui = createCompatibleUi();