-
Notifications
You must be signed in to change notification settings - Fork 67
Open
Labels
Description
In the example below, xgotext extracts "Test 1" but fails to extract "Test 2".
package main
import (
"fmt"
"github.com/leonelquinteros/gotext"
)
var NL1 = func () *gotext.Locale {
return gotext.NewLocale(".", "fr_FR")
}
func main () {
localizer := NL1()
fmt.Println(localizer.Get("Test 1"))
fmt.Println(NL1().Get("Test 2"))
}
How to reproduce:
Save the above file as in/foo.go
.
Save this file as in/go.mod
:
module hello
go 1.11
require github.com/leonelquinteros/gotext v1.6.0
Run
rm -f out/example.pot; ~/go/bin/xgotext -v -default example -in in -out out
cat out/example.pot; echo
Result:
msgid ""
msgstr ""
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Language: \n"
"X-Generator: xgotext\n"
#: foo.go:14
msgid "Test 1"
msgstr ""