feat: site languages, setup and site URL settings

This commit is contained in:
Florian Sylvain committed 2026-11-01 22:13:02 +01:00
1 parent 0806733d5c
commit d9158025d4
106 files changed
+10184 -56

No files matched your search

@@ -0,0 +1,47 @@
package localization
import "errors"
var (
ErrSetupRequired = errors.New("the site has no confirmed default language")
ErrLanguagesChanged = errors.New("the languages changed since they were read")
ErrLanguageInUse = errors.New("a language still used by a version cannot be removed")
ErrDefaultNotEnabled = errors.New("the default language must be one of the enabled languages")
ErrNoEnabledLanguage = errors.New("at least one language must stay enabled")
ErrDuplicateLanguage = errors.New("the same language is listed twice")
ErrInvalidSocialLocale = errors.New("invalid social locale")
ErrSetupInProgress = errors.New("another language setup is running")
ErrSetupIncomplete = errors.New("every pending site needs a language")
ErrDuplicateSite = errors.New("the same site is listed twice")
)
const (
SocialLocaleSet = "set"
SocialLocaleDerived = "derived"
SocialLocaleNotSet = "not_set"
)
type Row struct {
Tag string
IsDefault bool
Enabled bool
Confirmed bool
SocialLocale *string
}
type VersionCount struct {
Total int
Published int
Trashed int
}
type Entry struct {
Tag string
Enabled bool
SocialLocale *string
}
type Change struct {
Default string
Languages []Entry
}