From c071d23159f6bb2c7b4c4fd9ac2d0c0972c4d4de Mon Sep 17 00:00:00 2001 From: Mike Veldink Date: Mon, 28 Apr 2025 07:38:58 -0500 Subject: [PATCH] fix IsTranslated predicates --- locale.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/locale.go b/locale.go index 01c2a1f..059b625 100644 --- a/locale.go +++ b/locale.go @@ -357,7 +357,7 @@ func (l *Locale) GetTranslations() map[string]*Translation { // IsTranslated reports whether a string is translated func (l *Locale) IsTranslated(str string) bool { - return l.IsTranslatedND(l.GetDomain(), str, 0) + return l.IsTranslatedND(l.GetDomain(), str, 1) } // IsTranslatedN reports whether a plural string is translated @@ -367,7 +367,7 @@ func (l *Locale) IsTranslatedN(str string, n int) bool { // IsTranslatedD reports whether a domain string is translated func (l *Locale) IsTranslatedD(dom, str string) bool { - return l.IsTranslatedND(dom, str, 0) + return l.IsTranslatedND(dom, str, 1) } // IsTranslatedND reports whether a plural domain string is translated @@ -387,7 +387,7 @@ func (l *Locale) IsTranslatedND(dom, str string, n int) bool { // IsTranslatedC reports whether a context string is translated func (l *Locale) IsTranslatedC(str, ctx string) bool { - return l.IsTranslatedNDC(l.GetDomain(), str, 0, ctx) + return l.IsTranslatedNDC(l.GetDomain(), str, 1, ctx) } // IsTranslatedNC reports whether a plural context string is translated @@ -397,7 +397,7 @@ func (l *Locale) IsTranslatedNC(str string, n int, ctx string) bool { // IsTranslatedDC reports whether a domain context string is translated func (l *Locale) IsTranslatedDC(dom, str, ctx string) bool { - return l.IsTranslatedNDC(dom, str, 0, ctx) + return l.IsTranslatedNDC(dom, str, 1, ctx) } // IsTranslatedNDC reports whether a plural domain context string is translated