File tree Expand file tree Collapse file tree 3 files changed +71
-0
lines changed Expand file tree Collapse file tree 3 files changed +71
-0
lines changed Original file line number Diff line number Diff line change
1
+ # GitHub Actions workflow to lint the locale files.
2
+ name : " Lint"
3
+ on :
4
+ push :
5
+ branches : [ "main" ]
6
+ pull_request :
7
+ branches : [ "main" ]
8
+ merge_group :
9
+
10
+ concurrency :
11
+ group : " ${{ github.workflow }}-${{ github.event.number || github.ref }}"
12
+ cancel-in-progress : " ${{ github.event.action != 'merge_group' }}"
13
+
14
+ permissions :
15
+ contents : read
16
+
17
+ jobs :
18
+ lint :
19
+ name : " Lint"
20
+ runs-on : " ubuntu-latest"
21
+ steps :
22
+ - name : " Checkout repository"
23
+ uses : actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4
24
+ with :
25
+ fetch-depth : 0
26
+ submodules : true
27
+
28
+ - name : " Setup Go stable"
29
+ uses : actions/setup-go@0c52d547c9bc32b1aa3301fd7a9cb496313a4491 # v5
30
+ with :
31
+ go-version : " stable"
32
+ cache : true
33
+ check-latest : true
34
+
35
+ - name : " Download dependencies"
36
+ run : go mod download
37
+
38
+ - name : " Verify dependencies"
39
+ run : go mod verify
40
+
41
+ - name : " Build"
42
+ run : go build -v ./...
43
+
44
+ - name : " Test"
45
+ run : go test -race -v ./...
46
+
47
+ - name : " Lint"
48
+ run : |
49
+ go build -trimpath ./cmd/lang-lint
50
+ ./lang-lint
Original file line number Diff line number Diff line change
1
+ package main
2
+
3
+ import (
4
+ "fmt"
5
+ "os"
6
+
7
+ "hypera.dev/axolotl-lang/v2"
8
+ )
9
+
10
+ func main () {
11
+ if err := lang .LoadLocales (); err != nil {
12
+ _ , _ = fmt .Fprintln (os .Stderr , err )
13
+ os .Exit (1 )
14
+ }
15
+
16
+ fmt .Println ("Locales loaded successfully" , lang .Bundle ().LanguageTags ())
17
+ }
Original file line number Diff line number Diff line change @@ -41,6 +41,10 @@ func LoadLocales() error {
41
41
return nil
42
42
}
43
43
44
+ func Bundle () * i18n.Bundle {
45
+ return bundle
46
+ }
47
+
44
48
func GetLocalizer (locale discordgo.Locale ) (* Localizer , bool ) {
45
49
if l , ok := locales [locale ]; ok {
46
50
return l , true
You can’t perform that action at this time.
0 commit comments