aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.gitignore2
-rw-r--r--Makefile10
-rw-r--r--deps.mk6
-rw-r--r--doc/gotext.de.0.adoc5
-rw-r--r--doc/gotext.eo.0.adoc5
-rw-r--r--doc/gotext.es.0.adoc5
-rw-r--r--doc/gotext.fr.0.adoc5
-rw-r--r--doc/gotext.pt.0.adoc5
-rwxr-xr-xmkdeps.sh17
9 files changed, 25 insertions, 35 deletions
diff --git a/.gitignore b/.gitignore
index c48a832..d3c2f8f 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,5 +1,5 @@
-!/doc/*.adoc
/doc/*
+!/doc/*.en.*.adoc
/po/*/*.mo
/src/meta.go
/*.bin
diff --git a/Makefile b/Makefile
index 8b7ade9..b5265f4 100644
--- a/Makefile
+++ b/Makefile
@@ -3,7 +3,6 @@ DATE = 1970-01-01
VERSION = 0.1.0
NAME = gotext
NAME_UC = $(NAME)
-LANGUAGES = en
## Installation prefix. Defaults to "/usr".
PREFIX = /usr
BINDIR = $(PREFIX)/bin
@@ -55,6 +54,7 @@ mains.bin = $(mains.go:.go=.bin)
functional-tests/lib.a = $(functional-tests/lib.go:.go=.a)
fuzz-targets/lib.a = $(fuzz-targets/lib.go:.go=.a)
benchmarks/lib.a = $(benchmarks/lib.go:.go=.a)
+manpages.N.adoc = $(manpages.en.N.adoc) $(manpages.XX.N.adoc)
manpages.N = $(manpages.N.adoc:.adoc=)
sources.mo = $(sources.po:.po=.mo)
@@ -88,6 +88,7 @@ derived-assets = \
$(mains.a) \
$(mains.bin) \
$(NAME).bin \
+ $(manpages.XX.N.adoc) \
$(manpages.N) \
$(sources.mo) \
locale/.gitignore \
@@ -139,6 +140,9 @@ src/meta.go: Makefile
$(NAME).bin: src/main.bin
ln -fs src/main.bin $@
+$(manpages.XX.N.adoc): po/doc/po4a.cfg
+ po4a --no-update --translate-only $@ po/doc/po4a.cfg
+
locale/.gitignore: po/tests/de.mo po/tests/es.mo
instool $(@D) install mo $(sources.mo)
echo '*' > $@
@@ -199,11 +203,11 @@ bench: $(benchmarks/main.bin-check)
i18n-doc:
po4a po/doc/po4a.cfg
-i18n-tests:
+i18n-code:
gotext tests/functional/api-usage/gotext.go > po/tests/tests.pot
po4a po/tests/po4a.cfg
-i18n: i18n-doc i18n-tests
+i18n: i18n-doc i18n-code
diff --git a/deps.mk b/deps.mk
index e7357e4..010ee97 100644
--- a/deps.mk
+++ b/deps.mk
@@ -16,9 +16,11 @@ mains.go = \
tests/fuzz/api/main.go \
tests/main.go \
-manpages.N.adoc = \
- doc/gotext.de.0.adoc \
+manpages.en.N.adoc = \
doc/gotext.en.0.adoc \
+
+manpages.XX.N.adoc = \
+ doc/gotext.de.0.adoc \
doc/gotext.eo.0.adoc \
doc/gotext.es.0.adoc \
doc/gotext.fr.0.adoc \
diff --git a/doc/gotext.de.0.adoc b/doc/gotext.de.0.adoc
deleted file mode 100644
index ff36446..0000000
--- a/doc/gotext.de.0.adoc
+++ /dev/null
@@ -1,5 +0,0 @@
-= gotext(0)
-
-== NAME
-
-gotext - .
diff --git a/doc/gotext.eo.0.adoc b/doc/gotext.eo.0.adoc
deleted file mode 100644
index ff36446..0000000
--- a/doc/gotext.eo.0.adoc
+++ /dev/null
@@ -1,5 +0,0 @@
-= gotext(0)
-
-== NAME
-
-gotext - .
diff --git a/doc/gotext.es.0.adoc b/doc/gotext.es.0.adoc
deleted file mode 100644
index ff36446..0000000
--- a/doc/gotext.es.0.adoc
+++ /dev/null
@@ -1,5 +0,0 @@
-= gotext(0)
-
-== NAME
-
-gotext - .
diff --git a/doc/gotext.fr.0.adoc b/doc/gotext.fr.0.adoc
deleted file mode 100644
index ff36446..0000000
--- a/doc/gotext.fr.0.adoc
+++ /dev/null
@@ -1,5 +0,0 @@
-= gotext(0)
-
-== NAME
-
-gotext - .
diff --git a/doc/gotext.pt.0.adoc b/doc/gotext.pt.0.adoc
deleted file mode 100644
index ff36446..0000000
--- a/doc/gotext.pt.0.adoc
+++ /dev/null
@@ -1,5 +0,0 @@
-= gotext(0)
-
-== NAME
-
-gotext - .
diff --git a/mkdeps.sh b/mkdeps.sh
index ee497ed..261192d 100755
--- a/mkdeps.sh
+++ b/mkdeps.sh
@@ -5,8 +5,10 @@ export LANG=POSIX.UTF-8
libs() {
- find src tests -name '*.go' | grep -v '/main\.go$' |
- grep -v '/version\.go$'
+ find src tests -name '*.go' |
+ grep -Ev '/(main|meta)\.go$' |
+ grep -Ev '/_cgo_(import|gotypes)\.go$' |
+ grep -Ev '\.cgo1\.go$'
}
mains() {
@@ -14,7 +16,13 @@ mains() {
}
docs() {
- find doc/*.adoc
+ find doc/*.en.*.adoc
+}
+
+xdocs() {
+ for l in `find po/doc/*.po | xargs -I% basename % .po`; do
+ docs | sed 's|/\(.*\)\.en\.\(.*\)$|/\1.'"$l"'.\2|'
+ done
}
pos() {
@@ -23,7 +31,8 @@ pos() {
libs | varlist 'libs.go'
mains | varlist 'mains.go'
-docs | varlist 'manpages.N.adoc'
+docs | varlist 'manpages.en.N.adoc'
+xdocs | varlist 'manpages.XX.N.adoc'
pos | varlist 'sources.po'
find tests/functional/*/*.go -not -name main.go | varlist 'functional-tests/lib.go'