Skip to content

Commit

Permalink
Add support for locale and currency
Browse files Browse the repository at this point in the history
fixes #62
  • Loading branch information
TrayserCassa committed Nov 18, 2024
1 parent c7dc075 commit 5e6edbd
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
9 changes: 8 additions & 1 deletion api/v1/env.go
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,6 @@ func (s *Store) getStorage() []corev1.EnvVar {
}

func (s *Store) GetEnv() []corev1.EnvVar {

// TODO: Use map for overwriting when using ENVs from customer
c := []corev1.EnvVar{
{
Expand Down Expand Up @@ -302,6 +301,14 @@ func (s *Store) GetEnv() []corev1.EnvVar {
Name: "SQL_SET_DEFAULT_SESSION_VARIABLES",
Value: "0",
},
{
Name: "INSTALL_LOCALE",
Value: s.Spec.ShopConfiguration.Locale,
},
{
Name: "INSTALL_CURRENCY",
Value: s.Spec.ShopConfiguration.Currency,
},
{
Name: "APP_URL",
Value: fmt.Sprintf("https://%s", s.Spec.Network.Host),
Expand Down
8 changes: 8 additions & 0 deletions api/v1/store.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,9 @@ type StoreSpec struct {
HorizontalPodAutoscaler HPASpec `json:"horizontalPodAutoscaler,omitempty"`
ServiceAccountName string `json:"serviceAccountName,omitempty"`

// +kubebuilder:default={Currency: "EURO", Locale: "en-GB"}
ShopConfiguration Configuration `json:"shopConfiguration,omitempty"`

// +kubebuilder:default=false
DisableChecks bool `json:"disableChecks,omitempty"`
DisableJobDeletion bool `json:"disableJobDeletion,omitempty"`
Expand Down Expand Up @@ -73,6 +76,11 @@ func init() {
SchemeBuilder.Register(&Store{}, &StoreList{})
}

type Configuration struct {
Currency string `json:"currency"`
Locale string `json:"locale"`
}

type Credentials struct {
Username string `json:"username"`
Password string `json:"password,omitempty"`
Expand Down

0 comments on commit 5e6edbd

Please sign in to comment.