]> sipb.mit.edu Git - ikiwiki.git/commitdiff
add basewikipo po file generation thing
authorJoey Hess <joey@gnu.kitenet.net>
Sun, 19 Jul 2009 12:16:21 +0000 (14:16 +0200)
committerJoey Hess <joey@gnu.kitenet.net>
Sun, 19 Jul 2009 12:16:21 +0000 (14:16 +0200)
Makefile.PL
basewikipo.setup [new file with mode: 0644]
doc/translation.mdwn

index 93f9e89e2ab3314e6cc4ed85321c7168a3f1f67d..848cad87c04f98751f9cdf0e475c82ecb96ce2d5 100755 (executable)
@@ -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 (file)
index 0000000..acc001b
--- /dev/null
@@ -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 => "*",
+}
index e3e458ce7487ecfcd058207ded6ff0dc018dd030..71e50cb1b2efb3b24fc0c5f64d4fb6622a27f4b6 100644 (file)
@@ -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.
+
+