1
0
mirror of https://github.com/zitadel/zitadel.git synced 2024-12-26 01:27:46 +00:00

23 lines
486 B
Go
Raw Permalink Normal View History

package query
import (
"context"
"github.com/zitadel/logging"
"golang.org/x/text/language"
"github.com/zitadel/zitadel/internal/i18n"
)
func (q *Queries) Languages(ctx context.Context) ([]language.Tag, error) {
if len(q.supportedLangs) == 0 {
langs, err := i18n.SupportedLanguages(q.LoginDir)
if err != nil {
logging.Log("ADMIN-tiMWs").WithError(err).Debug("unable to parse language")
return nil, err
}
q.supportedLangs = langs
}
return q.supportedLangs, nil
}