> ## Documentation Index
> Fetch the complete documentation index at: https://docs.kiwify.com.br/llms.txt
> Use this file to discover all available pages before exploring further.

# Locales

> Translation files for multiple languages

# Locales

<Info>
  The locales folder contains translation files to support multiple languages, making your Members Area accessible to international students.
</Info>

## Overview

Each language has two files:

1. **Content translations** (`[language].default.json`) - For user-facing text
2. **Schema translations** (`[language].schema.json`) - For theme editor labels and instructions

## Supported Languages

* Portuguese (`pt.default.json` and `pt.schema.json`)
* English (`en.default.json` and `en.schema.json`)
* Spanish (`es.default.json` and `es.schema.json`)

<Warning>
  These files follow a fixed structure and cannot be deleted or renamed. All files must be kept in sync when adding new translation keys.
</Warning>

## Directory Structure

```
locales/
├── en.default.json
├── pt.default.json
├── es.default.json
├── en.schema.json
├── pt.schema.json
└── es.schema.json
```

## Content Translation Example

```json theme={null}
// en.default.json
{
  "general": {
    "continue": "Continue",
    "view_all": "View All",
    "completed": "Completed"
  },
  "courses": {
    "progress": "Progress",
    "start_course": "Start Course",
    "continue_course": "Continue Learning"
  }
}
```

## Schema Translation Example

```json theme={null}
// en.schema.json
{
  "sections": {
    "banner": {
      "name": "Banner",
      "settings": {
        "title": {
          "label": "Title",
          "info": "Heading displayed at the top of the banner"
        },
        "full_width": {
          "label": "Full Width",
          "info": "Extend the banner across the entire page width"
        }
      }
    }
  }
}
```

## Using Translations in Templates

To use translations in your Liquid templates, use the `t` filter with the translation key:

```liquid theme={null}
<button class="button">
  {{ 'courses.start_course' | t }}
</button>
```

The appropriate translation will be selected based on the user's language preference.

## Translation with Variables

You can include variables in your translations:

```json theme={null}
// en.default.json
{
  "courses": {
    "progress_info": "You have completed %{completed} of %{total} lessons"
  }
}
```

And in your Liquid template:

```liquid theme={null}
<p>
  {{ 'courses.progress_info' | t: completed: course.user_data.completion_count, total: course.total_lessons }}
</p>
```

## Using Translation in Schemas

To use translations in your schemas, use the `t:` prefix:

```json theme={null}
{
  "name": "t:sections.banner.name"
}
```

## Best Practices

<Tip>
  * Use a consistent naming structure for translation keys
  * Organize translations by feature or section
  * Keep translations concise and clear
  * Always update all language files when adding new keys
  * Use AI or professional translators for accurate translations
</Tip>

## Fallback Behavior

If a translation key is missing in the user's selected language, the system will attempt to use the portuguese version as a fallback. If the key is missing in all languages, the key itself will be displayed.
