Skip to main content

Translation Guide

This guide explains how to use and extend Ever Works' multilingual translation system powered by next-intl.

Supported Languagesโ€‹

Ever Works supports 13+ languages out of the box:

LanguageCodeFlag
๐Ÿ‡ฌ๐Ÿ‡ง EnglishenDefault
๐Ÿ‡ซ๐Ÿ‡ท Frenchfr
๐Ÿ‡ช๐Ÿ‡ธ Spanishes
๐Ÿ‡ฉ๐Ÿ‡ช Germande
๐Ÿ‡จ๐Ÿ‡ณ Chinesezh
๐Ÿ‡ธ๐Ÿ‡ฆ ArabicarRTL support
๐Ÿ‡ฎ๐Ÿ‡น Italianit
๐Ÿ‡ต๐Ÿ‡น Portuguesept
๐Ÿ‡ฏ๐Ÿ‡ต Japaneseja
๐Ÿ‡ฐ๐Ÿ‡ท Koreanko
๐Ÿ‡ท๐Ÿ‡บ Russianru
๐Ÿ‡ณ๐Ÿ‡ฑ Dutchnl
๐Ÿ‡ต๐Ÿ‡ฑ Polishpl

Usageโ€‹

In React Componentsโ€‹

import { useTranslations } from 'next-intl';

export function MyComponent() {
const t = useTranslations('help'); // 'help' is the namespace

return (
<div>
<h1>{t('PAGE_TITLE')}</h1>
<p>{t('PAGE_SUBTITLE')}</p>
</div>
);
}

Translation File Structureโ€‹

Translation files are located in the /messages folder:

messages/
โ”œโ”€โ”€ en.json # English (default)
โ”œโ”€โ”€ fr.json # French
โ”œโ”€โ”€ es.json # Spanish
โ”œโ”€โ”€ de.json # German
โ”œโ”€โ”€ zh.json # Chinese
โ”œโ”€โ”€ ar.json # Arabic
โ””โ”€โ”€ ... # Other languages

JSON Formatโ€‹

{
"help": {
"PAGE_TITLE": "Help Center",
"PAGE_SUBTITLE": "Complete guide to using Ever Works",
"SECTION": {
"NESTED_KEY": "Nested translation"
}
}
}

Adding New Translationsโ€‹

Step 1: Add Keys in Englishโ€‹

Open messages/en.json and add your new keys:

{
"help": {
// ... existing translations ...
"NEW_SECTION_TITLE": "New Section",
"NEW_SECTION_DESC": "Description of the new section"
}
}

Step 2: Translate to Other Languagesโ€‹

French (messages/fr.json)โ€‹

{
"help": {
"NEW_SECTION_TITLE": "Nouvelle Section",
"NEW_SECTION_DESC": "Description de la nouvelle section"
}
}

Spanish (messages/es.json)โ€‹

{
"help": {
"NEW_SECTION_TITLE": "Nueva Secciรณn",
"NEW_SECTION_DESC": "Descripciรณn de la nueva secciรณn"
}
}

Translation Namespacesโ€‹

Common (common)โ€‹

  • Navigation elements
  • Common actions (save, cancel, delete)
  • General messages

Auth (auth)โ€‹

  • Login and registration
  • Password management
  • Authentication errors

Help (help)โ€‹

  • Help center content
  • FAQ sections
  • Support information

Pricing (pricing)โ€‹

  • Pricing plans
  • Feature lists
  • Billing information

Submit (submit)โ€‹

  • Form labels and placeholders
  • Validation messages
  • Success/error messages

Best Practicesโ€‹

1. Naming Conventionsโ€‹

Use descriptive, uppercase keys with underscores:

{
// โœ… Good
"FAQ_SETUP_TIME": "How long does setup take?",
"FORM_ERROR_EMAIL": "Invalid email address",

// โŒ Bad
"FAQ_1": "How long does setup take?",
"ERROR1": "Invalid email address"
}

2. Placeholders and Variablesโ€‹

{
"WELCOME_MESSAGE": "Welcome {name}!",
"ITEMS_COUNT": "You have {count} items"
}

Usage:

t('WELCOME_MESSAGE', { name: 'John' })
t('ITEMS_COUNT', { count: 5 })

3. Pluralizationโ€‹

{
"ITEMS": {
"zero": "No items",
"one": "1 item",
"other": "{count} items"
}
}

Usage:

t('ITEMS', { count: 0 })  // "No items"
t('ITEMS', { count: 1 }) // "1 item"
t('ITEMS', { count: 5 }) // "5 items"

4. Rich Text Formattingโ€‹

{
"TERMS": "By signing up, you agree to our <link>Terms of Service</link>"
}

Usage:

t.rich('TERMS', {
link: (chunks) => <Link href="/terms">{chunks}</Link>
})

Adding a New Languageโ€‹

Step 1: Create Message Fileโ€‹

# Copy English file as template
cp messages/en.json messages/it.json # Example for Italian

Step 2: Update Configurationโ€‹

In i18n/routing.ts:

export const routing = defineRouting({
locales: ['en', 'fr', 'es', 'de', 'zh', 'ar', 'it'], // Add 'it'
defaultLocale: 'en',
localePrefix: 'as-needed'
});

Step 3: Add Flag Iconโ€‹

Place the SVG file in /public/flags/it.svg

Step 4: Translate Contentโ€‹

Translate all keys in messages/it.json to Italian

Step 5: Testโ€‹

# Start dev server
npm run dev

# Visit the new locale
http://localhost:3000/it

Checking Missing Translationsโ€‹

Verification Scriptโ€‹

# Compare keys between English and French
diff <(jq -r 'paths(scalars) as $p | $p | join(".")' messages/en.json | sort) \
<(jq -r 'paths(scalars) as $p | $p | join(".")' messages/fr.json | sort)
  • i18n Ally - VS Code extension for managing translations
  • BabelEdit - Visual translation editor
  • Crowdin - Collaborative translation platform

RTL Support (Arabic)โ€‹

Ever Works includes built-in RTL (Right-to-Left) support for Arabic:

// Automatically applied based on locale
<html dir={locale === 'ar' ? 'rtl' : 'ltr'}>

Testing RTLโ€‹

  1. Switch to Arabic locale
  2. Verify layout mirrors correctly
  3. Check text alignment
  4. Test navigation and forms

Translation Checklistโ€‹

When adding new features with text:

  • Add keys in English (en.json)
  • Translate to French (fr.json)
  • Translate to Spanish (es.json)
  • Translate to German (de.json)
  • Translate to Chinese (zh.json)
  • Translate to Arabic (ar.json)
  • Translate to other supported languages
  • Test in all languages
  • Check RTL for Arabic
  • Document new keys

Troubleshootingโ€‹

Missing Translation Warningโ€‹

Issue: Console shows "Missing translation" warning

Solution: Add the missing key to all language files

// Add to all messages/*.json files
{
"namespace": {
"MISSING_KEY": "Translation text"
}
}

Translation Not Updatingโ€‹

Issue: Changes to translation files not reflecting

Solution: Restart the development server

# Stop the server (Ctrl+C)
# Start again
npm run dev

Locale Not Switchingโ€‹

Issue: Language switcher doesn't change locale

Solution: Verify routing configuration

// Check i18n/routing.ts
export const routing = defineRouting({
locales: ['en', 'fr', 'es', ...], // Ensure locale is listed
defaultLocale: 'en'
});

Professional Translation Servicesโ€‹

For legal or sensitive content, consider professional services:

  • DeepL - High-quality AI translation
  • Gengo - Professional human translators
  • Smartling - Enterprise translation platform

Contributing Translationsโ€‹

To contribute translations:

  1. Fork the repository
  2. Create a branch: git checkout -b translation/my-language
  3. Add/modify translations in messages/
  4. Test thoroughly
  5. Submit a Pull Request

Next Stepsโ€‹

Resourcesโ€‹