photoprism/internal/i18n/locales_test.go
Michael Mayer c0f10e2288 Use gettext for backend translations too
Signed-off-by: Michael Mayer <michael@liquidbytes.net>
2020-07-15 01:26:54 +02:00

21 lines
380 B
Go

package i18n
import (
"testing"
"github.com/stretchr/testify/assert"
)
func TestSetLocale(t *testing.T) {
assert.Equal(t, English, locale)
SetLocale("D")
assert.Equal(t, English, locale)
SetLocale("De")
assert.Equal(t, German, locale)
SetLocale("PL")
assert.Equal(t, Polish, locale)
SetLocale("")
assert.Equal(t, English, locale)
assert.Equal(t, Default, locale)
}