Configuration Guide
Learn how to configure GoTranslate for your project's specific needs.
Configuration File
After initialization, you'll find a gotranslate.config.json file in your project root:
{
"apiKey": "your-api-key-here",
"sourceLanguage": "en",
"targetLanguages": ["ar", "fr", "es", "de"],
"translationPath": "./locales",
"formats": ["json", "yaml"]
}
Configuration Options
- apiKey: Your GoTranslate API key from the dashboard
- sourceLanguage: The base language of your application
- targetLanguages: Array of languages to translate into
- translationPath: Directory where translation files are stored
- formats: Output format (json, yaml, po, etc.)
Environment Variables
For security, you can also use environment variables:
GOTRANSLATE_API_KEY=your_api_key_here
GOTRANSLATE_PROJECT_ID=your_project_id
Framework-Specific Setup
Laravel
// config/gotranslate.php
return [
'api_key' => env('GOTRANSLATE_API_KEY'),
'source_language' => 'en',
'target_languages' => ['ar', 'fr', 'es'],
];
Next.js
// next.config.js
module.exports = {
i18n: {
locales: ['en', 'ar', 'fr', 'es'],
defaultLocale: 'en',
},
gotranslate: {
apiKey: process.env.GOTRANSLATE_API_KEY,
},
}
Next Steps
Now that your project is configured, learn about creating and managing projects.