locale

package
v0.4.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 29, 2024 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Ja = "ja"
	En = "en"
)
View Source
const (
	// nouns
	Account                      = "Account"
	AccountRole                  = "AccountRole"
	AccountName                  = "AccountName"
	AccountAvatarImageURL        = "AccountAvatarImageURL"
	AccountOrganizationRole      = "AccountOrganizationRole"
	AccountEnvironmentRoles      = "AccountEnvironmentRoles"
	AdminAccount                 = "AdminAccount"
	AdminNotification            = "AdminNotification"
	AdminNotificationType        = "AdminNotificationType"
	AutoOperation                = "AutoOperation"
	AutoOperationType            = "AutoOperationType"
	AutoOperationExecutionTime   = "AutoOperationExecutionTime"
	APIKey                       = "APIKey"
	Datetime                     = "Datetime"
	DefaultStrategy              = "DefaultStrategy"
	Environment                  = "Environment"
	EventRate                    = "EventRate"
	Experiment                   = "Experiment"
	ExperimentStartDate          = "ExperimentStartDate"
	ExperimentEndDate            = "ExperimentEndDate"
	ExperimentPeriod             = "ExperimentPeriod"
	FeatureFlagID                = "FeatureFlagID"
	FeatureFlag                  = "FeatureFlag"
	FeatureFlagVariation         = "FeatureFlagVariation"
	FeatureFlagVersion           = "FeatureFlagVersion"
	Goal                         = "Goal"
	IndividualUser               = "IndividualUser"
	Notification                 = "Notification"
	NotificationType             = "NotificationType"
	OffVariation                 = "OffVariation"
	Organization                 = "Organization"
	Prerequisite                 = "Prerequisite"
	PrerequisiteVariation        = "PrerequisiteVariation"
	Project                      = "Project"
	ProgressiveRollout           = "ProgressiveRollout"
	Push                         = "Push"
	PushTag                      = "PushTag"
	RandomSampling               = "RandomSampling"
	Rule                         = "Rule"
	RuleAttribute                = "RuleAttribute"
	RuleCondition                = "RuleCondition"
	RuleFixedStrategyVariation   = "RuleFixedStrategyVariation"
	RulesOrder                   = "RulesOrder"
	RuleOperator                 = "RuleOperator"
	RuleRolloutStrategyVariation = "RuleRolloutStrategyVariation"
	RuleStrategy                 = "RuleStrategy"
	Segment                      = "Segment"
	SegmentRule                  = "SegmentRule"
	SegmentRuleAttribute         = "SegmentRuleAttribute"
	SegmentRuleOperator          = "SegmentRuleOperator"
	SegmentUser                  = "SegmentUser"
	SegmentUserUploadStatus      = "SegmentUserUploadStatus"
	Variation                    = "Variation"
	Tag                          = "Tag"
	TrialProject                 = "TrialProject"
	Webhook                      = "Webhook"
	WebhookRule                  = "WebhookRule"
	FlagTrigger                  = "FlagTrigger"

	// error sentence
	RequiredFieldTemplate = "RequiredField"
	InternalServerError   = "InternalServerError"
	NotFoundError         = "NotFoundError"
	InvalidArgumentError  = "InvalidArgumentError"
	UnauthenticatedError  = "UnauthenticatedError"
	PermissionDenied      = "PermissionDenied"
	AlreadyExistsError    = "AlreadyExistsError"
	AlreadyDeletedError   = "AlreadyDeletedError"
	// event counter
	StartAtIsAfterEndAt = "StartAtIsAfterEndAt"
	// environment
	ProjectDisabled = "ProjectDisabled"
	// feature
	SegmentInUse                             = "SegmentInUse"
	SegmentUsersAlreadyUploading             = "SegmentUsersAlreadyUploading"
	SegmentStatusNotSucceeded                = "SegmentStatusNotSucceeded"
	HasWaitingOrRunningExperiment            = "HasWaitingOrRunningExperiment"
	NothingToChange                          = "NothingToChange"
	DifferentVariationsSize                  = "DifferentVariationsSize"
	WaitingOrRunningProgressiveRolloutExists = "WaitingOrRunningProgressiveRolloutExists"
	// auto ops
	AutoOpsFeatureDisabled                  = "AutoOpsFeatureDisabled"
	AutoOpsFeatureHasIndividualTargeting    = "AutoOpsFeatureHasIndividualTargeting"
	AutoOpsFeatureHasPrerequisites          = "AutoOpsFeatureHasPrerequisites"
	AutoOpsFeatureHasRules                  = "AutoOpsFeatureHasRules"
	AutoOpsHasDatetime                      = "AutoOpsHasDatetime"
	AutoOpsHasWebhook                       = "AutoOpsHasWebhook"
	AutoOpsInvalidScheduleSpans             = "AutoOpsInvalidScheduleSpans"
	AutoOpsInvalidVariationSize             = "AutoOpsInvalidVariationSize"
	AutoOpsWaitingOrRunningExperimentExists = "AutoOpsWaitingOrRunningExperimentExists"
	AutoOpsProgressiveRolloutInProgress     = "AutoOpsProgressiveRolloutInProgress"
)

status error messages

View Source
const (
	UnknownOperation           = "UnknownOperation"
	CreatedTemplate            = "Created"
	EnabledTemplate            = "Enabled"
	DisabledTemplate           = "Disabled"
	ArchivedTemplate           = "Archived"
	UnarchivedTemplate         = "Unarchived"
	DeletedTemplate            = "Deleted"
	AddedTemplate              = "Added"
	ConditionAddedTemplate     = "ConditionAdded"
	ConditionDeletedTemplate   = "ConditionDeleted"
	ChangedTemplate            = "Changed"
	DescriptionUpdatedTemplate = "DescriptionUpdated"
	IncrementedTemplate        = "Incremented"
	NameUpdatedTemplate        = "NameUpdated"
	UpdatedTemplate            = "Updated"
	StartedTemplate            = "Started"
	StoppedTemplate            = "Stopped"
	FinishedTemplate           = "Finished"
	ExecutedTemplate           = "Executed"
	UploadedTemplate           = "Uploaded"
	ResetTemplate              = "Reset"
	ClonedTemplate             = "Cloned"
	TrialConverted             = "TrialConverted"
	ValueAddedTemplate         = "ValueAdded"
	ValueUpdatedTemplate       = "ValueUpdated"
	ValueDeletedTemplate       = "ValueDeleted"
)

domain events

Variables

This section is empty.

Functions

func GetLocation added in v0.3.0

func GetLocation(timezone string) (*time.Location, error)

Types

type Locale

type Locale interface {
	GetLocale() string
}

func NewLocale

func NewLocale(l string) Locale

type Localizer

type Localizer interface {
	Locale
	MustLocalize(id string) string
	MustLocalizeWithTemplate(id string, fields ...string) string
}

func NewLocalizer

func NewLocalizer(ctx context.Context, fopts ...Option) Localizer

type Option

type Option interface {
	// contains filtered or unexported methods
}

func WithBundle

func WithBundle(bundle *i18n.Bundle) Option

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL