add basewikipo po file generation thing

master
Joey Hess 2009-07-19 14:16:21 +02:00
parent 4d166acccb
commit ae4837bb3d
3 changed files with 58 additions and 1 deletions

View File

@ -36,7 +36,7 @@ ikiwiki.out: ikiwiki.in
ikiwiki.setup: ikiwiki.out ikiwiki.setup: ikiwiki.out
HOME=/home/me $(PERL) -Iblib/lib $(extramodules) $(tflag) ikiwiki.out -libdir . -dumpsetup ikiwiki.setup 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 1 doc/usage.mdwn > ikiwiki.man
./mdwn2man ikiwiki-mass-rebuild 8 doc/ikiwiki-mass-rebuild.mdwn > ikiwiki-mass-rebuild.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 ./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 docwiki: ikiwiki.out
$(PERL) -Iblib/lib $(extramodules) $(tflag) ikiwiki.out -libdir . -setup docwiki.setup -refresh $(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: extra_clean:
rm -rf html doc/.ikiwiki rm -rf html doc/.ikiwiki
rm -f *.man ikiwiki.out ikiwiki.setup plugins/*.pyc rm -f *.man ikiwiki.out ikiwiki.setup plugins/*.pyc

27
basewikipo.setup 100644
View File

@ -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 => "*",
}

View File

@ -30,3 +30,15 @@ essentially three pieces needed for a complete translation:
1. The [[basewiki]] itself needs to be translated. The 1. The [[basewiki]] itself needs to be translated. The
[[plugins/contrib/po]] ikiwiki plugin will allow translating [[plugins/contrib/po]] ikiwiki plugin will allow translating
wikis using po files and can be used for this. 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.