diff --git a/console/README.md b/console/README.md index 5c9edcd5f94..21b42336494 100644 --- a/console/README.md +++ b/console/README.md @@ -25,3 +25,4 @@ Run `ng e2e` to execute the end-to-end tests via [Protractor](http://www.protrac ## Further help To get more help on the Angular CLI use `ng help` or go check out the [Angular CLI README](https://github.com/angular/angular-cli/blob/master/README.md). + diff --git a/internal/admin/repository/eventsourcing/eventstore/iam.go b/internal/admin/repository/eventsourcing/eventstore/iam.go index 4346cce232d..cd12615849b 100644 --- a/internal/admin/repository/eventsourcing/eventstore/iam.go +++ b/internal/admin/repository/eventsourcing/eventstore/iam.go @@ -413,9 +413,10 @@ func (repo *IAMRepository) GetDefaultLoginTexts(ctx context.Context, lang string repo.mutex.Lock() defer repo.mutex.Unlock() contents, ok := repo.TranslationFileContents[lang] + var err error 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", lang)) + if caos_errs.IsNotFound(err) { contents, err = repo.readTranslationFile(fmt.Sprintf("/i18n/%s.yaml", repo.SystemDefaults.DefaultLanguage.String())) } if err != nil { @@ -448,6 +449,9 @@ func (repo *IAMRepository) getIAMEvents(ctx context.Context, sequence uint64) ([ func (repo *IAMRepository) readTranslationFile(filename string) ([]byte, error) { r, err := repo.LoginDir.Open(filename) + if os.IsNotExist(err) { + return nil, caos_errs.ThrowNotFound(err, "TEXT-3n9fs", "Errors.TranslationFile.NotFound") + } if err != nil { return nil, caos_errs.ThrowInternal(err, "TEXT-93njw", "Errors.TranslationFile.ReadError") } diff --git a/internal/management/repository/eventsourcing/eventstore/org.go b/internal/management/repository/eventsourcing/eventstore/org.go index fad36c15a50..099977c3c6a 100644 --- a/internal/management/repository/eventsourcing/eventstore/org.go +++ b/internal/management/repository/eventsourcing/eventstore/org.go @@ -628,9 +628,10 @@ func (repo *OrgRepository) GetDefaultLoginTexts(ctx context.Context, lang string repo.mutex.Lock() defer repo.mutex.Unlock() contents, ok := repo.TranslationFileContents[lang] + var err error 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", lang)) + if errors.IsNotFound(err) { contents, err = repo.readTranslationFile(fmt.Sprintf("/i18n/%s.yaml", repo.SystemDefaults.DefaultLanguage.String())) } if err != nil { @@ -771,6 +772,9 @@ func (repo *OrgRepository) getIAMEvents(ctx context.Context, sequence uint64) ([ func (repo *OrgRepository) readTranslationFile(filename string) ([]byte, error) { r, err := repo.LoginDir.Open(filename) + if os.IsNotExist(err) { + return nil, errors.ThrowNotFound(err, "TEXT-93nfl", "Errors.TranslationFile.NotFound") + } if err != nil { return nil, errors.ThrowInternal(err, "TEXT-3n8fs", "Errors.TranslationFile.ReadError") } diff --git a/internal/static/i18n/de.yaml b/internal/static/i18n/de.yaml index 42cf911fe9f..4f4473a307d 100644 --- a/internal/static/i18n/de.yaml +++ b/internal/static/i18n/de.yaml @@ -356,8 +356,9 @@ Errors: Invalid: Kundenspezifischer Text ist ungültig NotFound: Kundenspezifischer Text nicht gefunden TranslationFile: - ReadError: Übersetzungsfile konnte nicht gelesen werden - MergeError: Übersetzungsfile konnte nicht mit benutzerdefinierten Übersetzungen zusammengeführt werden + ReadError: Übersetzungsdatei konnte nicht gelesen werden + MergeError: Übersetzungsdatei konnte nicht mit benutzerdefinierten Übersetzungen zusammengeführt werden + NotFound: Übersetzungsdatei existiert nicht EventTypes: user: added: Benutzer hinzugefügt diff --git a/internal/static/i18n/en.yaml b/internal/static/i18n/en.yaml index bbfa066fd49..c4aa3c1fc62 100644 --- a/internal/static/i18n/en.yaml +++ b/internal/static/i18n/en.yaml @@ -358,6 +358,7 @@ Errors: TranslationFile: ReadError: Error in reading translation file MergeError: Translation file could not be merged with custom translations + NotFound: Translation file doesn't exist EventTypes: user: added: User added