diff --git a/build/lint-locale/lint-locale_test.go b/build/lint-locale/lint-locale_test.go index d481a80e37..9e9a931feb 100644 --- a/build/lint-locale/lint-locale_test.go +++ b/build/lint-locale/lint-locale_test.go @@ -60,7 +60,7 @@ func TestLocalizationPolicy(t *testing.T) { t.Run("Escaped HTML characters", func(t *testing.T) { assert.Empty(t, checkLocaleContent([]byte("activity.git_stats_push_to_branch = `إلى %s و\"`"))) - assert.Equal(t, []string{"key: و\x1b[31m \x1b[0m\x1b[32m\u00a0\x1b[0m"}, checkLocaleContent([]byte(`key = و `))) + assert.Equal(t, []string{"key: و\x1b[31m \x1b[0m\x1b[32m\u00a0\x1b[0m"}, checkLocaleContent([]byte(`key = و `))) }) } diff --git a/modules/translation/localeiter/utils.go b/modules/translation/localeiter/utils.go index 669b816837..de398258e2 100644 --- a/modules/translation/localeiter/utils.go +++ b/modules/translation/localeiter/utils.go @@ -10,17 +10,12 @@ import ( "encoding/json" //nolint:depguard "fmt" - "gopkg.in/ini.v1" //nolint:depguard + "forgejo.org/modules/setting" ) func IterateMessagesContent(localeContent []byte, onMsgid func(string, string) error) error { - // Same configuration as Forgejo uses. - cfg := ini.Empty(ini.LoadOptions{ - IgnoreContinuation: true, - }) - cfg.NameMapper = ini.SnackCase - - if err := cfg.Append(localeContent); err != nil { + cfg, err := setting.NewConfigProviderForLocale(localeContent) + if err != nil { return err }