/* * @mixxtor/adonisjs-translader * * (c) Mixxtor * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ import app from '@adonisjs/core/services/app' import { TranslationService as CoreTranslationService } from '@mixxtor/translader' import type { TranslationProviders } from '../src/types.js' /** * Translation service with full type inference * * Usage: * ```ts * import translation from '@mixxtor/adonisjs-translader/services/main' * * // Direct usage - no type casting needed * const result = await translation.translate({ * text: 'Hello', * from: 'en', * to: 'es' * }) * * // Provider switching with type inference * const googleProvider = translation.use('google-paid') // Only configured providers * const result = await googleProvider.translate({ text: 'Hello', from: 'en', to: 'es' }) * ``` */ let translation: CoreTranslationService> await app.booted(async () => { translation = await app.container.make('translation.manager') }) export { translation as default }