Skip to content

Commit

Permalink
Merge pull request #61 from razor-1/lir
Browse files Browse the repository at this point in the history
Liberian english
  • Loading branch information
razor-1 authored Mar 17, 2024
2 parents dbdd570 + 3478fb6 commit 37b8920
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
2 changes: 2 additions & 0 deletions locale.go
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,8 @@ func getFallbackTag(tag language.Tag) (language.Tag, error) {
return language.Catalan, nil
case "quc":
return language.LatinAmericanSpanish, nil
case "lir":
return language.English, nil
}

return language.Tag{}, fmt.Errorf("no fallback for tag %s", tag.String())
Expand Down
7 changes: 7 additions & 0 deletions locale_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -194,4 +194,11 @@ func TestGetLocaleData(t *testing.T) {
l, err = localizer.GetLocaleData(tag)
ta.NoError(err)
ta.Equal(language.LatinAmericanSpanish, language.MustParse(l.Locale))

tag, err = language.Parse("lir")
ta.NoError(err)
ta.Equal("lir", tag.String())
l, err = localizer.GetLocaleData(tag)
ta.NoError(err)
ta.Equal("en", language.MustParse(l.Locale).String())
}

0 comments on commit 37b8920

Please sign in to comment.