diff options
Diffstat (limited to 'src/gotext.go')
-rw-r--r-- | src/gotext.go | 31 |
1 files changed, 17 insertions, 14 deletions
diff --git a/src/gotext.go b/src/gotext.go index c236b4b..54e05c3 100644 --- a/src/gotext.go +++ b/src/gotext.go @@ -13,8 +13,6 @@ import ( "strings" "time" "unsafe" - - g "gobang" ) @@ -84,6 +82,12 @@ func (e *translatableErrorT) Error() string { return Gettext(e.err) } +func Error(err string) error { + return &translatableErrorT{ + err: err, + } +} + func formatComment(com string) string { out := "" for _, rawline := range strings.Split(com, "\n") { @@ -309,16 +313,14 @@ func formatOutput(in string) string { } func writePotFile(out io.Writer, msgIDs map[string][]msgIDT) { - header := g.Heredoc(` - #, fuzzy - msgid "" - msgstr "" - "Language: \n" - "MIME-Version: 1.0\n" - "Content-Type: text/plain; charset=UTF-8\n" - "Content-Transfer-Encoding: 8bit\n" - - `) + const header = `msgid "" +msgstr "" +"Language: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" + +` fmt.Fprintf(out, "%s", header) // FIXME: sort by location, not by key @@ -569,9 +571,10 @@ func Init(name string, localedir string) { func Main() { - g.Init() args, rc := getopt(os.Args, os.Stderr) - g.ExitIf(rc) + if rc != 0 { + os.Exit(0) + } os.Exit(run(envT{ args: args, in: os.Stdin, |