Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 1 addition & 11 deletions internal/darwin/locale.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,17 +70,7 @@ func appleLanguages(own bool) []string {
}

func (a appController) PreferredLanguages() []string {
if langs := appleLanguages(false); len(langs) > 0 {
return langs
}
// A user who never ordered languages: the system's.
var out []string
withPool(func() {
for _, s := range arrayItems(send(class("NSLocale"), "preferredLanguages")) {
out = append(out, goString(s))
}
})
return out
return appleLanguages(false)
}

func (a appController) SavedLocale() (string, bool) {
Expand Down
3 changes: 0 additions & 3 deletions internal/darwin/locale_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,6 @@ func TestLocales(t *testing.T) {
load()
a := appController{}
langs := a.PreferredLanguages()
if len(langs) == 0 {
t.Fatal("no preferred languages")
}
if r := a.Region(); r.Locale == "" || r.FirstWeekday < 0 || r.HourCycle == 0 {
t.Errorf("Region() = %+v", r)
}
Expand Down
Loading