aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xMakefile.PL20
-rw-r--r--basewikipo.setup27
-rw-r--r--doc/translation.mdwn12
3 files changed, 58 insertions, 1 deletions
diff --git a/Makefile.PL b/Makefile.PL
index 93f9e89e2..848cad87c 100755
--- a/Makefile.PL
+++ b/Makefile.PL
@@ -36,7 +36,7 @@ ikiwiki.out: ikiwiki.in
ikiwiki.setup: ikiwiki.out
HOME=/home/me $(PERL) -Iblib/lib $(extramodules) $(tflag) ikiwiki.out -libdir . -dumpsetup ikiwiki.setup
-extra_build: ikiwiki.out ikiwiki.setup docwiki
+extra_build: ikiwiki.out ikiwiki.setup docwiki basewikipo
./mdwn2man ikiwiki 1 doc/usage.mdwn > ikiwiki.man
./mdwn2man ikiwiki-mass-rebuild 8 doc/ikiwiki-mass-rebuild.mdwn > ikiwiki-mass-rebuild.man
./mdwn2man ikiwiki-makerepo 1 doc/ikiwiki-makerepo.mdwn > ikiwiki-makerepo.man
@@ -47,6 +47,24 @@ extra_build: ikiwiki.out ikiwiki.setup docwiki
docwiki: ikiwiki.out
$(PERL) -Iblib/lib $(extramodules) $(tflag) ikiwiki.out -libdir . -setup docwiki.setup -refresh
+basewikipo: ikiwiki.out
+ # copy all the files we want to translate into the
+ # po/underlays scrdir.
+ for file in `find underlays -follow -name \*.mdwn`; do \
+ install -d po/$$(dirname $$file); \
+ cp -aL $$file po/$$file 2>/dev/null || \
+ install -m 644 $$file po/$$file; \
+ done
+ install -d po/underlays/directives/ikiwiki/directive
+ for file in doc/ikiwiki/directive/*; do \
+ if [ -f "$$file" ]; then \
+ install -m 644 $$file po/underlays/directives/ikiwiki/directive; \
+ fi \
+ done
+ $(PERL) -Iblib/lib $(extramodules) $(tflag) ikiwiki.out -libdir . -setup basewikipo.setup -refresh
+ rm -rf po/html po/underlays/.ikiwiki
+ find po/underlays -name \*.mdwn | xargs rm -f
+
extra_clean:
rm -rf html doc/.ikiwiki
rm -f *.man ikiwiki.out ikiwiki.setup plugins/*.pyc
diff --git a/basewikipo.setup b/basewikipo.setup
new file mode 100644
index 000000000..acc001b7f
--- /dev/null
+++ b/basewikipo.setup
@@ -0,0 +1,27 @@
+#!/usr/bin/perl
+# Configuration file for ikiwiki that uses the po plugin to build/update
+# po files for pages in the base wiki.
+
+use IkiWiki::Setup::Standard {
+ wikiname => "ikiwiki",
+ srcdir => "po/underlays",
+ destdir => "po/html",
+ templatedir => "templates",
+ # we don't want to pull in the normal underlays
+ underlaydirbase => "po/underlays",
+ underlaydir => "po/underlays/basewiki",
+ discussion => 0,
+ locale => '',
+ verbose => 1,
+ syslog => 0,
+ add_plugins => [qw{po}],
+ po_master_language => { 'code' => 'en', 'name' => 'English' },
+ # List here all languages for which someone is working on
+ # translating the base wiki. Listing languages that are not
+ # being actively worked on will excessively bloat things.
+ po_slave_languages => { 'fr' => 'Français',
+ 'es' => 'Español',
+ 'de' => 'Deutsch',
+ },
+ po_translatable_pages => "*",
+}
diff --git a/doc/translation.mdwn b/doc/translation.mdwn
index e3e458ce7..71e50cb1b 100644
--- a/doc/translation.mdwn
+++ b/doc/translation.mdwn
@@ -30,3 +30,15 @@ essentially three pieces needed for a complete translation:
1. The [[basewiki]] itself needs to be translated. The
[[plugins/contrib/po]] ikiwiki plugin will allow translating
wikis using po files and can be used for this.
+
+ To generate the po and pot files for translating the basewiki,
+ get ikiwiki's source, and edit the `basewikipo.setup` file,
+ adding your language. Then run 'perl Makefile.PL; make basewikipo`.
+ This will generate many po files under `po/underlays`. The first
+ ones you'll want to translate are in the `po/underlays/basewiki` directory,
+ which is really not very large, just a few thousand words.
+ After that is done, you can tackle those under
+ `po/underlays/directives`, which are a much larger tens of
+ thousands of words.
+
+