diff options
-rw-r--r-- | IkiWiki/Plugin/inline.pm | 5 | ||||
-rw-r--r-- | doc/todo/po:_rethink_pagespecs.mdwn | 25 | ||||
-rwxr-xr-x | po/po2wiki | 3 | ||||
-rw-r--r-- | po/underlay.setup | 16 |
4 files changed, 37 insertions, 12 deletions
diff --git a/IkiWiki/Plugin/inline.pm b/IkiWiki/Plugin/inline.pm index 20c5f3bdd..715a3d652 100644 --- a/IkiWiki/Plugin/inline.pm +++ b/IkiWiki/Plugin/inline.pm @@ -570,9 +570,9 @@ sub genfeed ($$$$$@) { } } - my $file=$pagesources{$p}; - my $type=pagetype($file); if ($itemtemplate->query(name => "enclosure")) { + my $file=$pagesources{$p}; + my $type=pagetype($file); if (defined $type) { $itemtemplate->param(content => $pcontent); } @@ -591,7 +591,6 @@ sub genfeed ($$$$$@) { } } else { - next unless defined $type; $itemtemplate->param(content => $pcontent); } diff --git a/doc/todo/po:_rethink_pagespecs.mdwn b/doc/todo/po:_rethink_pagespecs.mdwn index 50c10c5db..686f3e77d 100644 --- a/doc/todo/po:_rethink_pagespecs.mdwn +++ b/doc/todo/po:_rethink_pagespecs.mdwn @@ -9,3 +9,28 @@ default when locking pages.) --[[Joey]] > list must be restricted to pages in the master (or current?) > language, and the ones that should not. The only solution I can see > to this surprising behaviour is: documentation. --[[intrigeri]] + +>> Well, a sorting criteria might be that if a PageSpec is used +>> with a specified locaction, as happens whenever a PageSpec is +>> used on a page, then it should match only `currentlang()`. If it +>> is used without a location, as in the setup file, then no such limit. +>> +>> Note that +>> `match_currentlang` currently dies if called w/o a location -- if +>> it instead was always true w/o a location, this would just mean that +>> all pagespecs should have `and currentlang()` added to them. How to +>> implement that? All I can think of doing is wrapping +>> `pagespec_translate`. +>> +>> The only case I've found where it does make sense to match other +>> language pages is on `l10n.ikiwiki.info` when listing pages that +>> need translation. +>> +>> Otherwise, it can be documented, but that's not really enough; +>> a user who makes a site using auto-blog.setup and enables po will +>> get a really screwed up blog that lists translations as separate posts +>> and needs significant work to fix. I have thought about making +>> `match_currentlang` a stub in IkiWiki (done in my currentlang branch), +>> so I can use it in all the PageSpecs in the example blog etc, but I +>> can't say I love the idea. +>> --[[Joey]] diff --git a/po/po2wiki b/po/po2wiki index 6b84f7d54..126aa8e17 100755 --- a/po/po2wiki +++ b/po/po2wiki @@ -22,7 +22,8 @@ foreach my $file (@$files) { $pagesources{$page}=$file; # used by po plugin functions } -foreach my $ll (keys %{$config{po_slave_languages}}) { +foreach my $lang (@{$config{po_slave_languages}}) { + my ($ll, $name)=IkiWiki::Plugin::po::splitlangpair($lang); $config{destdir}="../underlays/locale/$ll"; foreach my $file (@$files) { diff --git a/po/underlay.setup b/po/underlay.setup index 8d3516cff..ebe7251cf 100644 --- a/po/underlay.setup +++ b/po/underlay.setup @@ -6,14 +6,14 @@ use IkiWiki::Setup::Standard { # List here all languages that have translations. # Listing languages without active translations # will excessively bloat things. - po_slave_languages => { - 'es' => 'Español', - 'de' => 'Deutsch', - 'fr' => 'Français', - 'da' => 'Dansk', - 'cs' => 'česky', - }, - po_master_language => { 'code' => 'en', 'name' => 'English' }, + po_slave_languages => [ + 'es|Español', + 'de|Deutsch', + 'fr|Français', + 'da|Dansk', + 'cs|česky', + ], + po_master_language => 'en|English', po_translatable_pages => "*", add_plugins => [qw{po}], |