Skip to main content
Languages enable translated content across Lunar models such as products and collections.

Overview

Lunar supports multiple languages. By default, a language of “en” (English) is installed, but this can be changed to any language. Languages allow data in Lunar models to be translated, such as attributes on Products and Collections.
Lunar\Models\Language

Fields

FieldTypeDescription
ididPrimary key
codestringThe ISO 2-character language code, e.g. en
namestringA descriptive name, e.g. English
defaultbooleanWhether this is the default language
created_attimestamp
updated_attimestamp

Relationships

RelationshipTypeRelated ModelDescription
urlsHasManyLunar\Models\UrlURLs associated with this language

Scopes

ScopeDescription
default($default = true)Filter to the default language
There should only ever be one default language. Setting more than one language as default will likely cause unexpected behavior.