aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEuAndreh <eu@euandre.org>2025-05-15 04:22:17 -0300
committerEuAndreh <eu@euandre.org>2025-05-15 04:22:17 -0300
commitefea4790e9f381a5bc52a01d5ff68f7563b9004f (patch)
tree56b3a7ee5b0a0bb1e822cee9cc301d1dc1e1c868
parentMakefile: Replace mandir(1) with instool(1) (diff)
downloadgotext-efea4790e9f381a5bc52a01d5ff68f7563b9004f.tar.gz
gotext-efea4790e9f381a5bc52a01d5ff68f7563b9004f.tar.xz
Add po/gotext/
-rw-r--r--Makefile4
-rw-r--r--po/gotext/de.po26
-rw-r--r--po/gotext/eo.po26
-rw-r--r--po/gotext/es.po26
-rw-r--r--po/gotext/fr.po26
-rw-r--r--po/gotext/gotext.pot24
-rw-r--r--po/gotext/po4a.cfg3
-rw-r--r--po/gotext/pt.po26
-rw-r--r--src/gotext.go11
9 files changed, 167 insertions, 5 deletions
diff --git a/Makefile b/Makefile
index 008ee15..087bbb6 100644
--- a/Makefile
+++ b/Makefile
@@ -204,6 +204,8 @@ i18n-doc:
po4a po/doc/po4a.cfg
i18n-code:
+ gotext -k 'Gettext' src/$(NAME).go > po/$(NAME)/$(NAME).pot
+ po4a po/$(NAME)/po4a.cfg
gotext tests/functional/api-usage/gotext.go > po/tests/tests.pot
po4a po/tests/po4a.cfg
@@ -229,6 +231,7 @@ install: all
cp src/$(NAME).a '$(DESTDIR)$(GOLIBDIR)'
cp $(sources) '$(DESTDIR)$(SRCDIR)'
instool '$(DESTDIR)$(MANDIR)' install man $(manpages.N)
+ instool '$(DESTDIR)$(LOCALEDIR)' install mo $(sources.mo)
## Uninstalls from $(DESTDIR)$(PREFIX). This is a perfect mirror
## of the "install" target, and removes *all* that was installed.
@@ -240,6 +243,7 @@ uninstall:
'$(DESTDIR)$(SRCDIR)' \
instool '$(DESTDIR)$(MANDIR)' uninstall man $(manpages.N)
+ instool '$(DESTDIR)$(LOCALEDIR)' uninstall mo $(sources.mo)
diff --git a/po/gotext/de.po b/po/gotext/de.po
new file mode 100644
index 0000000..4659e6c
--- /dev/null
+++ b/po/gotext/de.po
@@ -0,0 +1,26 @@
+msgid ""
+msgstr ""
+"Language: de\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"Plural-Forms: nplurals=2; plural=(n != 1);\n"
+
+#: src/gotext.go:369
+#, c-format
+msgid "Usage: %s\n"
+msgstr ""
+
+#: src/gotext.go:394
+msgid "look for WORD as the keyword for plural strings"
+msgstr ""
+
+#: src/gotext.go:389
+msgid "look for WORD as the keyword for singular strings"
+msgstr ""
+
+#: src/gotext.go:384
+msgid ""
+"place comment blocks starting with TAG and prceding keyword lines in output "
+"file"
+msgstr ""
diff --git a/po/gotext/eo.po b/po/gotext/eo.po
new file mode 100644
index 0000000..73090c9
--- /dev/null
+++ b/po/gotext/eo.po
@@ -0,0 +1,26 @@
+msgid ""
+msgstr ""
+"Language: eo\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"Plural-Forms: nplurals=2; plural=(n != 1);\n"
+
+#: src/gotext.go:369
+#, c-format
+msgid "Usage: %s\n"
+msgstr ""
+
+#: src/gotext.go:394
+msgid "look for WORD as the keyword for plural strings"
+msgstr ""
+
+#: src/gotext.go:389
+msgid "look for WORD as the keyword for singular strings"
+msgstr ""
+
+#: src/gotext.go:384
+msgid ""
+"place comment blocks starting with TAG and prceding keyword lines in output "
+"file"
+msgstr ""
diff --git a/po/gotext/es.po b/po/gotext/es.po
new file mode 100644
index 0000000..279dba1
--- /dev/null
+++ b/po/gotext/es.po
@@ -0,0 +1,26 @@
+msgid ""
+msgstr ""
+"Language: es\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"Plural-Forms: nplurals=2; plural=(n != 1);\n"
+
+#: src/gotext.go:369
+#, c-format
+msgid "Usage: %s\n"
+msgstr ""
+
+#: src/gotext.go:394
+msgid "look for WORD as the keyword for plural strings"
+msgstr ""
+
+#: src/gotext.go:389
+msgid "look for WORD as the keyword for singular strings"
+msgstr ""
+
+#: src/gotext.go:384
+msgid ""
+"place comment blocks starting with TAG and prceding keyword lines in output "
+"file"
+msgstr ""
diff --git a/po/gotext/fr.po b/po/gotext/fr.po
new file mode 100644
index 0000000..e7760d1
--- /dev/null
+++ b/po/gotext/fr.po
@@ -0,0 +1,26 @@
+msgid ""
+msgstr ""
+"Language: fr\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"Plural-Forms: nplurals=2; plural=(n > 1);\n"
+
+#: src/gotext.go:369
+#, c-format
+msgid "Usage: %s\n"
+msgstr ""
+
+#: src/gotext.go:394
+msgid "look for WORD as the keyword for plural strings"
+msgstr ""
+
+#: src/gotext.go:389
+msgid "look for WORD as the keyword for singular strings"
+msgstr ""
+
+#: src/gotext.go:384
+msgid ""
+"place comment blocks starting with TAG and prceding keyword lines in output "
+"file"
+msgstr ""
diff --git a/po/gotext/gotext.pot b/po/gotext/gotext.pot
new file mode 100644
index 0000000..2181274
--- /dev/null
+++ b/po/gotext/gotext.pot
@@ -0,0 +1,24 @@
+msgid ""
+msgstr ""
+"Language: \n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#: src/gotext.go:369
+#, c-format
+msgid "Usage: %s\n"
+msgstr ""
+
+#: src/gotext.go:394
+msgid "look for WORD as the keyword for plural strings"
+msgstr ""
+
+#: src/gotext.go:389
+msgid "look for WORD as the keyword for singular strings"
+msgstr ""
+
+#: src/gotext.go:384
+msgid "place comment blocks starting with TAG and prceding keyword lines in output file"
+msgstr ""
+
diff --git a/po/gotext/po4a.cfg b/po/gotext/po4a.cfg
new file mode 100644
index 0000000..69321be
--- /dev/null
+++ b/po/gotext/po4a.cfg
@@ -0,0 +1,3 @@
+[options] --keep 0 --master-charset UTF-8 --localized-charset UTF-8 --addendum-charset UTF-8
+
+[po_directory] po/gotext
diff --git a/po/gotext/pt.po b/po/gotext/pt.po
new file mode 100644
index 0000000..60475c2
--- /dev/null
+++ b/po/gotext/pt.po
@@ -0,0 +1,26 @@
+msgid ""
+msgstr ""
+"Language: pt\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"Plural-Forms: nplurals=2; plural=(n != 1);\n"
+
+#: src/gotext.go:369
+#, c-format
+msgid "Usage: %s\n"
+msgstr ""
+
+#: src/gotext.go:394
+msgid "look for WORD as the keyword for plural strings"
+msgstr ""
+
+#: src/gotext.go:389
+msgid "look for WORD as the keyword for singular strings"
+msgstr ""
+
+#: src/gotext.go:384
+msgid ""
+"place comment blocks starting with TAG and prceding keyword lines in output "
+"file"
+msgstr ""
diff --git a/src/gotext.go b/src/gotext.go
index 54e05c3..132a35b 100644
--- a/src/gotext.go
+++ b/src/gotext.go
@@ -154,7 +154,7 @@ func constructValue(val interface{}) string {
right = right[1:len(right)]
return left + right
default:
- panic(fmt.Sprintf("unknown type: %v", val))
+ panic(fmt.Sprintf("unknown type: %v", val)) // FIXME
}
}
@@ -364,7 +364,7 @@ msgstr ""
func usage(argv0 string, w io.Writer) {
fmt.Fprintf(
w,
- "Usage: %s\n",
+ Gettext("Usage: %s\n"),
argv0,
)
}
@@ -379,17 +379,17 @@ func getopt(allArgs []string, w io.Writer) (argsT, int) {
commentTag := fs.String(
"A",
"TRANSLATORS",
- "place comment blocks starting with TAG and prceding keyword lines in output file",
+ Gettext("place comment blocks starting with TAG and prceding keyword lines in output file"),
)
keyword := fs.String(
"k",
"gt.Gettext",
- "look for WORD as the keyword for singular strings",
+ Gettext("look for WORD as the keyword for singular strings"),
)
keywordPlural := fs.String(
"K",
"gt.NGettext",
- "look for WORD as the keyword for plural strings",
+ Gettext("look for WORD as the keyword for plural strings"),
)
if fs.Parse(argv) != nil {
@@ -571,6 +571,7 @@ func Init(name string, localedir string) {
func Main() {
+ Init(Name, LOCALEDIR)
args, rc := getopt(os.Args, os.Stderr)
if rc != 0 {
os.Exit(0)