Skip to content

armgit / Piik

Public Imported from GitHub
0

Free, open-source screen sharing for private live streams with friends. Watch together in a browser or self-host Piik. 免费开源的私密屏幕共享,支持游戏直播、一起看电影与自部署。

703 B
Raw Blame
package app

import "testing"

func TestConsoleWindowsUILanguage(t *testing.T) {
	for _, test := range []struct {
		name string
		id   uintptr
		want string
	}{
		{"zh-CN", 0x0804, "zh"}, {"zh-TW", 0x0404, "zh"},
		{"zh-Hant", 0x7c04, "zh"}, {"zh-HK", 0x0c04, "zh"},
		{"zh-SG", 0x1004, "zh"}, {"en-US", 0x0409, "en"},
		{"ja-JP", 0x0411, "en"}, {"unknown", 0, "en"},
	} {
		if got := consoleLanguageFromWindowsUI(test.id); got != test.want {
			t.Errorf("%s = %q, want %q", test.name, got, test.want)
		}
	}
	actual := defaultConsoleLanguage()
	if actual != "zh" && actual != "en" {
		t.Fatalf("Windows display language produced %q", actual)
	}
	t.Logf("Actual Windows console language: %s", actual)
}