diff --git a/.github/workflows/lint.yaml b/.github/workflows/lint.yaml index 27fcce2..5ea4c93 100644 --- a/.github/workflows/lint.yaml +++ b/.github/workflows/lint.yaml @@ -8,14 +8,14 @@ jobs: if: github.event.pull_request.draft == false runs-on: ubuntu-latest steps: - - uses: actions/setup-go@v4 + - uses: actions/setup-go@v5 with: - go-version: '1.21' + go-version: '1.23' check-latest: true - name: checkout uses: actions/checkout@v4 - name: golangci-lint - uses: golangci/golangci-lint-action@v3 + uses: golangci/golangci-lint-action@v6 with: # Required: the version of golangci-lint is required and must be specified without patch version: we always use the latest patch version. - version: v1.55 + version: v1.61 diff --git a/.golangci.yaml b/.golangci.yaml index e0c019d..e69de29 100644 --- a/.golangci.yaml +++ b/.golangci.yaml @@ -1,6 +0,0 @@ -linters: - enable: - - golint -issues: - include: - - EXC0002 # disable excluding of issues about comments from golint diff --git a/locale.go b/locale.go index 71826b3..f81b4f5 100644 --- a/locale.go +++ b/locale.go @@ -143,6 +143,10 @@ func getFallbackTag(tag language.Tag) (language.Tag, error) { return language.English, nil case "bzj": return language.English, nil + case "fon": + return language.Make("ee"), nil + case "tw": + return language.Make("ak"), nil } return language.Tag{}, fmt.Errorf("no fallback for tag %s", tag.String()) diff --git a/locale_test.go b/locale_test.go index f3a9c6a..7175165 100644 --- a/locale_test.go +++ b/locale_test.go @@ -208,4 +208,18 @@ func TestGetLocaleData(t *testing.T) { l, err = localizer.GetLocaleData(tag) ta.NoError(err) ta.Equal("en", language.MustParse(l.Locale).String()) + + tag, err = language.Parse("fon") + ta.NoError(err) + ta.Equal("fon", tag.String()) + l, err = localizer.GetLocaleData(tag) + ta.NoError(err) + ta.Equal("ee", language.MustParse(l.Locale).String()) + + tag, err = language.Parse("tw") + ta.NoError(err) + ta.Equal("tw", tag.String()) + l, err = localizer.GetLocaleData(tag) + ta.NoError(err) + ta.Equal("ak", language.MustParse(l.Locale).String()) }