mirror of
https://github.com/zitadel/zitadel.git
synced 2025-08-11 21:07:31 +00:00
fix: return default language file, if requested lang does not exist for default login texts (#1988)
* fix: return default language file, if requested lang doesnt exists * feat: read default translation file * feat: docs
This commit is contained in:
@@ -5,6 +5,7 @@ import (
|
||||
"fmt"
|
||||
"io/ioutil"
|
||||
"net/http"
|
||||
"os"
|
||||
"strings"
|
||||
"sync"
|
||||
|
||||
@@ -414,6 +415,9 @@ func (repo *IAMRepository) GetDefaultLoginTexts(ctx context.Context, lang string
|
||||
contents, ok := repo.TranslationFileContents[lang]
|
||||
if !ok {
|
||||
contents, err := repo.readTranslationFile(fmt.Sprintf("/i18n/%s.yaml", lang))
|
||||
if os.IsNotExist(err) {
|
||||
contents, err = repo.readTranslationFile(fmt.Sprintf("/i18n/%s.yaml", repo.SystemDefaults.DefaultLanguage.String()))
|
||||
}
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
Reference in New Issue
Block a user