package i18n_test

import (
	"os"
	"testing"

	"coopcloud.tech/abra/pkg/i18n"
)

func TestLoadLocale(t *testing.T) {
	originalLang := os.Getenv("LANG")
	os.Setenv("LANG", "es_ES.UTF-8")
	t.Cleanup(func() {
		os.Setenv("LANG", originalLang)
	})

	locale, _ := i18n.LoadLocale()
	if locale != "es" {
		t.Fatalf("expected 'es', locale was '%s'", locale)
	}
}
