summaryrefslogtreecommitdiff
path: root/internal/config/helpers.gen.go
diff options
context:
space:
mode:
authorLibravatar tobi <31960611+tsmethurst@users.noreply.github.com>2023-11-17 11:35:28 +0100
committerLibravatar GitHub <noreply@github.com>2023-11-17 11:35:28 +0100
commitfc02d3c6f7db5a7794448f31fd9d6d81d3d224eb (patch)
treef792f799abadf784e493933af597d8f2292ab776 /internal/config/helpers.gen.go
parent[bugfix] process account delete side effects in serial, not in parallel (#2360) (diff)
downloadgotosocial-fc02d3c6f7db5a7794448f31fd9d6d81d3d224eb.tar.xz
[feature] Set/show instance language(s); show post language on frontend (#2362)
* update go text, include text/display * [feature] Set instance langs, show post lang on frontend * go fmt * WebGet * set language for whole article, don't use FA icon * mention instance languages + other optional config vars * little tweak * put languages in config properly * warn log language parse * change some naming around * tidy up validate a bit * lint * rename LanguageTmpl in template
Diffstat (limited to 'internal/config/helpers.gen.go')
-rw-r--r--internal/config/helpers.gen.go26
1 files changed, 26 insertions, 0 deletions
diff --git a/internal/config/helpers.gen.go b/internal/config/helpers.gen.go
index 6e9b71812..a008092d3 100644
--- a/internal/config/helpers.gen.go
+++ b/internal/config/helpers.gen.go
@@ -22,6 +22,7 @@ import (
"time"
"codeberg.org/gruf/go-bytesize"
+ "github.com/superseriousbusiness/gotosocial/internal/language"
)
// GetLogLevel safely fetches the Configuration value for state's 'LogLevel' field
@@ -924,6 +925,31 @@ func GetInstanceInjectMastodonVersion() bool { return global.GetInstanceInjectMa
// SetInstanceInjectMastodonVersion safely sets the value for global configuration 'InstanceInjectMastodonVersion' field
func SetInstanceInjectMastodonVersion(v bool) { global.SetInstanceInjectMastodonVersion(v) }
+// GetInstanceLanguages safely fetches the Configuration value for state's 'InstanceLanguages' field
+func (st *ConfigState) GetInstanceLanguages() (v language.Languages) {
+ st.mutex.RLock()
+ v = st.config.InstanceLanguages
+ st.mutex.RUnlock()
+ return
+}
+
+// SetInstanceLanguages safely sets the Configuration value for state's 'InstanceLanguages' field
+func (st *ConfigState) SetInstanceLanguages(v language.Languages) {
+ st.mutex.Lock()
+ defer st.mutex.Unlock()
+ st.config.InstanceLanguages = v
+ st.reloadToViper()
+}
+
+// InstanceLanguagesFlag returns the flag name for the 'InstanceLanguages' field
+func InstanceLanguagesFlag() string { return "instance-languages" }
+
+// GetInstanceLanguages safely fetches the value for global configuration 'InstanceLanguages' field
+func GetInstanceLanguages() language.Languages { return global.GetInstanceLanguages() }
+
+// SetInstanceLanguages safely sets the value for global configuration 'InstanceLanguages' field
+func SetInstanceLanguages(v language.Languages) { global.SetInstanceLanguages(v) }
+
// GetAccountsRegistrationOpen safely fetches the Configuration value for state's 'AccountsRegistrationOpen' field
func (st *ConfigState) GetAccountsRegistrationOpen() (v bool) {
st.mutex.RLock()