mirror of
https://github.com/zitadel/zitadel.git
synced 2024-12-15 04:18:01 +00:00
20 lines
484 B
Go
20 lines
484 B
Go
|
package admin
|
||
|
|
||
|
import (
|
||
|
"golang.org/x/text/language"
|
||
|
|
||
|
"github.com/zitadel/zitadel/internal/domain"
|
||
|
"github.com/zitadel/zitadel/pkg/grpc/admin"
|
||
|
)
|
||
|
|
||
|
func selectLanguagesToCommand(languages *admin.SelectLanguages) (tags []language.Tag, err error) {
|
||
|
allowedLanguages := languages.GetList()
|
||
|
if allowedLanguages == nil && languages != nil {
|
||
|
allowedLanguages = make([]string, 0)
|
||
|
}
|
||
|
if allowedLanguages == nil {
|
||
|
return nil, nil
|
||
|
}
|
||
|
return domain.ParseLanguage(allowedLanguages...)
|
||
|
}
|