Overview
The AI Translations package can be configured through theconfig/ai-translations.php file. After installing the package, publish the configuration file using:
Configuration Options
The list of languages to support in your application.
- When set to
null, the package automatically reads existing languages from yourlang_path()directory - You can manually specify an array of language codes to explicitly define supported languages
The AI provider to use for translations.Supported values:
"openai"- Use OpenAI’s GPT models"gemini"- Use Google’s Gemini models"anthropic"- Use Anthropic’s Claude models
OpenAI Configuration
The default OpenAI model to use for translations.This model is used for standard translation operations.
The fast OpenAI model to use for quick translations.This model is optimized for speed and cost efficiency.
Your OpenAI API key.Default: Reads from
OPENAI_API_KEY environment variableStore your API key in your
.env file, never commit it to version control.Gemini Configuration
The default Gemini model to use for translations.This model is used for standard translation operations.
The fast Gemini model to use for quick translations.This model is optimized for speed and cost efficiency.
Your Google Gemini API key.Default: Reads from
GEMINI_API_KEY environment variableStore your API key in your
.env file, never commit it to version control.Anthropic Configuration
The default Anthropic Claude model to use for translations.This model is used for standard translation operations.
The fast Anthropic Claude model to use for quick translations.This model is optimized for speed and cost efficiency.
Your Anthropic API key.Default: Reads from
ANTHROPIC_API_KEY environment variableStore your API key in your
.env file, never commit it to version control.Example Configurations
- Auto-detect Languages
- Manual Languages
- Anthropic Provider
Environment Variables
Add the appropriate API key to your.env file based on your chosen provider: