Skip to content

Latest commit

 

History

History
45 lines (32 loc) · 1.25 KB

File metadata and controls

45 lines (32 loc) · 1.25 KB

Internationalization (i18n) Guidelines

Key Labeling in JSON Files

When labeling keys in JSON files for translation, follow these guidelines:

  1. Use Descriptive Keys: Keys should be descriptive and provide context about the text they represent.
  2. CamelCase Format: Use camelCase for key names or lowercase for dynamic keys.
  3. Use Subsections for Keys: Create subsections for keys to group related translations together.

Example

{
    "header": {
        "title": "Welcome",
        "subtitle": "Your journey starts here"
    },
    "footer": {
        "contact": "Contact Us"
    }
}

Naming Translation Files

Translation files should be named according to the following conventions:

  1. Common File: Use common.json for translations that are used across multiple routes or components.
  2. Route-Specific Files: Name files based on the first segment of the route they correspond to.

Example

For a route /dashboard/settings, the translation file should be named dashboard.json.

File Structure

/en
    ├── common.json
    ├── dashboard.json
    └── profile.json

By following these guidelines, you ensure a consistent and maintainable approach to internationalization in your project.