import { ITranslationService } from '@/application/ports/ITranslationService';
import { createTranslator } from '@/i18n';
import { Locale } from '@/i18n/types';

/**
 * INFRASTRUCTURE — Wraps existing i18n dictionaries behind a port
 */
export class I18nTranslationService implements ITranslationService {
  constructor(private readonly locale: Locale) {}

  translate(
    path: string,
    params?: Record<string, string | number>
  ): string {
    const t = createTranslator(this.locale);
    return t(path, params);
  }
}