• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

yyle88 / goi18n / 15081687146

17 May 2025 04:32AM UTC coverage: 49.372% (+0.9%) from 48.496%
15081687146

push

github

yangyile
适配复数形式

21 of 43 new or added lines in 3 files covered. (48.84%)

1 existing line in 1 file now uncovered.

275 of 557 relevant lines covered (49.37%)

29.54 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

15.52
/internal/examples/example2/example2message/message.go
1
package example2message
2

3
import (
4
        "github.com/nicksnyder/go-i18n/v2/i18n"
5
        "github.com/yyle88/goi18n"
6
)
7

8
type ActiveUsersParam struct {
9
        Count any
10
}
11

12
func (p *ActiveUsersParam) GetTemplateValues() map[string]any {
2✔
13
        res := make(map[string]any)
2✔
14
        if p.Count != nil {
4✔
15
                res["count"] = p.Count
2✔
16
        }
2✔
17
        return res
2✔
18
}
19

20
func NewActiveUsers(data *ActiveUsersParam) (string, map[string]any) {
2✔
21
        return "ACTIVE_USERS", data.GetTemplateValues()
2✔
22
}
2✔
23

NEW
24
func I18nActiveUsers(data *ActiveUsersParam, pluralConfig *goi18n.PluralConfig) *i18n.LocalizeConfig {
×
25
        return &i18n.LocalizeConfig{
×
26
                MessageID:    "ACTIVE_USERS",
×
27
                TemplateData: data.GetTemplateValues(),
×
NEW
28
                PluralCount:  pluralConfig.PluralCount,
×
29
        }
×
30
}
×
31

32
type CompletedTasksParam struct {
33
        Count any
34
}
35

36
func (p *CompletedTasksParam) GetTemplateValues() map[string]any {
×
37
        res := make(map[string]any)
×
38
        if p.Count != nil {
×
39
                res["count"] = p.Count
×
40
        }
×
41
        return res
×
42
}
43

44
func NewCompletedTasks(data *CompletedTasksParam) (string, map[string]any) {
×
45
        return "COMPLETED_TASKS", data.GetTemplateValues()
×
46
}
×
47

NEW
48
func I18nCompletedTasks(data *CompletedTasksParam, pluralConfig *goi18n.PluralConfig) *i18n.LocalizeConfig {
×
49
        return &i18n.LocalizeConfig{
×
50
                MessageID:    "COMPLETED_TASKS",
×
51
                TemplateData: data.GetTemplateValues(),
×
NEW
52
                PluralCount:  pluralConfig.PluralCount,
×
53
        }
×
54
}
×
55

56
type OpenIssuesParam struct {
57
        Count any
58
}
59

60
func (p *OpenIssuesParam) GetTemplateValues() map[string]any {
×
61
        res := make(map[string]any)
×
62
        if p.Count != nil {
×
63
                res["count"] = p.Count
×
64
        }
×
65
        return res
×
66
}
67

68
func NewOpenIssues(data *OpenIssuesParam) (string, map[string]any) {
×
69
        return "OPEN_ISSUES", data.GetTemplateValues()
×
70
}
×
71

NEW
72
func I18nOpenIssues(data *OpenIssuesParam, pluralConfig *goi18n.PluralConfig) *i18n.LocalizeConfig {
×
73
        return &i18n.LocalizeConfig{
×
74
                MessageID:    "OPEN_ISSUES",
×
75
                TemplateData: data.GetTemplateValues(),
×
NEW
76
                PluralCount:  pluralConfig.PluralCount,
×
77
        }
×
78
}
×
79

NEW
80
func NewPendingReviews[Value comparable](value Value) (string, Value) {
×
NEW
81
        return "PENDING_REVIEWS", value
×
UNCOV
82
}
×
83

NEW
84
func I18nPendingReviews[Value comparable](value Value, pluralConfig *goi18n.PluralConfig) *i18n.LocalizeConfig {
×
85
        return &i18n.LocalizeConfig{
×
86
                MessageID:    "PENDING_REVIEWS",
×
NEW
87
                TemplateData: value,
×
NEW
88
                PluralCount:  pluralConfig.PluralCount,
×
89
        }
×
90
}
×
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc