Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed typo: ErrUnknowTranslation --> ErrUnknownTranslation #26

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
4 changes: 2 additions & 2 deletions errors.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ import (
)

var (
// ErrUnknowTranslation indicates the translation could not be found
ErrUnknowTranslation = errors.New("Unknown Translation")
// ErrUnknownTranslation indicates the translation could not be found
ErrUnknownTranslation = errors.New("Unknown Translation")
)

var _ error = new(ErrConflictingTranslation)
Expand Down
10 changes: 5 additions & 5 deletions import_export_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ func TestExportImportBasic(t *testing.T) {

s, err := en.T(tt.key, tt.params...)
if s != tt.expected {
if !tt.expectedError || (tt.expectedError && err != ErrUnknowTranslation) {
if !tt.expectedError || (tt.expectedError && err != ErrUnknownTranslation) {
t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
}
}
Expand Down Expand Up @@ -277,7 +277,7 @@ func TestExportImportCardinal(t *testing.T) {

s, err := en.C(tt.key, tt.num, tt.digits, tt.param)
if err != nil {
if !tt.expectedError && err != ErrUnknowTranslation {
if !tt.expectedError && err != ErrUnknownTranslation {
t.Errorf("Expected '<nil>' Got '%s'", err)
}
}
Expand Down Expand Up @@ -442,7 +442,7 @@ func TestExportImportOrdinal(t *testing.T) {

s, err := en.O(tt.key, tt.num, tt.digits, tt.param)
if err != nil {
if !tt.expectedError && err != ErrUnknowTranslation {
if !tt.expectedError && err != ErrUnknownTranslation {
t.Errorf("Expected '<nil>' Got '%s'", err)
}
}
Expand Down Expand Up @@ -606,7 +606,7 @@ func TestExportImportRange(t *testing.T) {

s, err := nl.R(tt.key, tt.num1, tt.digits1, tt.num2, tt.digits2, tt.param1, tt.param2)
if err != nil {
if !tt.expectedError && err != ErrUnknowTranslation {
if !tt.expectedError && err != ErrUnknownTranslation {
t.Errorf("Expected '<nil>' Got '%s'", err)
}
}
Expand Down Expand Up @@ -672,7 +672,7 @@ func TestImportRecursive(t *testing.T) {

s, err := en.T(tt.key, tt.params...)
if s != tt.expected {
if !tt.expectedError || (tt.expectedError && err != ErrUnknowTranslation) {
if !tt.expectedError || (tt.expectedError && err != ErrUnknownTranslation) {
t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
}
}
Expand Down
8 changes: 4 additions & 4 deletions translator.go
Original file line number Diff line number Diff line change
Expand Up @@ -298,7 +298,7 @@ func (t *translator) T(key interface{}, params ...string) (string, error) {

trans, ok := t.translations[key]
if !ok {
return unknownTranslation, ErrUnknowTranslation
return unknownTranslation, ErrUnknownTranslation
}

b := make([]byte, 0, 64)
Expand All @@ -324,7 +324,7 @@ func (t *translator) C(key interface{}, num float64, digits uint64, param string

tarr, ok := t.cardinalTanslations[key]
if !ok {
return unknownTranslation, ErrUnknowTranslation
return unknownTranslation, ErrUnknownTranslation
}

rule := t.CardinalPluralRule(num, digits)
Expand All @@ -344,7 +344,7 @@ func (t *translator) O(key interface{}, num float64, digits uint64, param string

tarr, ok := t.ordinalTanslations[key]
if !ok {
return unknownTranslation, ErrUnknowTranslation
return unknownTranslation, ErrUnknownTranslation
}

rule := t.OrdinalPluralRule(num, digits)
Expand All @@ -365,7 +365,7 @@ func (t *translator) R(key interface{}, num1 float64, digits1 uint64, num2 float

tarr, ok := t.rangeTanslations[key]
if !ok {
return unknownTranslation, ErrUnknowTranslation
return unknownTranslation, ErrUnknownTranslation
}

rule := t.RangePluralRule(num1, digits1, num2, digits2)
Expand Down
8 changes: 4 additions & 4 deletions translator_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ func TestBasicTranslation(t *testing.T) {
for _, tt := range tests {
s, err := en.T(tt.key, tt.params...)
if s != tt.expected {
if !tt.expectedError && err != ErrUnknowTranslation {
if !tt.expectedError && err != ErrUnknownTranslation {
t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
}
}
Expand Down Expand Up @@ -242,7 +242,7 @@ func TestCardinalTranslation(t *testing.T) {

s, err := en.C(tt.key, tt.num, tt.digits, tt.param)
if err != nil {
if !tt.expectedError && err != ErrUnknowTranslation {
if !tt.expectedError && err != ErrUnknownTranslation {
t.Errorf("Expected '<nil>' Got '%s'", err)
}
}
Expand Down Expand Up @@ -395,7 +395,7 @@ func TestOrdinalTranslation(t *testing.T) {

s, err := en.O(tt.key, tt.num, tt.digits, tt.param)
if err != nil {
if !tt.expectedError && err != ErrUnknowTranslation {
if !tt.expectedError && err != ErrUnknownTranslation {
t.Errorf("Expected '<nil>' Got '%s'", err)
}
}
Expand Down Expand Up @@ -547,7 +547,7 @@ func TestRangeTranslation(t *testing.T) {

s, err := nl.R(tt.key, tt.num1, tt.digits1, tt.num2, tt.digits2, tt.param1, tt.param2)
if err != nil {
if !tt.expectedError && err != ErrUnknowTranslation {
if !tt.expectedError && err != ErrUnknownTranslation {
t.Errorf("Expected '<nil>' Got '%s'", err)
}
}
Expand Down