From b88a105a7c9255ce50d4e97f8986b92e2b749332 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B8rn=20Erik=20Pedersen?= Date: Sun, 5 Nov 2017 10:20:39 +0100 Subject: Revert "i18n: Allow custom language codes" This reverts commit bb04010cbfd92837685f98c3e0f5362ba00ce487. --- i18n/i18n_test.go | 21 --------------------- 1 file changed, 21 deletions(-) (limited to 'i18n/i18n_test.go') diff --git a/i18n/i18n_test.go b/i18n/i18n_test.go index 9e7aed039..6a9d362b0 100644 --- a/i18n/i18n_test.go +++ b/i18n/i18n_test.go @@ -23,11 +23,9 @@ import ( "github.com/gohugoio/hugo/config" "github.com/nicksnyder/go-i18n/i18n/bundle" - "github.com/nicksnyder/go-i18n/i18n/language" jww "github.com/spf13/jwalterweatherman" "github.com/spf13/viper" "github.com/stretchr/testify/require" - "strings" ) var logger = jww.NewNotepad(jww.LevelError, jww.LevelError, os.Stdout, ioutil.Discard, "", log.Ldate|log.Ltime) @@ -139,29 +137,10 @@ var i18nTests = []i18nTest{ expected: "hello", expectedFlag: "[i18n] hello", }, - // Non Unicode CLDR language code - { - data: map[string][]byte{ - "dk.toml": []byte("[hello]\nother = \"hej\""), - }, - args: nil, - lang: "dk", - id: "hello", - expected: "hej", - expectedFlag: "hej", - }, } func doTestI18nTranslate(t *testing.T, test i18nTest, cfg config.Provider) string { i18nBundle := bundle.New() - ids := []string{} - - for file := range test.data { - id := strings.TrimSuffix(file, ".toml") - ids = append(ids, id) - } - - language.RegisterPluralSpec(ids, &language.PluralSpec{}) for file, content := range test.data { err := i18nBundle.ParseTranslationFileBytes(file, content) -- cgit v1.2.3