Locales
The locales folder contains translation files to support multiple languages, making your Members Area accessible to international students.
Overview
Each language has two files:
- Content translations (
[language].default.json) - For user-facing text
- 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)
These files follow a fixed structure and cannot be deleted or renamed. All files must be kept in sync when adding new translation keys.
Directory Structure
locales/
├── en.default.json
├── pt.default.json
├── es.default.json
├── en.schema.json
├── pt.schema.json
└── es.schema.json
Content Translation Example
// 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
// 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:
<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:
// en.default.json
{
"courses": {
"progress_info": "You have completed %{completed} of %{total} lessons"
}
}
And in your Liquid template:
<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:
{
"name": "t:sections.banner.name"
}
Best Practices
- 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
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.