Fallback Po's missing plural translation using plural forms when available. Use western rule n==1 convention only on Locale object without Domain. Fixes #34
This commit is contained in:
10
locale.go
10
locale.go
@@ -200,7 +200,10 @@ func (l *Locale) GetND(dom, str, plural string, n int, vars ...interface{}) stri
|
||||
}
|
||||
}
|
||||
|
||||
// Return the same we received by default
|
||||
// Use western default rule (plural > 1) to handle missing domain default result.
|
||||
if n == 1 {
|
||||
return Printf(str, vars...)
|
||||
}
|
||||
return Printf(plural, vars...)
|
||||
}
|
||||
|
||||
@@ -237,7 +240,10 @@ func (l *Locale) GetNDC(dom, str, plural string, n int, ctx string, vars ...inte
|
||||
}
|
||||
}
|
||||
|
||||
// Return the same we received by default
|
||||
// Use western default rule (plural > 1) to handle missing domain default result.
|
||||
if n == 1 {
|
||||
return Printf(str, vars...)
|
||||
}
|
||||
return Printf(plural, vars...)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user