LogoLogo
Build appsContact API support
  • Build apps
  • Site Templates
  • API Reference
  • Changelog
  • Introduction to Instant Site development
  • Site templates glossary
  • Develop Site templates
    • Quickstart guide to a working Site template
    • Ecwid (Lightspeed E-Series) Crane CLI tool
    • Build Site templates: project structure
      • template-name.ts
      • section-name.vue
      • content.ts
      • design.ts
      • showcases/1.ts
      • translations.ts
      • layout.ts
  • Launch Site templates
    • Step-by-step publishing guide for Site templates
    • Monetize Site templates
    • Requirements for public Site templates
    • Recommendations for building public Site templates
  • Develop custom sections
    • How to use sections without templates
    • Quickstart with custom sections without building a template

Lightspeed® 2025

On this page

Was this helpful?

  1. Develop Site templates
  2. Build Site templates: project structure

translations.ts

The tranlations.ts file defines text translations for labels added across the template project. Text labels are used independently in two places:

  • Text labels explain content and design settings to users in the IS Editor. Settings inside content.ts and design.ts files have the label field. The tranlations.ts file adds text values for these labels in one or several languages.

  • Text labels in showcase files like 1.ts are used to display section previews in several languages.

Users will see texts defined in tranlations.ts files in the matching language in the Instant Site Editor. If the language is not available, they'll see the English translation.

Therefore, translations.ts files have the following requirements:

  • The en translations are required for all section texts.

  • Each section requires two translation.ts files in the settings and showcases folders.

  • All labels defined in files in the settings and showcases folders must have text values, in all languages defined in the translation.ts file.

To create a translations.ts file, declare object named with a language code (ISO 639-1) for every translation you want to add and put '$label': 'text' pairs inside.

Code example:

en: {
	'$label.inputbox_1_name': 'Title',
	'$label.inputbox_1_desc': 'Description',
	'$label.color_picker_name': 'Select color for the navigation arrows',
},
es: {
	...
},
nl: {
	...
}

Check out the example section from the crane tool. It has working 'translations.ts' files for both "settings" and "showcases" folders.

Last updated 7 months ago

Was this helpful?