@@ -3,22 +3,21 @@ Package gotext implements GNU gettext utilities.
3
3
4
4
For quick/simple translations you can use the package level functions directly.
5
5
6
- import (
7
- "fmt"
8
- "github.com/leonelquinteros/gotext"
9
- )
6
+ import (
7
+ "fmt"
8
+ "github.com/leonelquinteros/gotext"
9
+ )
10
10
11
- func main() {
12
- // Configure package
13
- gotext.Configure("/path/to/locales/root/dir", "en_UK", "domain-name")
11
+ func main() {
12
+ // Configure package
13
+ gotext.Configure("/path/to/locales/root/dir", "en_UK", "domain-name")
14
14
15
- // Translate text from default domain
16
- fmt.Println(gotext.Get("My text on 'domain-name' domain"))
17
-
18
- // Translate text from a different domain without reconfigure
19
- fmt.Println(gotext.GetD("domain2", "Another text on a different domain"))
20
- }
15
+ // Translate text from default domain
16
+ fmt.Println(gotext.Get("My text on 'domain-name' domain"))
21
17
18
+ // Translate text from a different domain without reconfigure
19
+ fmt.Println(gotext.GetD("domain2", "Another text on a different domain"))
20
+ }
22
21
*/
23
22
package gotext
24
23
@@ -342,7 +341,7 @@ func GetNDC(dom, str, plural string, n int, ctx string, vars ...interface{}) str
342
341
// IsTranslated reports whether a string is translated in given languages.
343
342
// When the langs argument is omitted, the output of GetLanguages is used.
344
343
func IsTranslated (str string , langs ... string ) bool {
345
- return IsTranslatedND (GetDomain (), str , 0 , langs ... )
344
+ return IsTranslatedND (GetDomain (), str , 1 , langs ... )
346
345
}
347
346
348
347
// IsTranslatedN reports whether a plural string is translated in given languages.
@@ -354,7 +353,7 @@ func IsTranslatedN(str string, n int, langs ...string) bool {
354
353
// IsTranslatedD reports whether a domain string is translated in given languages.
355
354
// When the langs argument is omitted, the output of GetLanguages is used.
356
355
func IsTranslatedD (dom , str string , langs ... string ) bool {
357
- return IsTranslatedND (dom , str , 0 , langs ... )
356
+ return IsTranslatedND (dom , str , 1 , langs ... )
358
357
}
359
358
360
359
// IsTranslatedND reports whether a plural domain string is translated in any of given languages.
@@ -385,7 +384,7 @@ func IsTranslatedND(dom, str string, n int, langs ...string) bool {
385
384
// IsTranslatedC reports whether a context string is translated in given languages.
386
385
// When the langs argument is omitted, the output of GetLanguages is used.
387
386
func IsTranslatedC (str , ctx string , langs ... string ) bool {
388
- return IsTranslatedNDC (GetDomain (), str , 0 , ctx , langs ... )
387
+ return IsTranslatedNDC (GetDomain (), str , 1 , ctx , langs ... )
389
388
}
390
389
391
390
// IsTranslatedNC reports whether a plural context string is translated in given languages.
0 commit comments