This guide explains how to properly implement internationalization (i18n) for integration pages in the NexvioAI website.
All integration pages should use the i18n translation system to support multiple languages. The translations are stored in JSON files under /src/i18n/ directory.
getCurrentLanguage(pathname)Extracts the current language from the URL path.
const currentLang = getCurrentLanguage(Astro.url.pathname);
t(key, language)Gets a translated string using dot notation.
const title = t('integrations.slack.pageTitle', currentLang);
getLocalizedUrl(path, currentPath)Generates a URL with the correct language prefix.
const contactUrl = getLocalizedUrl('/contact', Astro.url.pathname);
The main integrations page (/src/pages/integrations/index.astro) uses translations for:
// Get current language
const currentLang = getCurrentLanguage(Astro.url.pathname);
// Use translations
const seoTitle = t('integrations.index.pageTitle', currentLang);
const heroTitle = t('integrations.index.heroTitle', currentLang);
Each integration page should follow the template structure and use translations for all text content.
For each integration (e.g., ‘slack’), you need these translation keys:
"integrations": {
"slack": {
"pageTitle": "Slack Integration - NexvioAI",
"heroTitle": "Bring AI-Powered Support to Your Slack Workspace",
"heroDescription": "Deploy NexvioAI in your Slack channels...",
"getStarted": "Get Started",
"scheduleDemo": "Book a Demo",
"featuresTitle": "Powerful Features for Your Slack Integration",
"features": {
"feature1Title": "AI-Powered Responses",
"feature1Desc": "Get instant answers powered by AI",
// ... more features
},
"benefits": {
"benefit1Title": "Instant Support",
"benefit1Desc": "No more waiting for responses",
// ... more benefits
},
"howItWorks": {
"title": "How It Works",
"step1Title": "Connect Your Workspace",
"step1Desc": "Authorize NexvioAI to access your Slack",
// ... more steps
},
"ctaTitle": "Ready to transform your Slack support?",
"ctaDescription": "Get started today and see the difference"
}
}
Copy the template:
cp src/pages/integrations/_template.astro src/pages/integrations/zendesk.astro
Update the integration key:
const integrationKey = 'zendesk'; // Change this to your integration
Add translations to all language files (en.json, es.json, fr.json, de.json):
"zendesk": {
"pageTitle": "Zendesk Integration - NexvioAI",
"heroTitle": "Supercharge Your Zendesk with AI",
// ... all required translations
}
Customize the page with integration-specific content, features, and benefits.
/integrations/slack/es/integrations/slack/fr/integrations/slack/de/integrations/slackThese keys are available for all pages:
// Common buttons and CTAs
t('common.getStarted', currentLang)
t('common.scheduleDemo', currentLang)
t('common.learnMore', currentLang)
t('common.contactUs', currentLang)
// Integration-specific common texts
t('integrations.subtitle', currentLang)
t('integrations.languages', currentLang)
t('integrations.resolution', currentLang)
See /src/pages/integrations/slack-example.astro for a complete example of how to implement an integration page with proper i18n support.