From 83480665c256a344900fc817bcb4618f8db9aeee Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Mon, 10 Aug 2009 15:59:32 -0400 Subject: po: Fix copy of po file from underlay when editing When first editing a page that was in the underlay, avoid losing the translation by copying the po file over from the underlay. --- doc/plugins/po.mdwn | 11 ----------- 1 file changed, 11 deletions(-) (limited to 'doc/plugins/po.mdwn') diff --git a/doc/plugins/po.mdwn b/doc/plugins/po.mdwn index 0c8110563..2fbf67016 100644 --- a/doc/plugins/po.mdwn +++ b/doc/plugins/po.mdwn @@ -277,17 +277,6 @@ That used to be so, but the bug was fixed. Does this mean that po might be replacing the only link on a page, in error? --[[Joey]] -Bug when editing underlay file ------------------------------- - -While I've gotten translated underlays working, there is a bug -if the wiki is currently using a page from the underlay, and the master -language version is edited. This causes the edited page to be saved -to srcdir.. and all the translations get set to 0% and their -po files have the translated strings "emptied". What's really going on -is that these are entirely new po files not based on the old ones -in the basewiki, and thus lacking translations. --[[Joey]] - Documentation ------------- -- cgit v1.2.3 From d13c07dec1a5516b7fa595004e16021f2a182bb6 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Sat, 15 Aug 2009 15:20:46 -0400 Subject: noticed a problem --- doc/plugins/po.mdwn | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'doc/plugins/po.mdwn') diff --git a/doc/plugins/po.mdwn b/doc/plugins/po.mdwn index 2fbf67016..4e1bf20bb 100644 --- a/doc/plugins/po.mdwn +++ b/doc/plugins/po.mdwn @@ -277,6 +277,15 @@ That used to be so, but the bug was fixed. Does this mean that po might be replacing the only link on a page, in error? --[[Joey]] +Name of toplevel index page +--------------------------- + +Normally at the top index page of a wiki, you see the wiki name at +the top. However, at the top *translated* index page, you see something +like "index.da". + + + Documentation ------------- -- cgit v1.2.3 From 1b63a0e4fae5396014ed222647ae9c3c88a35de5 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Sat, 15 Aug 2009 16:15:36 -0400 Subject: another problem --- doc/plugins/po.mdwn | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'doc/plugins/po.mdwn') diff --git a/doc/plugins/po.mdwn b/doc/plugins/po.mdwn index 4e1bf20bb..5016f1037 100644 --- a/doc/plugins/po.mdwn +++ b/doc/plugins/po.mdwn @@ -282,9 +282,17 @@ Name of toplevel index page Normally at the top index page of a wiki, you see the wiki name at the top. However, at the top *translated* index page, you see something -like "index.da". +like "index.da". --[[Joey]] +Pagespecs +--------- +I was suprised that, when using the map directive, a pagespec of "*" +listed all the translated pages as well as regular pages. That can +make a big difference to an existing wiki when po is turned on, +and seems generally not wanted. +(OTOH, you do want to match translated pages by +default when locking pages.) --[[Joey]] Documentation ------------- -- cgit v1.2.3 From 43e895ec78a00a53aca31a5b38c18e8ef4ab6842 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Sat, 15 Aug 2009 17:29:05 -0400 Subject: another problem --- doc/plugins/po.mdwn | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'doc/plugins/po.mdwn') diff --git a/doc/plugins/po.mdwn b/doc/plugins/po.mdwn index 5016f1037..f738d61de 100644 --- a/doc/plugins/po.mdwn +++ b/doc/plugins/po.mdwn @@ -248,7 +248,7 @@ ea753782b222bf4ba2fb4683b6363afdd9055b64, which should be reverted once [[intrigeri]]'s `meta` branch is merged. An integration branch, called `meta-po`, merges [[intrigeri]]'s `po` -and `meta` branches, and thus has thise additional features. +and `meta` branches, and thus has this additional features. Self links ---------- @@ -294,6 +294,18 @@ and seems generally not wanted. (OTOH, you do want to match translated pages by default when locking pages.) --[[Joey]] +Edit links on untranslated pages +-------------------------------- + +If a page is not translated yet, the "translated" version of it +displays wikilinks to other, existing (but not yet translated?) +pages as edit links, as if those pages do not exist. + +That's really confusing, especially as clicking such a link +brings up an edit form to create a new, english page. + +This is with po_link_to=current. With default, it doesn't happen.. + Documentation ------------- -- cgit v1.2.3 From 7d901b9a5412e94ab127fcc447536e391eba0399 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Sat, 15 Aug 2009 19:16:22 -0400 Subject: another problem.. --- doc/plugins/po.mdwn | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'doc/plugins/po.mdwn') diff --git a/doc/plugins/po.mdwn b/doc/plugins/po.mdwn index f738d61de..f6409aae5 100644 --- a/doc/plugins/po.mdwn +++ b/doc/plugins/po.mdwn @@ -306,6 +306,20 @@ brings up an edit form to create a new, english page. This is with po_link_to=current. With default, it doesn't happen.. +Double commits of po files +-------------------------- + +When adding a new english page, the po files are created, committed, +and then committed again. The second commit makes this change: + + -"Content-Type: text/plain; charset=utf-8\n" + -"Content-Transfer-Encoding: ENCODING" + +"Content-Type: text/plain; charset=UTF-8\n" + +"Content-Transfer-Encoding: ENCODING\n" + +Same thing happens when a change to an existing page triggers a po file +update. + Documentation ------------- -- cgit v1.2.3 From 7ea1f9692687310fb434a7cc6e6f84b57b9f4ef8 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Sat, 15 Aug 2009 19:39:51 -0400 Subject: apache config details --- doc/plugins/po.mdwn | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'doc/plugins/po.mdwn') diff --git a/doc/plugins/po.mdwn b/doc/plugins/po.mdwn index f6409aae5..30f2e158e 100644 --- a/doc/plugins/po.mdwn +++ b/doc/plugins/po.mdwn @@ -114,7 +114,8 @@ Apache Using Apache `mod_negotiation` makes it really easy to have Apache serve any page in the client's preferred language, if available. -This is the default Debian Apache configuration. + +Add 'Options MultiViews' to the wiki directory's configuration in Apache. When `usedirs` is enabled, one has to set `DirectoryIndex index` for the wiki context. @@ -123,6 +124,8 @@ Setting `DefaultLanguage LL` (replace `LL` with your default MIME language code) for the wiki context can help to ensure `bla/page/index.en.html` is served as `Content-Language: LL`. +For details, see [Apache's documentation](http://httpd.apache.org/docs/2.2/content-negotiation.html). + lighttpd -------- -- cgit v1.2.3 From 0e4f67842a449d4f25b79836078a352007ea27b9 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Sat, 15 Aug 2009 21:00:27 -0400 Subject: update --- doc/plugins/po.mdwn | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'doc/plugins/po.mdwn') diff --git a/doc/plugins/po.mdwn b/doc/plugins/po.mdwn index 30f2e158e..684593bf3 100644 --- a/doc/plugins/po.mdwn +++ b/doc/plugins/po.mdwn @@ -307,7 +307,7 @@ pages as edit links, as if those pages do not exist. That's really confusing, especially as clicking such a link brings up an edit form to create a new, english page. -This is with po_link_to=current. With default, it doesn't happen.. +This is with po_link_to=current or negotiated. With default, it doesn't happen.. Double commits of po files -------------------------- -- cgit v1.2.3 From 4ff3e2a540d154d49dfc70fb89dcc8422f2047e3 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Sat, 15 Aug 2009 22:18:05 -0400 Subject: po: Better fix for missing underlay translation problem. If a page is taken from the underlay, and one of the specified languages does not have po files in the underlay, it would create a broken link to the translated version of the page for that language. With this change, there's no broken link. --- IkiWiki/Plugin/po.pm | 4 ++-- doc/plugins/po.mdwn | 5 +++-- 2 files changed, 5 insertions(+), 4 deletions(-) (limited to 'doc/plugins/po.mdwn') diff --git a/IkiWiki/Plugin/po.pm b/IkiWiki/Plugin/po.pm index ce32aab05..aa3d72b90 100644 --- a/IkiWiki/Plugin/po.pm +++ b/IkiWiki/Plugin/po.pm @@ -891,7 +891,7 @@ sub percenttranslated ($) { my $page=shift; $page=~s/^\///; - return gettext("0") unless istranslation($page); + return gettext("N/A") unless istranslation($page); my $file=srcfile($pagesources{$page}); my $masterfile = srcfile($pagesources{masterpage($page)}); my %options = ( @@ -934,7 +934,7 @@ sub otherlanguagesloop ($) { master => 1, }; } - else { + elsif (istranslation($otherpage)) { push @ret, { url => urlto_with_orig_beautiful_urlpath($otherpage, $page), code => $lang, diff --git a/doc/plugins/po.mdwn b/doc/plugins/po.mdwn index 684593bf3..3766ad295 100644 --- a/doc/plugins/po.mdwn +++ b/doc/plugins/po.mdwn @@ -307,7 +307,8 @@ pages as edit links, as if those pages do not exist. That's really confusing, especially as clicking such a link brings up an edit form to create a new, english page. -This is with po_link_to=current or negotiated. With default, it doesn't happen.. +This is with po_link_to=current or negotiated. With default, it doesn't +happen.. --[[Joey]] Double commits of po files -------------------------- @@ -321,7 +322,7 @@ and then committed again. The second commit makes this change: +"Content-Transfer-Encoding: ENCODING\n" Same thing happens when a change to an existing page triggers a po file -update. +update. --[[Joey]] Documentation ------------- -- cgit v1.2.3 From db041b8854d2d3f7137367e11e960ac4f6cdb6c5 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Sun, 16 Aug 2009 13:53:44 -0400 Subject: minor problem --- doc/plugins/po.mdwn | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'doc/plugins/po.mdwn') diff --git a/doc/plugins/po.mdwn b/doc/plugins/po.mdwn index 3766ad295..3f91775f1 100644 --- a/doc/plugins/po.mdwn +++ b/doc/plugins/po.mdwn @@ -308,7 +308,19 @@ That's really confusing, especially as clicking such a link brings up an edit form to create a new, english page. This is with po_link_to=current or negotiated. With default, it doesn't -happen.. --[[Joey]] +happen.. + +Also, this may only happen if the page being linked to is coming from an +underlay, and the underlays lack translation to a given language. +--[[Joey]] + +recentchanges links to po files +------------------------------- + +When a po file is changed, the recentchanges page shows a link such as +"sandbox.es". But, clicking on it goes to the English (or negotiated +language) version of the page. It would be better in this one case if +the link went direct to the translated version of the page. --[[Joey]] Double commits of po files -------------------------- -- cgit v1.2.3 From f712ffa66df2edc119d34a09a76b0c4d82563543 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Wed, 19 Aug 2009 14:12:37 -0400 Subject: another issue --- doc/plugins/po.mdwn | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'doc/plugins/po.mdwn') diff --git a/doc/plugins/po.mdwn b/doc/plugins/po.mdwn index 3f91775f1..dca2f5d66 100644 --- a/doc/plugins/po.mdwn +++ b/doc/plugins/po.mdwn @@ -336,6 +336,11 @@ and then committed again. The second commit makes this change: Same thing happens when a change to an existing page triggers a po file update. --[[Joey]] +Ugly messages with empty files +------------------------------ + +If there are empty .mdwn files, the po plugin displays some ugly messages. + Documentation ------------- -- cgit v1.2.3 From 145d89a6fc03936cc36d70946a8471da9bfe468a Mon Sep 17 00:00:00 2001 From: intrigeri Date: Wed, 26 Aug 2009 01:05:07 -0400 Subject: po: maybe fixed self links --- doc/plugins/po.mdwn | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'doc/plugins/po.mdwn') diff --git a/doc/plugins/po.mdwn b/doc/plugins/po.mdwn index dca2f5d66..b4c8b135e 100644 --- a/doc/plugins/po.mdwn +++ b/doc/plugins/po.mdwn @@ -260,7 +260,9 @@ If a page contains a WikiLink to itself, ikiwiki does not normally turn that into a hyperlink. However, if a translated page contains a WikiLink to itself, a hyperlink is inserted, at least with the default `po_link_to` the link points to the English version of the page. Is there a -good reason for that to be done? --[[Joey]] +good reason for that to be done? --[[Joey]] + +> The commit 0113c69d4fb in my po branch might fix this. --[[intrigeri]] Language display order ---------------------- -- cgit v1.2.3 From 7bd7e78e4a7d31c460909776057687e0e29dba12 Mon Sep 17 00:00:00 2001 From: intrigeri Date: Wed, 26 Aug 2009 01:41:55 -0400 Subject: po: commenting some TODO items --- doc/plugins/po.mdwn | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'doc/plugins/po.mdwn') diff --git a/doc/plugins/po.mdwn b/doc/plugins/po.mdwn index b4c8b135e..45630d763 100644 --- a/doc/plugins/po.mdwn +++ b/doc/plugins/po.mdwn @@ -282,12 +282,23 @@ That used to be so, but the bug was fixed. Does this mean that po might be replacing the only link on a page, in error? --[[Joey]] +> It would replace it. The only problematic case is when another +> plugin has its own reasons, in its `scan` hook, to add a page +> that is already there to `$links{$page}`. This other plugin's +> effect might then be changed by po's `scan` hook... which could +> be either good (better overall l10n) or bad (break the other +> plugin's goal). --[[intrigeri]] + Name of toplevel index page --------------------------- Normally at the top index page of a wiki, you see the wiki name at the top. However, at the top *translated* index page, you see something -like "index.da". --[[Joey]] +like "index.da". --[[Joey]] + +> I suggest changing `Render.pm`, line 115, to replace the `$page eq 'index'` +> test with a predicate call such as isindexpage($page). Such a predicate +> function could then be overriden by the po plugin. --[[intrigeri]] Pagespecs --------- -- cgit v1.2.3 From d5a04b2de9ce027c0e4cd47c9342bcd3db7f9f27 Mon Sep 17 00:00:00 2001 From: intrigeri Date: Wed, 26 Aug 2009 02:00:48 -0400 Subject: po: more TODO items comments and patches --- doc/plugins/po.mdwn | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'doc/plugins/po.mdwn') diff --git a/doc/plugins/po.mdwn b/doc/plugins/po.mdwn index 45630d763..079a36633 100644 --- a/doc/plugins/po.mdwn +++ b/doc/plugins/po.mdwn @@ -335,6 +335,10 @@ When a po file is changed, the recentchanges page shows a link such as language) version of the page. It would be better in this one case if the link went direct to the translated version of the page. --[[Joey]] +> The (untested) commit 496e8523c670 in my po branch might fix this... +> or at least, I believe, put someone on the right track. +> --[[intrigeri]] + Double commits of po files -------------------------- -- cgit v1.2.3 From 4ce93af516360a223016681961481f51a3ce81f7 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Wed, 26 Aug 2009 13:09:43 -0400 Subject: translation of directives --- doc/plugins/po.mdwn | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'doc/plugins/po.mdwn') diff --git a/doc/plugins/po.mdwn b/doc/plugins/po.mdwn index 079a36633..9273da399 100644 --- a/doc/plugins/po.mdwn +++ b/doc/plugins/po.mdwn @@ -358,6 +358,15 @@ Ugly messages with empty files If there are empty .mdwn files, the po plugin displays some ugly messages. +Translation of directives +------------------------- + +If a translated page contains a directive, it may expand to some english +text, or text in whatever single language ikiwiki is configured to "speak". + +Maybe there could be a way to switch ikiwiki to speaking another language +when building a non-english page? Then the directives would get translated. + Documentation ------------- -- cgit v1.2.3 From 18fc71f033cf0ff9ccd6ef16212ce3b4e34ac725 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Thu, 27 Aug 2009 12:56:24 -0400 Subject: unsure if this patch is enough --- doc/plugins/po.mdwn | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'doc/plugins/po.mdwn') diff --git a/doc/plugins/po.mdwn b/doc/plugins/po.mdwn index 9273da399..b77c545d9 100644 --- a/doc/plugins/po.mdwn +++ b/doc/plugins/po.mdwn @@ -264,6 +264,11 @@ good reason for that to be done? --[[Joey]] > The commit 0113c69d4fb in my po branch might fix this. --[[intrigeri]] +>> It may fix it in passing, but shouldn't it also be fixed for the other +>> `po_link_to` styles? (Also, if `mybestlink` is going to always +>> just return `bestlink` in this case, there seems no reason to inject +>> it.) --[[Joey]] + Language display order ---------------------- -- cgit v1.2.3 From e1acb707db3f204708f88648ed80762689a15425 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Thu, 27 Aug 2009 12:57:04 -0400 Subject: cherry-picked fix for recentchanges links --- doc/plugins/po.mdwn | 12 ------------ 1 file changed, 12 deletions(-) (limited to 'doc/plugins/po.mdwn') diff --git a/doc/plugins/po.mdwn b/doc/plugins/po.mdwn index b77c545d9..2e32d78fd 100644 --- a/doc/plugins/po.mdwn +++ b/doc/plugins/po.mdwn @@ -332,18 +332,6 @@ Also, this may only happen if the page being linked to is coming from an underlay, and the underlays lack translation to a given language. --[[Joey]] -recentchanges links to po files -------------------------------- - -When a po file is changed, the recentchanges page shows a link such as -"sandbox.es". But, clicking on it goes to the English (or negotiated -language) version of the page. It would be better in this one case if -the link went direct to the translated version of the page. --[[Joey]] - -> The (untested) commit 496e8523c670 in my po branch might fix this... -> or at least, I believe, put someone on the right track. -> --[[intrigeri]] - Double commits of po files -------------------------- -- cgit v1.2.3 From 5e515b493c00c70095aeb8bad1e0b7757ed943db Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Thu, 27 Aug 2009 13:10:31 -0400 Subject: followups --- doc/plugins/po.mdwn | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'doc/plugins/po.mdwn') diff --git a/doc/plugins/po.mdwn b/doc/plugins/po.mdwn index 2e32d78fd..65573b877 100644 --- a/doc/plugins/po.mdwn +++ b/doc/plugins/po.mdwn @@ -294,6 +294,12 @@ that po might be replacing the only link on a page, in error? > be either good (better overall l10n) or bad (break the other > plugin's goal). --[[intrigeri]] +>> Right.. well, the cases where links are added is very small. +>> Grepping for `add_link`, it's just done by link, camelcase, meta, and +>> tag. All of these are supposed to work just link regular links +>> so I'd think that is ok. We could probably remove the currently scary +>> comment about only wanting to change the first link. --[[Joey]] + Name of toplevel index page --------------------------- @@ -305,6 +311,14 @@ like "index.da". --[[Joey]] > test with a predicate call such as isindexpage($page). Such a predicate > function could then be overriden by the po plugin. --[[intrigeri]] +>> Could do that, but if you have such a function it's natural to want to +>> use it elsewhere. Not clear to me it would make sense for po to override +>> such a function if it were used in some of the other places that compare +>> to index. +>> +>> The other option would be for po to override the template setting. +>> --[[Joey]] + Pagespecs --------- -- cgit v1.2.3 From 7d35d17f956740a310465d5162b9313e120694a3 Mon Sep 17 00:00:00 2001 From: intrigeri Date: Thu, 27 Aug 2009 20:01:24 +0200 Subject: doc/po: follow-up Signed-off-by: intrigeri --- doc/plugins/po.mdwn | 2 ++ 1 file changed, 2 insertions(+) (limited to 'doc/plugins/po.mdwn') diff --git a/doc/plugins/po.mdwn b/doc/plugins/po.mdwn index 65573b877..2c230d409 100644 --- a/doc/plugins/po.mdwn +++ b/doc/plugins/po.mdwn @@ -300,6 +300,8 @@ that po might be replacing the only link on a page, in error? >> so I'd think that is ok. We could probably remove the currently scary >> comment about only wanting to change the first link. --[[Joey]] +>>> Commit 3c2bffe21b91684 in my po branch does this. --[[intrigeri]] + Name of toplevel index page --------------------------- -- cgit v1.2.3 From 6bc3206af16f4910e49478319a8e81d74c7de342 Mon Sep 17 00:00:00 2001 From: intrigeri Date: Thu, 27 Aug 2009 20:21:16 +0200 Subject: doc/po: follow-up --- doc/plugins/po.mdwn | 2 ++ 1 file changed, 2 insertions(+) (limited to 'doc/plugins/po.mdwn') diff --git a/doc/plugins/po.mdwn b/doc/plugins/po.mdwn index 2c230d409..1d343e0f8 100644 --- a/doc/plugins/po.mdwn +++ b/doc/plugins/po.mdwn @@ -321,6 +321,8 @@ like "index.da". --[[Joey]] >> The other option would be for po to override the template setting. >> --[[Joey]] +>>> Great idea. Commit 6c0f9c691c3df3a in my po branch does it. --[[intrigeri]] + Pagespecs --------- -- cgit v1.2.3 From eaa782a1856cff50df68f1135955d58dc97bb833 Mon Sep 17 00:00:00 2001 From: intrigeri Date: Thu, 27 Aug 2009 20:38:36 +0200 Subject: doc/po(self-links): follow-ups Signed-off-by: intrigeri --- doc/plugins/po.mdwn | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) (limited to 'doc/plugins/po.mdwn') diff --git a/doc/plugins/po.mdwn b/doc/plugins/po.mdwn index 1d343e0f8..673bbf406 100644 --- a/doc/plugins/po.mdwn +++ b/doc/plugins/po.mdwn @@ -265,9 +265,20 @@ good reason for that to be done? --[[Joey]] > The commit 0113c69d4fb in my po branch might fix this. --[[intrigeri]] >> It may fix it in passing, but shouldn't it also be fixed for the other ->> `po_link_to` styles? (Also, if `mybestlink` is going to always ->> just return `bestlink` in this case, there seems no reason to inject ->> it.) --[[Joey]] +>> `po_link_to` styles? + +>>> Other `po_link_to` styles already work ok: say there is +>>> a \[[dest]] link on a page called `dest`. When rendering +>>> `dest.LL`, `mybestlink` returns `dest.LL`, and `htmllink` is then +>>> able to detect, and manage correctly, that it is a self-link. +>>> --[[intrigeri]] + +>> (Also, if `mybestlink` is going to always just return `bestlink` in +>> this case, there seems no reason to inject it.) --[[Joey]] + +>>> Right. Commit cdc3576c8d1efb2 in my po branch prevents +>>> `mybestlink` to be injected when `po_link_to` is +>>> `default`. --[[intrigeri]] Language display order ---------------------- -- cgit v1.2.3 From ffcd97ce52edd73f092d15aae89bbacad99b38b6 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Thu, 27 Aug 2009 15:49:12 -0400 Subject: change cherry-picked; move to discussion --- doc/plugins/po.mdwn | 24 ------------------------ doc/plugins/po/discussion.mdwn | 25 +++++++++++++++++++++++++ 2 files changed, 25 insertions(+), 24 deletions(-) (limited to 'doc/plugins/po.mdwn') diff --git a/doc/plugins/po.mdwn b/doc/plugins/po.mdwn index 673bbf406..9c4d8ffbd 100644 --- a/doc/plugins/po.mdwn +++ b/doc/plugins/po.mdwn @@ -289,30 +289,6 @@ order, as `po_slave_languages` is a hash. It would need to be converted to an array to support this. (If twere done, twere best done quickly.) --[[Joey]] -Duplicate %links ? ------------------- - -I notice code in the scan hook that seems to assume -that %links will accumulate duplicate links for a page. -That used to be so, but the bug was fixed. Does this mean -that po might be replacing the only link on a page, in error? ---[[Joey]] - -> It would replace it. The only problematic case is when another -> plugin has its own reasons, in its `scan` hook, to add a page -> that is already there to `$links{$page}`. This other plugin's -> effect might then be changed by po's `scan` hook... which could -> be either good (better overall l10n) or bad (break the other -> plugin's goal). --[[intrigeri]] - ->> Right.. well, the cases where links are added is very small. ->> Grepping for `add_link`, it's just done by link, camelcase, meta, and ->> tag. All of these are supposed to work just link regular links ->> so I'd think that is ok. We could probably remove the currently scary ->> comment about only wanting to change the first link. --[[Joey]] - ->>> Commit 3c2bffe21b91684 in my po branch does this. --[[intrigeri]] - Name of toplevel index page --------------------------- diff --git a/doc/plugins/po/discussion.mdwn b/doc/plugins/po/discussion.mdwn index 1c3f0e752..ab822e76c 100644 --- a/doc/plugins/po/discussion.mdwn +++ b/doc/plugins/po/discussion.mdwn @@ -699,3 +699,28 @@ and via CGI, have been tested. * general test with `indexpages` enabled: **not OK** * general test with `po_link_to=default` with `userdirs` enabled: **OK** * general test with `po_link_to=default` with `userdirs` disabled: **OK** + +Duplicate %links ? +------------------ + +I notice code in the scan hook that seems to assume +that %links will accumulate duplicate links for a page. +That used to be so, but the bug was fixed. Does this mean +that po might be replacing the only link on a page, in error? +--[[Joey]] + +> It would replace it. The only problematic case is when another +> plugin has its own reasons, in its `scan` hook, to add a page +> that is already there to `$links{$page}`. This other plugin's +> effect might then be changed by po's `scan` hook... which could +> be either good (better overall l10n) or bad (break the other +> plugin's goal). --[[intrigeri]] + +>> Right.. well, the cases where links are added is very small. +>> Grepping for `add_link`, it's just done by link, camelcase, meta, and +>> tag. All of these are supposed to work just link regular links +>> so I'd think that is ok. We could probably remove the currently scary +>> comment about only wanting to change the first link. --[[Joey]] + +>>> Commit 3c2bffe21b91684 in my po branch does this. --[[intrigeri]] +>>>> Cherry-picked --[[Joey]] -- cgit v1.2.3 From f8ad1bfec4e12944482d5f58a0961b0c476602c9 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Thu, 27 Aug 2009 15:50:43 -0400 Subject: fix cherry-picked --- debian/changelog | 1 + doc/plugins/po.mdwn | 21 --------------------- 2 files changed, 1 insertion(+), 21 deletions(-) (limited to 'doc/plugins/po.mdwn') diff --git a/debian/changelog b/debian/changelog index 69e197e37..9f10c2913 100644 --- a/debian/changelog +++ b/debian/changelog @@ -29,6 +29,7 @@ ikiwiki (3.1415926) UNRELEASED; urgency=low * Rebuild wikis on upgrade to this version to fix bloat caused by the dependency bug. * htmltidy: Print a warning message if tidy fails. Closes: #543722 + * po: Fix name of translated toplevel index page. (intrigeri) -- Joey Hess Wed, 12 Aug 2009 12:25:30 -0400 diff --git a/doc/plugins/po.mdwn b/doc/plugins/po.mdwn index 9c4d8ffbd..f020adac2 100644 --- a/doc/plugins/po.mdwn +++ b/doc/plugins/po.mdwn @@ -289,27 +289,6 @@ order, as `po_slave_languages` is a hash. It would need to be converted to an array to support this. (If twere done, twere best done quickly.) --[[Joey]] -Name of toplevel index page ---------------------------- - -Normally at the top index page of a wiki, you see the wiki name at -the top. However, at the top *translated* index page, you see something -like "index.da". --[[Joey]] - -> I suggest changing `Render.pm`, line 115, to replace the `$page eq 'index'` -> test with a predicate call such as isindexpage($page). Such a predicate -> function could then be overriden by the po plugin. --[[intrigeri]] - ->> Could do that, but if you have such a function it's natural to want to ->> use it elsewhere. Not clear to me it would make sense for po to override ->> such a function if it were used in some of the other places that compare ->> to index. ->> ->> The other option would be for po to override the template setting. ->> --[[Joey]] - ->>> Great idea. Commit 6c0f9c691c3df3a in my po branch does it. --[[intrigeri]] - Pagespecs --------- -- cgit v1.2.3 From 18e4fa65399f2a21bd943b0e62b81a100f941d44 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Thu, 27 Aug 2009 15:54:44 -0400 Subject: fix merged --- debian/changelog | 1 + doc/plugins/po.mdwn | 27 --------------------------- 2 files changed, 1 insertion(+), 27 deletions(-) (limited to 'doc/plugins/po.mdwn') diff --git a/debian/changelog b/debian/changelog index 9f10c2913..b4169c576 100644 --- a/debian/changelog +++ b/debian/changelog @@ -30,6 +30,7 @@ ikiwiki (3.1415926) UNRELEASED; urgency=low by the dependency bug. * htmltidy: Print a warning message if tidy fails. Closes: #543722 * po: Fix name of translated toplevel index page. (intrigeri) + * po: Fix display of links from a translated page to itself (ntrigeri) -- Joey Hess Wed, 12 Aug 2009 12:25:30 -0400 diff --git a/doc/plugins/po.mdwn b/doc/plugins/po.mdwn index f020adac2..57459c1ef 100644 --- a/doc/plugins/po.mdwn +++ b/doc/plugins/po.mdwn @@ -253,33 +253,6 @@ once [[intrigeri]]'s `meta` branch is merged. An integration branch, called `meta-po`, merges [[intrigeri]]'s `po` and `meta` branches, and thus has this additional features. -Self links ----------- - -If a page contains a WikiLink to itself, ikiwiki does not normally -turn that into a hyperlink. However, if a translated page contains a -WikiLink to itself, a hyperlink is inserted, at least with the default -`po_link_to` the link points to the English version of the page. Is there a -good reason for that to be done? --[[Joey]] - -> The commit 0113c69d4fb in my po branch might fix this. --[[intrigeri]] - ->> It may fix it in passing, but shouldn't it also be fixed for the other ->> `po_link_to` styles? - ->>> Other `po_link_to` styles already work ok: say there is ->>> a \[[dest]] link on a page called `dest`. When rendering ->>> `dest.LL`, `mybestlink` returns `dest.LL`, and `htmllink` is then ->>> able to detect, and manage correctly, that it is a self-link. ->>> --[[intrigeri]] - ->> (Also, if `mybestlink` is going to always just return `bestlink` in ->> this case, there seems no reason to inject it.) --[[Joey]] - ->>> Right. Commit cdc3576c8d1efb2 in my po branch prevents ->>> `mybestlink` to be injected when `po_link_to` is ->>> `default`. --[[intrigeri]] - Language display order ---------------------- -- cgit v1.2.3 From 8064acf87fb7e708a03e47dd82457dec237e886e Mon Sep 17 00:00:00 2001 From: intrigeri Date: Fri, 28 Aug 2009 13:19:48 +0200 Subject: doc/po: reported bug + patches wrt. created page type Signed-off-by: intrigeri --- doc/plugins/po.mdwn | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'doc/plugins/po.mdwn') diff --git a/doc/plugins/po.mdwn b/doc/plugins/po.mdwn index 57459c1ef..3b152586e 100644 --- a/doc/plugins/po.mdwn +++ b/doc/plugins/po.mdwn @@ -317,6 +317,19 @@ text, or text in whatever single language ikiwiki is configured to "speak". Maybe there could be a way to switch ikiwiki to speaking another language when building a non-english page? Then the directives would get translated. +Created page type +----------------- + +The interdiction to create pages of type po was broken by the new +`page_types` code. This is fixed in my po branch by +commit 1914ae2fd24e1e802. + +While I was there, I also added some code to set a new default value +to the type select field in case it was previously set to "po". +This code favors the type of the linking page's masterpage on page +creation (when `from=page.LL`). This is commit c9301d2c296f682. +--[[intrigeri]] + Documentation ------------- -- cgit v1.2.3 From cc6000f0b9b82b19ea4635edcace2f6ba164adf1 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Fri, 28 Aug 2009 07:34:09 -0400 Subject: both changes picked --- debian/changelog | 3 +++ doc/plugins/po.mdwn | 2 ++ 2 files changed, 5 insertions(+) (limited to 'doc/plugins/po.mdwn') diff --git a/debian/changelog b/debian/changelog index 045f27540..d10bc36cf 100644 --- a/debian/changelog +++ b/debian/changelog @@ -32,6 +32,9 @@ ikiwiki (3.1415926) UNRELEASED; urgency=low * po: Fix name of translated toplevel index page. (intrigeri) * po: Fix display of links from a translated page to itself (ntrigeri) * Add Czech basewiki translation from Miroslav Kure. + * po: fix interdiction to create pages of type po (intrigeri) + * po: po: favor the type of linking page's masterpage on page creation + (intrigeri) -- Joey Hess Wed, 12 Aug 2009 12:25:30 -0400 diff --git a/doc/plugins/po.mdwn b/doc/plugins/po.mdwn index 3b152586e..fdef41e45 100644 --- a/doc/plugins/po.mdwn +++ b/doc/plugins/po.mdwn @@ -330,6 +330,8 @@ This code favors the type of the linking page's masterpage on page creation (when `from=page.LL`). This is commit c9301d2c296f682. --[[intrigeri]] +> Both cherry picked. --[[Joey]] + Documentation ------------- -- cgit v1.2.3 From e3b5d7013717af732b36efd9e4abe1f14d0f3175 Mon Sep 17 00:00:00 2001 From: intrigeri Date: Fri, 28 Aug 2009 14:41:32 +0200 Subject: doc/po: bug report + patch proposal wrt. inline's post form's rootpage Signed-off-by: intrigeri --- doc/plugins/po.mdwn | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'doc/plugins/po.mdwn') diff --git a/doc/plugins/po.mdwn b/doc/plugins/po.mdwn index fdef41e45..39b237c73 100644 --- a/doc/plugins/po.mdwn +++ b/doc/plugins/po.mdwn @@ -332,6 +332,17 @@ creation (when `from=page.LL`). This is commit c9301d2c296f682. > Both cherry picked. --[[Joey]] +inline's post form's rootpage +----------------------------- + +When a translatable page (say it is called "bugs") contains an +[[inline directive|ikiwiki/directive/inline]] with `postform` enabled, +the rootpage is l10n'd on translations pages (e.g. "bugs.fr" gets +a `rootpage` value of `bugs.fr`). This is usually not what's expected, +as translation pages are not supposed to have subpages. My po branch +has code (e671e72053e81fa, which depends on 72ac9821e56637) that fixes +this. --[[intrigeri]] + Documentation ------------- -- cgit v1.2.3 From 6be874612539d3148d288fc6a4c47743a7c0c8fc Mon Sep 17 00:00:00 2001 From: intrigeri Date: Fri, 28 Aug 2009 16:38:13 +0200 Subject: doc/po: report problem with link() + propose patch Signed-off-by: intrigeri --- doc/plugins/po.mdwn | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'doc/plugins/po.mdwn') diff --git a/doc/plugins/po.mdwn b/doc/plugins/po.mdwn index 39b237c73..031188a67 100644 --- a/doc/plugins/po.mdwn +++ b/doc/plugins/po.mdwn @@ -343,6 +343,15 @@ as translation pages are not supposed to have subpages. My po branch has code (e671e72053e81fa, which depends on 72ac9821e56637) that fixes this. --[[intrigeri]] +link() pagespec on translation pages +------------------------------------ + +The `link()` pagespec, on translation pages, currently tests whether +a given page links to the *current translation page*, rather than +whether it links to its master page. I believe the later is generally +expected. Commit 646c9a4c95a480 in my po branch fixes this. +--[[intrigeri]] + Documentation ------------- -- cgit v1.2.3 From 2ba54735ce78a80d9577bef068f674559dddf57b Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Fri, 28 Aug 2009 18:22:11 -0400 Subject: po test suite failure --- doc/plugins/po.mdwn | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'doc/plugins/po.mdwn') diff --git a/doc/plugins/po.mdwn b/doc/plugins/po.mdwn index 031188a67..4fecaeb53 100644 --- a/doc/plugins/po.mdwn +++ b/doc/plugins/po.mdwn @@ -352,6 +352,12 @@ whether it links to its master page. I believe the later is generally expected. Commit 646c9a4c95a480 in my po branch fixes this. --[[intrigeri]] +2 test suite failures +-------------------- + +t/po is currently failing tests 57 and 59 (and I would like to release +soon..) --[[Joey]] + Documentation ------------- -- cgit v1.2.3 From 94727e7fcfff204030bec64509ecedacb0abd6dc Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Fri, 28 Aug 2009 19:49:22 -0400 Subject: merged --- doc/plugins/po.mdwn | 35 ----------------------------------- 1 file changed, 35 deletions(-) (limited to 'doc/plugins/po.mdwn') diff --git a/doc/plugins/po.mdwn b/doc/plugins/po.mdwn index 4fecaeb53..04420c115 100644 --- a/doc/plugins/po.mdwn +++ b/doc/plugins/po.mdwn @@ -317,41 +317,6 @@ text, or text in whatever single language ikiwiki is configured to "speak". Maybe there could be a way to switch ikiwiki to speaking another language when building a non-english page? Then the directives would get translated. -Created page type ------------------ - -The interdiction to create pages of type po was broken by the new -`page_types` code. This is fixed in my po branch by -commit 1914ae2fd24e1e802. - -While I was there, I also added some code to set a new default value -to the type select field in case it was previously set to "po". -This code favors the type of the linking page's masterpage on page -creation (when `from=page.LL`). This is commit c9301d2c296f682. ---[[intrigeri]] - -> Both cherry picked. --[[Joey]] - -inline's post form's rootpage ------------------------------ - -When a translatable page (say it is called "bugs") contains an -[[inline directive|ikiwiki/directive/inline]] with `postform` enabled, -the rootpage is l10n'd on translations pages (e.g. "bugs.fr" gets -a `rootpage` value of `bugs.fr`). This is usually not what's expected, -as translation pages are not supposed to have subpages. My po branch -has code (e671e72053e81fa, which depends on 72ac9821e56637) that fixes -this. --[[intrigeri]] - -link() pagespec on translation pages ------------------------------------- - -The `link()` pagespec, on translation pages, currently tests whether -a given page links to the *current translation page*, rather than -whether it links to its master page. I believe the later is generally -expected. Commit 646c9a4c95a480 in my po branch fixes this. ---[[intrigeri]] - 2 test suite failures -------------------- -- cgit v1.2.3 From ef69cb34c355e184b01999cf445793cebc16f0c4 Mon Sep 17 00:00:00 2001 From: intrigeri Date: Sat, 29 Aug 2009 16:32:48 +0200 Subject: doc/po(test suite failures): follow-up Signed-off-by: intrigeri --- doc/plugins/po.mdwn | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'doc/plugins/po.mdwn') diff --git a/doc/plugins/po.mdwn b/doc/plugins/po.mdwn index 04420c115..9f4cf5564 100644 --- a/doc/plugins/po.mdwn +++ b/doc/plugins/po.mdwn @@ -323,6 +323,20 @@ when building a non-english page? Then the directives would get translated. t/po is currently failing tests 57 and 59 (and I would like to release soon..) --[[Joey]] +> They are failing because of commit cdc3576c8d1e (po: do not inject +> custom bestlink function when `po_link_to` eq `default`). The test +> suite changes `$config{po_link_to}`, but the `checkconfig` hook is +> not re-run. I could manually run it when needed in the test-suite, +> but this would lead to this function being injected several times, +> and then `$origsubs{'bestlink'}` to be sometimes set to a wrong +> value, which would break other parts of the test-suite. The best +> solution I can think of (apart of reverting this commit or disabling +> these two tests) is to split the test-suite into 3 parts, depending +> on the `$config{po_link_to}` setting, either in 3 different `.t` +> files, or inside the existing one and completely reset the IkiWiki +> environment at the start of these parts... which I did not manage to +> achieve in the last 2 hours :/ --[[intrigeri]] + Documentation ------------- -- cgit v1.2.3 From d678147410fd5b1a7c6ca595f651b4da154229a4 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Sun, 30 Aug 2009 14:49:53 -0400 Subject: Revert "po: do not inject custom bestlink function when po_link_to eq default" This reverts commit cdc3576c8d1efb2593cac2d9da3f2393a2afe26e. Conflicts: IkiWiki/Plugin/po.pm This change broke the test suite and is not strictly necessary. --- IkiWiki/Plugin/po.pm | 12 +++++------- doc/plugins/po.mdwn | 2 ++ 2 files changed, 7 insertions(+), 7 deletions(-) (limited to 'doc/plugins/po.mdwn') diff --git a/IkiWiki/Plugin/po.pm b/IkiWiki/Plugin/po.pm index 792d84261..5d0d9e79d 100644 --- a/IkiWiki/Plugin/po.pm +++ b/IkiWiki/Plugin/po.pm @@ -51,6 +51,8 @@ sub import { hook(type => "formbuilder_setup", id => "po", call => \&formbuilder_setup, last => 1); hook(type => "formbuilder", id => "po", call => \&formbuilder); + $origsubs{'bestlink'}=\&IkiWiki::bestlink; + inject(name => "IkiWiki::bestlink", call => \&mybestlink); $origsubs{'beautify_urlpath'}=\&IkiWiki::beautify_urlpath; inject(name => "IkiWiki::beautify_urlpath", call => \&mybeautify_urlpath); $origsubs{'targetpage'}=\&IkiWiki::targetpage; @@ -153,12 +155,6 @@ sub checkconfig () { warn(gettext('po_link_to=negotiated requires usedirs to be enabled, falling back to po_link_to=default')); $config{po_link_to}='default'; } - unless ($config{po_link_to} eq 'default') { - if (! exists $origsubs{'bestlink'}) { - $origsubs{'bestlink'}=\&IkiWiki::bestlink; - inject(name => "IkiWiki::bestlink", call => \&mybestlink); - } - } push @{$config{wiki_file_prune_regexps}}, qr/\.pot$/; @@ -562,11 +558,13 @@ sub formbuilder (@) { # `---- # Implement po_link_to 'current' and 'negotiated' settings. -# Not injected otherwise. sub mybestlink ($$) { my $page=shift; my $link=shift; + return $origsubs{'bestlink'}->($page, $link) + if $config{po_link_to} eq "default"; + my $res=$origsubs{'bestlink'}->(masterpage($page), $link); my @caller = caller(1); if (length $res diff --git a/doc/plugins/po.mdwn b/doc/plugins/po.mdwn index 9f4cf5564..38b6b12cd 100644 --- a/doc/plugins/po.mdwn +++ b/doc/plugins/po.mdwn @@ -337,6 +337,8 @@ soon..) --[[Joey]] > environment at the start of these parts... which I did not manage to > achieve in the last 2 hours :/ --[[intrigeri]] +>> I've reverted it. --[[Joey]] + Documentation ------------- -- cgit v1.2.3 From 1f828d280a5085f2d9b0c69cbc0d6b4b1a40a105 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Tue, 8 Sep 2009 14:38:57 -0400 Subject: update --- doc/plugins/po.mdwn | 23 ++--------------------- 1 file changed, 2 insertions(+), 21 deletions(-) (limited to 'doc/plugins/po.mdwn') diff --git a/doc/plugins/po.mdwn b/doc/plugins/po.mdwn index 38b6b12cd..f3b70b5f7 100644 --- a/doc/plugins/po.mdwn +++ b/doc/plugins/po.mdwn @@ -317,27 +317,8 @@ text, or text in whatever single language ikiwiki is configured to "speak". Maybe there could be a way to switch ikiwiki to speaking another language when building a non-english page? Then the directives would get translated. -2 test suite failures --------------------- - -t/po is currently failing tests 57 and 59 (and I would like to release -soon..) --[[Joey]] - -> They are failing because of commit cdc3576c8d1e (po: do not inject -> custom bestlink function when `po_link_to` eq `default`). The test -> suite changes `$config{po_link_to}`, but the `checkconfig` hook is -> not re-run. I could manually run it when needed in the test-suite, -> but this would lead to this function being injected several times, -> and then `$origsubs{'bestlink'}` to be sometimes set to a wrong -> value, which would break other parts of the test-suite. The best -> solution I can think of (apart of reverting this commit or disabling -> these two tests) is to split the test-suite into 3 parts, depending -> on the `$config{po_link_to}` setting, either in 3 different `.t` -> files, or inside the existing one and completely reset the IkiWiki -> environment at the start of these parts... which I did not manage to -> achieve in the last 2 hours :/ --[[intrigeri]] - ->> I've reverted it. --[[Joey]] +(We also will need this in order to use translated templates, when they are +available.) Documentation ------------- -- cgit v1.2.3 From 4f25d90ebc2d3ff2ad7a5d7bd8578a6c4d673aa8 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Thu, 14 Jan 2010 18:56:05 -0500 Subject: mention that lighttpd does support this. Example needed. --- doc/plugins/po.mdwn | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'doc/plugins/po.mdwn') diff --git a/doc/plugins/po.mdwn b/doc/plugins/po.mdwn index f3b70b5f7..da85636ec 100644 --- a/doc/plugins/po.mdwn +++ b/doc/plugins/po.mdwn @@ -129,11 +129,10 @@ For details, see [Apache's documentation](http://httpd.apache.org/docs/2.2/conte lighttpd -------- -lighttpd unfortunately does not support content negotiation. - -**FIXME**: does `mod_magnet` provide the functionality needed to - emulate this? +Recent versions of lighttpd should be able to use +`$HTTP["language"]` to configure the translatted pages to be served. +TODO: Example Usage ===== -- cgit v1.2.3 From 65db2f47acfe5815952bb0bfbdbe15b5cf5ce7be Mon Sep 17 00:00:00 2001 From: Spida Date: Fri, 15 Jan 2010 00:15:33 +0000 Subject: --- doc/plugins/po.mdwn | 2 ++ 1 file changed, 2 insertions(+) (limited to 'doc/plugins/po.mdwn') diff --git a/doc/plugins/po.mdwn b/doc/plugins/po.mdwn index da85636ec..576d36ec1 100644 --- a/doc/plugins/po.mdwn +++ b/doc/plugins/po.mdwn @@ -132,6 +132,8 @@ lighttpd Recent versions of lighttpd should be able to use `$HTTP["language"]` to configure the translatted pages to be served. +See [Lighttpd Issue](http://redmine.lighttpd.net/issues/show/1119) + TODO: Example Usage -- cgit v1.2.3 From a128c256a51392fcf752bf612d83a90e8c68027e Mon Sep 17 00:00:00 2001 From: intrigeri Date: Fri, 25 Jun 2010 23:18:34 +0200 Subject: po: added support for html pagetype ... after having audited the po4a Xml and Xhtml modules for security issues. Signed-off-by: intrigeri --- IkiWiki/Plugin/po.pm | 47 +++++++++++++++++++++++++++++++++--------- doc/plugins/po.mdwn | 10 ++++----- doc/plugins/po/discussion.mdwn | 17 +++++++++++++++ 3 files changed, 59 insertions(+), 15 deletions(-) (limited to 'doc/plugins/po.mdwn') diff --git a/IkiWiki/Plugin/po.pm b/IkiWiki/Plugin/po.pm index 10a5ba467..ab1cc7ae6 100644 --- a/IkiWiki/Plugin/po.pm +++ b/IkiWiki/Plugin/po.pm @@ -869,8 +869,8 @@ sub refreshpot ($) { my $masterfile=shift; my $potfile=potfile($masterfile); - my %options = ("markdown" => (pagetype($masterfile) eq 'mdwn') ? 1 : 0); - my $doc=Locale::Po4a::Chooser::new('text',%options); + my $doc=Locale::Po4a::Chooser::new(po4a_type($masterfile), + po4a_options($masterfile)); $doc->{TT}{utf_mode} = 1; $doc->{TT}{file_in_charset} = 'utf-8'; $doc->{TT}{file_out_charset} = 'utf-8'; @@ -961,10 +961,8 @@ sub percenttranslated ($) { return gettext("N/A") unless istranslation($page); my $file=srcfile($pagesources{$page}); my $masterfile = srcfile($pagesources{masterpage($page)}); - my %options = ( - "markdown" => (pagetype($masterfile) eq 'mdwn') ? 1 : 0, - ); - my $doc=Locale::Po4a::Chooser::new('text',%options); + my $doc=Locale::Po4a::Chooser::new(po4a_type($masterfile), + po4a_options($masterfile)); $doc->process( 'po_in_name' => [ $file ], 'file_in_name' => [ $masterfile ], @@ -1115,10 +1113,8 @@ sub po_to_markup ($$) { or return $fail->(sprintf(gettext("failed to write %s"), $infile)); my $masterfile = srcfile($pagesources{masterpage($page)}); - my %options = ( - "markdown" => (pagetype($masterfile) eq 'mdwn') ? 1 : 0, - ); - my $doc=Locale::Po4a::Chooser::new('text',%options); + my $doc=Locale::Po4a::Chooser::new(po4a_type($masterfile), + po4a_options($masterfile)); $doc->process( 'po_in_name' => [ $infile ], 'file_in_name' => [ $masterfile ], @@ -1181,6 +1177,37 @@ sub isvalidpo ($) { "to previous page to continue edit")); } +sub po4a_type ($) { + my $file = shift; + + my $pagetype = pagetype($file); + if ($pagetype eq 'html') { + return 'xhtml'; + } + return 'text'; +} + +sub po4a_options($) { + my $file = shift; + + my %options; + my $pagetype = pagetype($file); + + if ($pagetype eq 'html') { + # how to disable options is not consistent across po4a modules + $options{includessi} = ''; + $options{includeexternal} = 0; + } + elsif ($pagetype eq 'mdwn') { + $options{markdown} = 1; + } + else { + $options{markdown} = 0; + } + + return %options; +} + # ,---- # | PageSpecs # `---- diff --git a/doc/plugins/po.mdwn b/doc/plugins/po.mdwn index 576d36ec1..585e14383 100644 --- a/doc/plugins/po.mdwn +++ b/doc/plugins/po.mdwn @@ -213,16 +213,16 @@ preferred `$EDITOR`, without needing to be online. Markup languages support ------------------------ -[[Markdown|mdwn]] is well supported. Some other markup languages supported -by ikiwiki mostly work, but some pieces of syntax are not rendered -correctly on the slave pages: +[[Markdown|mdwn]] and [[html]] are well supported. Some other markup +languages supported by ikiwiki mostly work, but some pieces of syntax +are not rendered correctly on the slave pages: * [[reStructuredText|rst]]: anonymous hyperlinks and internal cross-references * [[wikitext]]: conversion of newlines to paragraphs * [[creole]]: verbatim text is wrapped, tables are broken -* [[html]] and LaTeX: not supported yet; the dedicated po4a modules - could be used to support them, but they would need a security audit +* LaTeX: not supported yet; the dedicated po4a module + could be used to support it, but it would need a security audit * other markup languages have not been tested. Security diff --git a/doc/plugins/po/discussion.mdwn b/doc/plugins/po/discussion.mdwn index 27683f1ea..73858c818 100644 --- a/doc/plugins/po/discussion.mdwn +++ b/doc/plugins/po/discussion.mdwn @@ -150,6 +150,23 @@ The following analysis was done with his help. variables; according to [[Joey]], this is "Freaky code, but seems ok due to use of `quotementa`". +##### Locale::Po4a::Xhtml + +* does not run any external program +* does not build regexp's from untrusted variables + +=> Seems safe as far as the `includessi` option is disabled; the po +plugin explicitly disables it. + +Relies on Locale::Po4a::Xml` to do most of the work. + +##### Locale::Po4a::Xml + +* does not run any external program +* the `includeexternal` option makes it able to read external files; + the po plugin explicitly disables it +* untrusted variables are escaped when used to build regexp's + ##### Text::WrapI18N `Text::WrapI18N` can cause DoS -- cgit v1.2.3 From 4cf185e781a5f94373b30ec9a0e10dfb626b6d86 Mon Sep 17 00:00:00 2001 From: intrigeri Date: Sat, 26 Jun 2010 00:56:06 +0200 Subject: po_slave_languages can now be a hash, if order matters. --- IkiWiki/Plugin/po.pm | 95 +++++++++++++++++++++++++++++++++------------------- doc/plugins/po.mdwn | 13 ++----- 2 files changed, 62 insertions(+), 46 deletions(-) (limited to 'doc/plugins/po.mdwn') diff --git a/IkiWiki/Plugin/po.pm b/IkiWiki/Plugin/po.pm index ab1cc7ae6..7d5dfee03 100644 --- a/IkiWiki/Plugin/po.pm +++ b/IkiWiki/Plugin/po.pm @@ -28,6 +28,7 @@ use UNIVERSAL; my %translations; my @origneedsbuild; my %origsubs; +my @slavelanguages; # orderer as in config po_slave_languages memoize("istranslatable"); memoize("_istranslation"); @@ -104,11 +105,11 @@ sub getsetup () { }, po_slave_languages => { type => "string", - example => { + example => [ 'fr' => 'Français', 'es' => 'Español', 'de' => 'Deutsch' - }, + ], description => "slave languages (PO files)", safe => 1, rebuild => 1, @@ -137,6 +138,21 @@ sub checkconfig () { $field, 'po')); } } + + if (ref $config{po_slave_languages} eq 'ARRAY') { + my %slaves; + for (my $i=0; $i<@{$config{po_slave_languages}}; $i = $i + 2) { + $slaves{$config{po_slave_languages}->[$i]} = $config{po_slave_languages}->[$i + 1]; + push @slavelanguages, $config{po_slave_languages}->[$i]; + } + $config{po_slave_languages} = \%slaves; + } + elsif (ref $config{po_slave_languages} eq 'HASH') { + @slavelanguages = sort { + $config{po_slave_languages}->{$a} cmp $config{po_slave_languages}->{$b}; + } keys %{$config{po_slave_languages}}; + } + delete $config{po_slave_languages}{$config{po_master_language}{code}};; map { @@ -197,7 +213,7 @@ sub needsbuild () { # make existing translations depend on the corresponding master page foreach my $master (keys %translations) { - map add_depends($_, $master), values %{otherlanguages($master)}; + map add_depends($_, $master), values %{otherlanguages_pages($master)}; } } @@ -229,7 +245,7 @@ sub scan (@) { # make sure any destpage's translations has # $page in its backlinks push @{$links{$page}}, - values %{otherlanguages($destpage)}; + values %{otherlanguages_pages($destpage)}; } } } @@ -295,7 +311,7 @@ sub pagetemplate (@) { } if ($template->query(name => "otherlanguages")) { $template->param(otherlanguages => [otherlanguagesloop($page)]); - map add_depends($page, $_), (values %{otherlanguages($page)}); + map add_depends($page, $_), (values %{otherlanguages_pages($page)}); } if ($config{discussion} && istranslation($page)) { if ($page !~ /.*\/\Q$config{discussionpage}\E$/i && @@ -348,12 +364,12 @@ sub renamepages (@) { return () unless istranslatable($torename{src}); my @ret; - my %otherpages=%{otherlanguages($torename{src})}; + my %otherpages=%{otherlanguages_pages($torename{src})}; while (my ($lang, $otherpage) = each %otherpages) { push @ret, { src => $otherpage, srcfile => $pagesources{$otherpage}, - dest => otherlanguage($torename{dest}, $lang), + dest => otherlanguage_page($torename{dest}, $lang), destfile => $torename{dest}.".".$lang.".po", required => 0, }; @@ -820,7 +836,7 @@ sub islanguagecode ($) { return $code =~ /^[a-z]{2}$/; } -sub otherlanguage ($$) { +sub otherlanguage_page ($$) { my $page=shift; my $code=shift; @@ -828,17 +844,31 @@ sub otherlanguage ($$) { return masterpage($page) . '.' . $code; } -sub otherlanguages ($) { +# Returns the list of other languages codes: the master language comes first, +# then the codes are ordered the same way as in po_slave_languages, if it is +# an array, or in the language name lexical order, if it is a hash. +sub otherlanguages_codes ($) { my $page=shift; - my %ret; - return \%ret unless istranslation($page) || istranslatable($page); + my @ret; + return \@ret unless istranslation($page) || istranslatable($page); my $curlang=lang($page); foreach my $lang - ($config{po_master_language}{code}, keys %{$config{po_slave_languages}}) { + ($config{po_master_language}{code}, @slavelanguages) { next if $lang eq $curlang; - $ret{$lang}=otherlanguage($page, $lang); + push @ret, $lang; } + return \@ret; +} + +sub otherlanguages_pages ($) { + my $page=shift; + + my %ret; + map { + $ret{$_} = otherlanguage_page($page, $_) + } otherlanguages_codes($page); + return \%ret; } @@ -989,30 +1019,25 @@ sub otherlanguagesloop ($) { my $page=shift; my @ret; - my %otherpages=%{otherlanguages($page)}; - while (my ($lang, $otherpage) = each %otherpages) { - if (istranslation($page) && masterpage($page) eq $otherpage) { - push @ret, { - url => urlto_with_orig_beautiful_urlpath($otherpage, $page), - code => $lang, - language => languagename($lang), - master => 1, - }; - } - elsif (istranslation($otherpage)) { - push @ret, { - url => urlto_with_orig_beautiful_urlpath($otherpage, $page), - code => $lang, - language => languagename($lang), - percent => percenttranslated($otherpage), - } + if (istranslation($page)) { + push @ret, { + url => urlto_with_orig_beautiful_urlpath(masterpage($page), $page), + code => $config{po_master_language}{code}, + language => $config{po_master_language}{name}, + master => 1, + }; + } + foreach my $lang (@{otherlanguages_codes($page)}) { + next if $lang eq $config{po_master_language}{code}; + my $otherpage = otherlanguage_page($page, $lang); + push @ret, { + url => urlto_with_orig_beautiful_urlpath($otherpage, $page), + code => $lang, + language => languagename($lang), + percent => percenttranslated($otherpage), } } - return sort { - return -1 if $a->{code} eq $config{po_master_language}{code}; - return 1 if $b->{code} eq $config{po_master_language}{code}; - return $a->{language} cmp $b->{language}; - } @ret; + return @ret; } sub homepageurl (;$) { diff --git a/doc/plugins/po.mdwn b/doc/plugins/po.mdwn index 585e14383..6b2a30786 100644 --- a/doc/plugins/po.mdwn +++ b/doc/plugins/po.mdwn @@ -54,10 +54,10 @@ Supported languages `po_slave_languages` is used to set the list of supported "slave" languages, such as: - po_slave_languages => { 'fr' => 'Français', + po_slave_languages => [ 'fr' => 'Français', 'es' => 'Español', 'de' => 'Deutsch', - } + ] Decide which pages are translatable ----------------------------------- @@ -254,15 +254,6 @@ once [[intrigeri]]'s `meta` branch is merged. An integration branch, called `meta-po`, merges [[intrigeri]]'s `po` and `meta` branches, and thus has this additional features. -Language display order ----------------------- - -Jonas pointed out that one might want to control the order that links to -other languages are listed, for various reasons. Currently, there is no -order, as `po_slave_languages` is a hash. It would need to be converted -to an array to support this. (If twere done, twere best done quickly.) ---[[Joey]] - Pagespecs --------- -- cgit v1.2.3 From 924f559e5049a63488a5f2baca610299a7e02957 Mon Sep 17 00:00:00 2001 From: intrigeri Date: Sat, 26 Jun 2010 00:59:20 +0200 Subject: typo fix. --- doc/plugins/po.mdwn | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'doc/plugins/po.mdwn') diff --git a/doc/plugins/po.mdwn b/doc/plugins/po.mdwn index 6b2a30786..dc0b638e2 100644 --- a/doc/plugins/po.mdwn +++ b/doc/plugins/po.mdwn @@ -130,7 +130,7 @@ lighttpd -------- Recent versions of lighttpd should be able to use -`$HTTP["language"]` to configure the translatted pages to be served. +`$HTTP["language"]` to configure the translated pages to be served. See [Lighttpd Issue](http://redmine.lighttpd.net/issues/show/1119) -- cgit v1.2.3 From 9b66a0cf0a5faf2da694b3cfb91eef6158167f4f Mon Sep 17 00:00:00 2001 From: intrigeri Date: Sat, 26 Jun 2010 00:57:58 +0200 Subject: done in my branch, please review. --- doc/plugins/po.mdwn | 3 +++ 1 file changed, 3 insertions(+) (limited to 'doc/plugins/po.mdwn') diff --git a/doc/plugins/po.mdwn b/doc/plugins/po.mdwn index 576d36ec1..9b492c781 100644 --- a/doc/plugins/po.mdwn +++ b/doc/plugins/po.mdwn @@ -263,6 +263,9 @@ order, as `po_slave_languages` is a hash. It would need to be converted to an array to support this. (If twere done, twere best done quickly.) --[[Joey]] +> Done in my po branch, preserving backward compatibility. Please +> review :) --[[intrigeri]] + Pagespecs --------- -- cgit v1.2.3 From e84287ec98f91e6622942f2bf0e7c5462c04b203 Mon Sep 17 00:00:00 2001 From: intrigeri Date: Sat, 26 Jun 2010 01:02:08 +0200 Subject: need more info to reproduce --- doc/plugins/po.mdwn | 3 +++ 1 file changed, 3 insertions(+) (limited to 'doc/plugins/po.mdwn') diff --git a/doc/plugins/po.mdwn b/doc/plugins/po.mdwn index 9b492c781..ab83c91bc 100644 --- a/doc/plugins/po.mdwn +++ b/doc/plugins/po.mdwn @@ -293,6 +293,9 @@ Also, this may only happen if the page being linked to is coming from an underlay, and the underlays lack translation to a given language. --[[Joey]] +> Any simple testcase to reproduce it, please? I've never seen this +> happen yet. --[[intrigeri]] + Double commits of po files -------------------------- -- cgit v1.2.3 From 9b171de6dbe13a35383edce6ee7e5365f2d61175 Mon Sep 17 00:00:00 2001 From: intrigeri Date: Sat, 26 Jun 2010 01:29:20 +0200 Subject: yet another bug on good way to be fixed --- doc/plugins/po.mdwn | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'doc/plugins/po.mdwn') diff --git a/doc/plugins/po.mdwn b/doc/plugins/po.mdwn index ab83c91bc..892830ee5 100644 --- a/doc/plugins/po.mdwn +++ b/doc/plugins/po.mdwn @@ -310,6 +310,10 @@ and then committed again. The second commit makes this change: Same thing happens when a change to an existing page triggers a po file update. --[[Joey]] +> * The s/utf-8/UTF-8 part is fixed in my po branch. +> * The ENCODING\n part is due to an inconsistency in po4a, which +> I've just send a patch for. --[[intrigeri]] + Ugly messages with empty files ------------------------------ -- cgit v1.2.3 From 7e3672945f7f95d8ea68734c1fa2dfa1dfd2af7f Mon Sep 17 00:00:00 2001 From: intrigeri Date: Sat, 26 Jun 2010 01:43:00 +0200 Subject: another po4a patch has been sent. --- doc/plugins/po.mdwn | 3 +++ 1 file changed, 3 insertions(+) (limited to 'doc/plugins/po.mdwn') diff --git a/doc/plugins/po.mdwn b/doc/plugins/po.mdwn index 892830ee5..dd85edf3d 100644 --- a/doc/plugins/po.mdwn +++ b/doc/plugins/po.mdwn @@ -319,6 +319,9 @@ Ugly messages with empty files If there are empty .mdwn files, the po plugin displays some ugly messages. +> This is due to a bug in po4a (not checking definedness of a +> variable). One-liner patch sent. --[[intrigeri]] + Translation of directives ------------------------- -- cgit v1.2.3 From 1b14a849fff50888e6a48d7299c23c7d5821572a Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Sun, 4 Jul 2010 14:27:57 -0400 Subject: example --- doc/plugins/po.mdwn | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'doc/plugins/po.mdwn') diff --git a/doc/plugins/po.mdwn b/doc/plugins/po.mdwn index dd85edf3d..2e16cc7c4 100644 --- a/doc/plugins/po.mdwn +++ b/doc/plugins/po.mdwn @@ -296,6 +296,12 @@ underlay, and the underlays lack translation to a given language. > Any simple testcase to reproduce it, please? I've never seen this > happen yet. --[[intrigeri]] +>> Sure, go here +>> (Currently 0% translateed) and see the 'WikiLink' link at the bottom, +>> which goes to +>> Compare with eg, the 100% translated Dansk version, where +>> the WikiLink link links to the English WikiLink page. --[[Joey]] + Double commits of po files -------------------------- -- cgit v1.2.3 From 8fe277c2ab42393b754fc65d966bf4ec242719ab Mon Sep 17 00:00:00 2001 From: intrigeri Date: Sat, 26 Jun 2010 00:59:20 +0200 Subject: typo fix. (cherry picked from commit 924f559e5049a63488a5f2baca610299a7e02957) --- doc/plugins/po.mdwn | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'doc/plugins/po.mdwn') diff --git a/doc/plugins/po.mdwn b/doc/plugins/po.mdwn index 2e16cc7c4..646d0cef3 100644 --- a/doc/plugins/po.mdwn +++ b/doc/plugins/po.mdwn @@ -130,7 +130,7 @@ lighttpd -------- Recent versions of lighttpd should be able to use -`$HTTP["language"]` to configure the translatted pages to be served. +`$HTTP["language"]` to configure the translated pages to be served. See [Lighttpd Issue](http://redmine.lighttpd.net/issues/show/1119) -- cgit v1.2.3 From cd03bd0b804cf4919a5d195c53bcea1f9730a51f Mon Sep 17 00:00:00 2001 From: intrigeri Date: Fri, 25 Jun 2010 23:18:34 +0200 Subject: po: added support for html pagetype ... after having audited the po4a Xml and Xhtml modules for security issues. Signed-off-by: intrigeri (cherry picked from commit a128c256a51392fcf752bf612d83a90e8c68027e) --- IkiWiki/Plugin/po.pm | 47 +++++++++++++++++++++++++++++++++--------- doc/plugins/po.mdwn | 10 ++++----- doc/plugins/po/discussion.mdwn | 17 +++++++++++++++ 3 files changed, 59 insertions(+), 15 deletions(-) (limited to 'doc/plugins/po.mdwn') diff --git a/IkiWiki/Plugin/po.pm b/IkiWiki/Plugin/po.pm index e85c9d760..4e6eff94f 100644 --- a/IkiWiki/Plugin/po.pm +++ b/IkiWiki/Plugin/po.pm @@ -848,8 +848,8 @@ sub refreshpot ($) { my $masterfile=shift; my $potfile=potfile($masterfile); - my %options = ("markdown" => (pagetype($masterfile) eq 'mdwn') ? 1 : 0); - my $doc=Locale::Po4a::Chooser::new('text',%options); + my $doc=Locale::Po4a::Chooser::new(po4a_type($masterfile), + po4a_options($masterfile)); $doc->{TT}{utf_mode} = 1; $doc->{TT}{file_in_charset} = 'UTF-8'; $doc->{TT}{file_out_charset} = 'UTF-8'; @@ -940,10 +940,8 @@ sub percenttranslated ($) { return gettext("N/A") unless istranslation($page); my $file=srcfile($pagesources{$page}); my $masterfile = srcfile($pagesources{masterpage($page)}); - my %options = ( - "markdown" => (pagetype($masterfile) eq 'mdwn') ? 1 : 0, - ); - my $doc=Locale::Po4a::Chooser::new('text',%options); + my $doc=Locale::Po4a::Chooser::new(po4a_type($masterfile), + po4a_options($masterfile)); $doc->process( 'po_in_name' => [ $file ], 'file_in_name' => [ $masterfile ], @@ -1094,10 +1092,8 @@ sub po_to_markup ($$) { or return $fail->(sprintf(gettext("failed to write %s"), $infile)); my $masterfile = srcfile($pagesources{masterpage($page)}); - my %options = ( - "markdown" => (pagetype($masterfile) eq 'mdwn') ? 1 : 0, - ); - my $doc=Locale::Po4a::Chooser::new('text',%options); + my $doc=Locale::Po4a::Chooser::new(po4a_type($masterfile), + po4a_options($masterfile)); $doc->process( 'po_in_name' => [ $infile ], 'file_in_name' => [ $masterfile ], @@ -1160,6 +1156,37 @@ sub isvalidpo ($) { "to previous page to continue edit")); } +sub po4a_type ($) { + my $file = shift; + + my $pagetype = pagetype($file); + if ($pagetype eq 'html') { + return 'xhtml'; + } + return 'text'; +} + +sub po4a_options($) { + my $file = shift; + + my %options; + my $pagetype = pagetype($file); + + if ($pagetype eq 'html') { + # how to disable options is not consistent across po4a modules + $options{includessi} = ''; + $options{includeexternal} = 0; + } + elsif ($pagetype eq 'mdwn') { + $options{markdown} = 1; + } + else { + $options{markdown} = 0; + } + + return %options; +} + # ,---- # | PageSpecs # `---- diff --git a/doc/plugins/po.mdwn b/doc/plugins/po.mdwn index 646d0cef3..fab6053b3 100644 --- a/doc/plugins/po.mdwn +++ b/doc/plugins/po.mdwn @@ -213,16 +213,16 @@ preferred `$EDITOR`, without needing to be online. Markup languages support ------------------------ -[[Markdown|mdwn]] is well supported. Some other markup languages supported -by ikiwiki mostly work, but some pieces of syntax are not rendered -correctly on the slave pages: +[[Markdown|mdwn]] and [[html]] are well supported. Some other markup +languages supported by ikiwiki mostly work, but some pieces of syntax +are not rendered correctly on the slave pages: * [[reStructuredText|rst]]: anonymous hyperlinks and internal cross-references * [[wikitext]]: conversion of newlines to paragraphs * [[creole]]: verbatim text is wrapped, tables are broken -* [[html]] and LaTeX: not supported yet; the dedicated po4a modules - could be used to support them, but they would need a security audit +* LaTeX: not supported yet; the dedicated po4a module + could be used to support it, but it would need a security audit * other markup languages have not been tested. Security diff --git a/doc/plugins/po/discussion.mdwn b/doc/plugins/po/discussion.mdwn index 27683f1ea..73858c818 100644 --- a/doc/plugins/po/discussion.mdwn +++ b/doc/plugins/po/discussion.mdwn @@ -150,6 +150,23 @@ The following analysis was done with his help. variables; according to [[Joey]], this is "Freaky code, but seems ok due to use of `quotementa`". +##### Locale::Po4a::Xhtml + +* does not run any external program +* does not build regexp's from untrusted variables + +=> Seems safe as far as the `includessi` option is disabled; the po +plugin explicitly disables it. + +Relies on Locale::Po4a::Xml` to do most of the work. + +##### Locale::Po4a::Xml + +* does not run any external program +* the `includeexternal` option makes it able to read external files; + the po plugin explicitly disables it +* untrusted variables are escaped when used to build regexp's + ##### Text::WrapI18N `Text::WrapI18N` can cause DoS -- cgit v1.2.3 From 472d3fba7db7184fee3c4122d8f628cd6436c6bc Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Sun, 4 Jul 2010 16:08:54 -0400 Subject: comment --- doc/plugins/po.mdwn | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'doc/plugins/po.mdwn') diff --git a/doc/plugins/po.mdwn b/doc/plugins/po.mdwn index fab6053b3..fe4d75748 100644 --- a/doc/plugins/po.mdwn +++ b/doc/plugins/po.mdwn @@ -266,6 +266,14 @@ to an array to support this. (If twere done, twere best done quickly.) > Done in my po branch, preserving backward compatibility. Please > review :) --[[intrigeri]] +>> Right, well my immediate concern is that using an array to hold +>> hash-like pairs is not very clear to the user. It will be displayed +>> in a confusing way by websetup; dumping a setup file will probably +>> also cause it to be formatted in a confusing way. And the code +>> seems to assume that the array length is even, and probably blows +>> up if it is not.. and the value is marked safe so websetup can be +>> used to modify it and break that way too. --[[Joey]] + Pagespecs --------- -- cgit v1.2.3 From 51ac511369e7dd0d22f8e5056f6292d64b68a903 Mon Sep 17 00:00:00 2001 From: intrigeri Date: Sun, 11 Jul 2010 12:52:22 +0200 Subject: reply, proposed a few possible solutions. --- doc/plugins/po.mdwn | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) (limited to 'doc/plugins/po.mdwn') diff --git a/doc/plugins/po.mdwn b/doc/plugins/po.mdwn index fe4d75748..2dc5ffdc8 100644 --- a/doc/plugins/po.mdwn +++ b/doc/plugins/po.mdwn @@ -274,6 +274,29 @@ to an array to support this. (If twere done, twere best done quickly.) >> up if it is not.. and the value is marked safe so websetup can be >> used to modify it and break that way too. --[[Joey]] +>>> I have added a sanity check for the even array problem. This was +>>> the easy part. +>>> +>>> About the hash-like vs. dump and websetup issue, +>>> I can think of a few solutions: +>>> +>>> - keep the current hash-like pairs and unmark this setting as safe +>>> for websetup: this does not solve the dump setup issue, though; +>>> - replace the array of pairs with an array of +>>> "LANGUAGECODE|LANGUAGENAME" elements, using a pipe or whatever +>>> separator seems adequate; +>>> - add support for ordered hashes to `$config`, websetup and +>>> dumpsetup, using Tie-IxHash or any similar module; +>>> - replace the array of hash-like pairs with an array of real +>>> pairs, such as `[ ['de', 'Deutsch'], ['fr', 'Français'] ]`; this +>>> brings once again the need for `$config` to support arrays of +>>> arrays, which I have already implemented in my mirrorlist branch +>>> (see [[todo/mirrorlist_with_per-mirror_usedirs_settings]] for +>>> details). +>>> +>>> Joey, which of these solutions do you prefer? Or another one? +>>> I tend to prefer the last one. --[[intrigeri]] + Pagespecs --------- -- cgit v1.2.3 From 4bcd6cc4ffffc2888b2907100ce1decc20e5fcde Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Sun, 18 Jul 2010 19:33:10 -0400 Subject: noticed a bug in the po plugin (I should probably put this in bugs/, but I am not sure if intregriti watches there..) --- doc/plugins/po.mdwn | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'doc/plugins/po.mdwn') diff --git a/doc/plugins/po.mdwn b/doc/plugins/po.mdwn index 2dc5ffdc8..4158d7547 100644 --- a/doc/plugins/po.mdwn +++ b/doc/plugins/po.mdwn @@ -351,6 +351,16 @@ update. --[[Joey]] > * The ENCODING\n part is due to an inconsistency in po4a, which > I've just send a patch for. --[[intrigeri]] +New pages not translatable +-------------------------- + +Today I added a new English page to l10n.ikiwiki.info. When I saved, +the page did not have the translation links at the top. I waited until +the po plugin had, in the background, created the po files, and refreshed; +still did not see the translation links. Only when I touched the page +source and refreshed did it finally add the translation links. +I can reproduce this bug in a test site. --[[Joey]] + Ugly messages with empty files ------------------------------ -- cgit v1.2.3 From 839fae0b2b85da690b5ec4bcb750fe071c58a53c Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Sun, 18 Jul 2010 19:42:06 -0400 Subject: response on po_slave_languages structure --- doc/plugins/po.mdwn | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'doc/plugins/po.mdwn') diff --git a/doc/plugins/po.mdwn b/doc/plugins/po.mdwn index babdc1886..d6f82912c 100644 --- a/doc/plugins/po.mdwn +++ b/doc/plugins/po.mdwn @@ -297,6 +297,10 @@ to an array to support this. (If twere done, twere best done quickly.) >>> Joey, which of these solutions do you prefer? Or another one? >>> I tend to prefer the last one. --[[intrigeri]] +>>>> I prefer the pipe separator, I think. I'm concerned that there is +>>>> no way to really sanely represent complex data structures in web +>>>> setup. --[[Joey]] + Pagespecs --------- -- cgit v1.2.3 From 35c9956df0cb92a1088d763a45e863079bfd8e50 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Sun, 18 Jul 2010 20:03:04 -0400 Subject: Revert "po_slave_languages can now be a hash, if order matters." This reverts commit 4cf185e781a5f94373b30ec9a0e10dfb626b6d86. That commit broke t/po.t (probably the test case only is testing too close the the old implementation and needs correcting). Also, we have not decided how to want to represent it yet, so I'm not ready for this change. Conflicts: IkiWiki/Plugin/po.pm doc/plugins/po.mdwn --- IkiWiki/Plugin/po.pm | 98 +++++++++++++++++++--------------------------------- doc/plugins/po.mdwn | 4 +-- 2 files changed, 37 insertions(+), 65 deletions(-) (limited to 'doc/plugins/po.mdwn') diff --git a/IkiWiki/Plugin/po.pm b/IkiWiki/Plugin/po.pm index dc73c73c3..224412676 100644 --- a/IkiWiki/Plugin/po.pm +++ b/IkiWiki/Plugin/po.pm @@ -28,7 +28,6 @@ use UNIVERSAL; my %translations; my @origneedsbuild; my %origsubs; -my @slavelanguages; # ordered as in config po_slave_languages memoize("istranslatable"); memoize("_istranslation"); @@ -105,11 +104,11 @@ sub getsetup () { }, po_slave_languages => { type => "string", - example => [ + example => { 'fr' => 'Français', 'es' => 'Español', 'de' => 'Deutsch' - ], + }, description => "slave languages (PO files)", safe => 1, rebuild => 1, @@ -138,24 +137,6 @@ sub checkconfig () { $field, 'po')); } } - - if (ref $config{po_slave_languages} eq 'ARRAY') { - my %slaves; - if (@{$config{po_slave_languages}} % 2 != 0) { - error(sprintf(gettext("The %s field is invalid."), 'po_slave_languages')); - } - for (my $i=0; $i<@{$config{po_slave_languages}}; $i = $i + 2) { - $slaves{$config{po_slave_languages}->[$i]} = $config{po_slave_languages}->[$i + 1]; - push @slavelanguages, $config{po_slave_languages}->[$i]; - } - $config{po_slave_languages} = \%slaves; - } - elsif (ref $config{po_slave_languages} eq 'HASH') { - @slavelanguages = sort { - $config{po_slave_languages}->{$a} cmp $config{po_slave_languages}->{$b}; - } keys %{$config{po_slave_languages}}; - } - delete $config{po_slave_languages}{$config{po_master_language}{code}};; map { @@ -216,7 +197,7 @@ sub needsbuild () { # make existing translations depend on the corresponding master page foreach my $master (keys %translations) { - map add_depends($_, $master), values %{otherlanguages_pages($master)}; + map add_depends($_, $master), values %{otherlanguages($master)}; } } @@ -248,7 +229,7 @@ sub scan (@) { # make sure any destpage's translations has # $page in its backlinks push @{$links{$page}}, - values %{otherlanguages_pages($destpage)}; + values %{otherlanguages($destpage)}; } } } @@ -306,7 +287,7 @@ sub pagetemplate (@) { } if ($template->query(name => "otherlanguages")) { $template->param(otherlanguages => [otherlanguagesloop($page)]); - map add_depends($page, $_), (values %{otherlanguages_pages($page)}); + map add_depends($page, $_), (values %{otherlanguages($page)}); } if ($config{discussion} && istranslation($page)) { if ($page !~ /.*\/\Q$config{discussionpage}\E$/i && @@ -359,12 +340,12 @@ sub renamepages (@) { return () unless istranslatable($torename{src}); my @ret; - my %otherpages=%{otherlanguages_pages($torename{src})}; + my %otherpages=%{otherlanguages($torename{src})}; while (my ($lang, $otherpage) = each %otherpages) { push @ret, { src => $otherpage, srcfile => $pagesources{$otherpage}, - dest => otherlanguage_page($torename{dest}, $lang), + dest => otherlanguage($torename{dest}, $lang), destfile => $torename{dest}.".".$lang.".po", required => 0, }; @@ -831,7 +812,7 @@ sub islanguagecode ($) { return $code =~ /^[a-z]{2}$/; } -sub otherlanguage_page ($$) { +sub otherlanguage ($$) { my $page=shift; my $code=shift; @@ -839,31 +820,17 @@ sub otherlanguage_page ($$) { return masterpage($page) . '.' . $code; } -# Returns the list of other languages codes: the master language comes first, -# then the codes are ordered the same way as in po_slave_languages, if it is -# an array, or in the language name lexical order, if it is a hash. -sub otherlanguages_codes ($) { +sub otherlanguages ($) { my $page=shift; - my @ret; - return \@ret unless istranslation($page) || istranslatable($page); + my %ret; + return \%ret unless istranslation($page) || istranslatable($page); my $curlang=lang($page); foreach my $lang - ($config{po_master_language}{code}, @slavelanguages) { + ($config{po_master_language}{code}, keys %{$config{po_slave_languages}}) { next if $lang eq $curlang; - push @ret, $lang; + $ret{$lang}=otherlanguage($page, $lang); } - return \@ret; -} - -sub otherlanguages_pages ($) { - my $page=shift; - - my %ret; - map { - $ret{$_} = otherlanguage_page($page, $_) - } @{otherlanguages_codes($page)}; - return \%ret; } @@ -1014,25 +981,30 @@ sub otherlanguagesloop ($) { my $page=shift; my @ret; - if (istranslation($page)) { - push @ret, { - url => urlto_with_orig_beautiful_urlpath(masterpage($page), $page), - code => $config{po_master_language}{code}, - language => $config{po_master_language}{name}, - master => 1, - }; - } - foreach my $lang (@{otherlanguages_codes($page)}) { - next if $lang eq $config{po_master_language}{code}; - my $otherpage = otherlanguage_page($page, $lang); - push @ret, { - url => urlto_with_orig_beautiful_urlpath($otherpage, $page), - code => $lang, - language => languagename($lang), - percent => percenttranslated($otherpage), + my %otherpages=%{otherlanguages($page)}; + while (my ($lang, $otherpage) = each %otherpages) { + if (istranslation($page) && masterpage($page) eq $otherpage) { + push @ret, { + url => urlto_with_orig_beautiful_urlpath($otherpage, $page), + code => $lang, + language => languagename($lang), + master => 1, + }; + } + elsif (istranslation($otherpage)) { + push @ret, { + url => urlto_with_orig_beautiful_urlpath($otherpage, $page), + code => $lang, + language => languagename($lang), + percent => percenttranslated($otherpage), + } } } - return @ret; + return sort { + return -1 if $a->{code} eq $config{po_master_language}{code}; + return 1 if $b->{code} eq $config{po_master_language}{code}; + return $a->{language} cmp $b->{language}; + } @ret; } sub homepageurl (;$) { diff --git a/doc/plugins/po.mdwn b/doc/plugins/po.mdwn index d6f82912c..53327c1da 100644 --- a/doc/plugins/po.mdwn +++ b/doc/plugins/po.mdwn @@ -54,10 +54,10 @@ Supported languages `po_slave_languages` is used to set the list of supported "slave" languages, such as: - po_slave_languages => [ 'fr' => 'Français', + po_slave_languages => { 'fr' => 'Français', 'es' => 'Español', 'de' => 'Deutsch', - ] + } Decide which pages are translatable ----------------------------------- -- cgit v1.2.3 From 862fc7c1ab1f7d709561bcb02fc8ede57b90a51b Mon Sep 17 00:00:00 2001 From: intrigeri Date: Tue, 20 Jul 2010 02:25:17 +0200 Subject: Support ordered po_slave_languages as discussed previously. Backward compatibility is still supported. --- IkiWiki/Plugin/po.pm | 105 +++++++++++++++++++++++++++++++++------------------ doc/plugins/po.mdwn | 8 ++-- 2 files changed, 72 insertions(+), 41 deletions(-) (limited to 'doc/plugins/po.mdwn') diff --git a/IkiWiki/Plugin/po.pm b/IkiWiki/Plugin/po.pm index 224412676..1f3ff252e 100644 --- a/IkiWiki/Plugin/po.pm +++ b/IkiWiki/Plugin/po.pm @@ -28,6 +28,7 @@ use UNIVERSAL; my %translations; my @origneedsbuild; my %origsubs; +my @slavelanguages; # languages codes ordered as in config po_slave_languages memoize("istranslatable"); memoize("_istranslation"); @@ -104,11 +105,11 @@ sub getsetup () { }, po_slave_languages => { type => "string", - example => { - 'fr' => 'Français', - 'es' => 'Español', - 'de' => 'Deutsch' - }, + example => [ + 'fr|Français', + 'es|Español', + 'de|Deutsch' + ], description => "slave languages (PO files)", safe => 1, rebuild => 1, @@ -137,6 +138,27 @@ sub checkconfig () { $field, 'po')); } } + + if (ref $config{po_slave_languages} eq 'ARRAY') { + my %slaves; + foreach my $pair (@{$config{po_slave_languages}}) { + my ($code, $name) = ( $pair =~ /^([a-z]{2})\|(.+)$/ ); + if (!defined $code || !defined $name) { + error(sprintf(gettext("%s has invalid syntax: must use CODE|NAME"), + $pair)); + } + $slaves{$code} = $name; + push @slavelanguages, $code; + + } + $config{po_slave_languages} = \%slaves; + } + elsif (ref $config{po_slave_languages} eq 'HASH') { + @slavelanguages = sort { + $config{po_slave_languages}->{$a} cmp $config{po_slave_languages}->{$b}; + } keys %{$config{po_slave_languages}}; + } + delete $config{po_slave_languages}{$config{po_master_language}{code}};; map { @@ -197,7 +219,7 @@ sub needsbuild () { # make existing translations depend on the corresponding master page foreach my $master (keys %translations) { - map add_depends($_, $master), values %{otherlanguages($master)}; + map add_depends($_, $master), values %{otherlanguages_pages($master)}; } } @@ -229,7 +251,7 @@ sub scan (@) { # make sure any destpage's translations has # $page in its backlinks push @{$links{$page}}, - values %{otherlanguages($destpage)}; + values %{otherlanguages_pages($destpage)}; } } } @@ -287,7 +309,7 @@ sub pagetemplate (@) { } if ($template->query(name => "otherlanguages")) { $template->param(otherlanguages => [otherlanguagesloop($page)]); - map add_depends($page, $_), (values %{otherlanguages($page)}); + map add_depends($page, $_), (values %{otherlanguages_pages($page)}); } if ($config{discussion} && istranslation($page)) { if ($page !~ /.*\/\Q$config{discussionpage}\E$/i && @@ -340,12 +362,12 @@ sub renamepages (@) { return () unless istranslatable($torename{src}); my @ret; - my %otherpages=%{otherlanguages($torename{src})}; + my %otherpages=%{otherlanguages_pages($torename{src})}; while (my ($lang, $otherpage) = each %otherpages) { push @ret, { src => $otherpage, srcfile => $pagesources{$otherpage}, - dest => otherlanguage($torename{dest}, $lang), + dest => otherlanguage_page($torename{dest}, $lang), destfile => $torename{dest}.".".$lang.".po", required => 0, }; @@ -812,7 +834,7 @@ sub islanguagecode ($) { return $code =~ /^[a-z]{2}$/; } -sub otherlanguage ($$) { +sub otherlanguage_page ($$) { my $page=shift; my $code=shift; @@ -820,17 +842,31 @@ sub otherlanguage ($$) { return masterpage($page) . '.' . $code; } -sub otherlanguages ($) { +# Returns the list of other languages codes: the master language comes first, +# then the codes are ordered the same way as in po_slave_languages, if it is +# an array, or in the language name lexical order, if it is a hash. +sub otherlanguages_codes ($) { my $page=shift; - my %ret; - return \%ret unless istranslation($page) || istranslatable($page); + my @ret; + return \@ret unless istranslation($page) || istranslatable($page); my $curlang=lang($page); foreach my $lang ($config{po_master_language}{code}, keys %{$config{po_slave_languages}}) { next if $lang eq $curlang; - $ret{$lang}=otherlanguage($page, $lang); + push @ret, $lang; } + return \@ret; +} + +sub otherlanguages_pages ($) { + my $page=shift; + + my %ret; + map { + $ret{$_} = otherlanguage_page($page, $_) + } @{otherlanguages_codes($page)}; + return \%ret; } @@ -981,30 +1017,25 @@ sub otherlanguagesloop ($) { my $page=shift; my @ret; - my %otherpages=%{otherlanguages($page)}; - while (my ($lang, $otherpage) = each %otherpages) { - if (istranslation($page) && masterpage($page) eq $otherpage) { - push @ret, { - url => urlto_with_orig_beautiful_urlpath($otherpage, $page), - code => $lang, - language => languagename($lang), - master => 1, - }; - } - elsif (istranslation($otherpage)) { - push @ret, { - url => urlto_with_orig_beautiful_urlpath($otherpage, $page), - code => $lang, - language => languagename($lang), - percent => percenttranslated($otherpage), - } + if (istranslation($page)) { + push @ret, { + url => urlto_with_orig_beautiful_urlpath(masterpage($page), $page), + code => $config{po_master_language}{code}, + language => $config{po_master_language}{name}, + master => 1, + }; + } + foreach my $lang (@{otherlanguages_codes($page)}) { + next if $lang eq $config{po_master_language}{code}; + my $otherpage = otherlanguage_page($page, $lang); + push @ret, { + url => urlto_with_orig_beautiful_urlpath($otherpage, $page), + code => $lang, + language => languagename($lang), + percent => percenttranslated($otherpage), } } - return sort { - return -1 if $a->{code} eq $config{po_master_language}{code}; - return 1 if $b->{code} eq $config{po_master_language}{code}; - return $a->{language} cmp $b->{language}; - } @ret; + return @ret; } sub homepageurl (;$) { diff --git a/doc/plugins/po.mdwn b/doc/plugins/po.mdwn index 53327c1da..c36414c8e 100644 --- a/doc/plugins/po.mdwn +++ b/doc/plugins/po.mdwn @@ -54,10 +54,10 @@ Supported languages `po_slave_languages` is used to set the list of supported "slave" languages, such as: - po_slave_languages => { 'fr' => 'Français', - 'es' => 'Español', - 'de' => 'Deutsch', - } + po_slave_languages => [ 'fr|Français', + 'es|Español', + 'de|Deutsch', + ] Decide which pages are translatable ----------------------------------- -- cgit v1.2.3 From 8ee3297b50e270523d9372be2eea61bd253e6e4d Mon Sep 17 00:00:00 2001 From: intrigeri Date: Tue, 20 Jul 2010 01:49:48 +0200 Subject: todo update --- doc/plugins/po.mdwn | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'doc/plugins/po.mdwn') diff --git a/doc/plugins/po.mdwn b/doc/plugins/po.mdwn index 53327c1da..e3feb8843 100644 --- a/doc/plugins/po.mdwn +++ b/doc/plugins/po.mdwn @@ -351,7 +351,7 @@ and then committed again. The second commit makes this change: Same thing happens when a change to an existing page triggers a po file update. --[[Joey]] -> * The s/utf-8/UTF-8 part is fixed in my po branch. +> * The s/utf-8/UTF-8 part has been fixed. > * The ENCODING\n part is due to an inconsistency in po4a, which > I've just send a patch for. --[[intrigeri]] -- cgit v1.2.3 From 081b43a8aec8c49fca0ffa4e4b72d41869050e89 Mon Sep 17 00:00:00 2001 From: intrigeri Date: Tue, 20 Jul 2010 13:48:37 +0200 Subject: Implemented, please merge. --- doc/plugins/po.mdwn | 3 +++ 1 file changed, 3 insertions(+) (limited to 'doc/plugins/po.mdwn') diff --git a/doc/plugins/po.mdwn b/doc/plugins/po.mdwn index e3feb8843..fc7d1d502 100644 --- a/doc/plugins/po.mdwn +++ b/doc/plugins/po.mdwn @@ -301,6 +301,9 @@ to an array to support this. (If twere done, twere best done quickly.) >>>> no way to really sanely represent complex data structures in web >>>> setup. --[[Joey]] +>>>>> Implemented using the pipe separator, fixed the po.t test suite +>>>>> accordingly. Please have a look. --[[intrigeri]] + Pagespecs --------- -- cgit v1.2.3 From d2f56f7dea7252ce8c11b6c58049ecce515f155c Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Fri, 23 Jul 2010 14:29:17 -0400 Subject: merged; notes --- debian/changelog | 2 ++ doc/plugins/po.mdwn | 4 ++++ 2 files changed, 6 insertions(+) (limited to 'doc/plugins/po.mdwn') diff --git a/debian/changelog b/debian/changelog index c27af5615..0f6a7c810 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,6 +1,8 @@ ikiwiki (3.20100723) UNRELEASED; urgency=low * template: Fix dependency tracking. Broken in version 3.20100427. + * po: The po_slave_languages setting is now a list, so the order of + translated languages can be controlled. (intrigeri) -- Joey Hess Fri, 23 Jul 2010 14:00:32 -0400 diff --git a/doc/plugins/po.mdwn b/doc/plugins/po.mdwn index ddaba86f0..d70247295 100644 --- a/doc/plugins/po.mdwn +++ b/doc/plugins/po.mdwn @@ -304,6 +304,10 @@ to an array to support this. (If twere done, twere best done quickly.) >>>>> Implemented using the pipe separator, fixed the po.t test suite >>>>> accordingly. Please have a look. --[[intrigeri]] +>>>>>> Merged. I wonder if "ll: Lang" would be better than pipe? +>>>>>> Also, the compatability code for HASH is not really needed, +>>>>>> ikiwiki has not been released using a hash for it. --[[Joey]] + Pagespecs --------- -- cgit v1.2.3 From 11bd781a9dc8c04a005a04a99845ec339079b610 Mon Sep 17 00:00:00 2001 From: intrigeri Date: Sat, 24 Jul 2010 11:18:57 +0200 Subject: answering joey --- doc/plugins/po.mdwn | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'doc/plugins/po.mdwn') diff --git a/doc/plugins/po.mdwn b/doc/plugins/po.mdwn index d70247295..9426ec9c5 100644 --- a/doc/plugins/po.mdwn +++ b/doc/plugins/po.mdwn @@ -305,9 +305,21 @@ to an array to support this. (If twere done, twere best done quickly.) >>>>> accordingly. Please have a look. --[[intrigeri]] >>>>>> Merged. I wonder if "ll: Lang" would be better than pipe? + +>>>>>>> I've no clear opinion on this one. --[[intrigeri]] + >>>>>> Also, the compatability code for HASH is not really needed, >>>>>> ikiwiki has not been released using a hash for it. --[[Joey]] +>>>>>>> The compatibility code is there to support the +>>>>>>> `po_slave_languages => {fr => 'Français'}` format that has +>>>>>>> been supported for ages. It's not there to support the +>>>>>>> intermediate array of hash-like pairs I proposed in the +>>>>>>> meantime. +>>>>>>> +>>>>>>> By the way, could you please have a look to the rest of my po +>>>>>>> branch? (bb22e8c4a..d98296d1db0) --[[intrigeri]] + Pagespecs --------- -- cgit v1.2.3 From cab8a795682bcac2e937461d9a7d2c683cdc5ed0 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Sat, 24 Jul 2010 05:23:52 -0400 Subject: response --- doc/plugins/po.mdwn | 3 +++ 1 file changed, 3 insertions(+) (limited to 'doc/plugins/po.mdwn') diff --git a/doc/plugins/po.mdwn b/doc/plugins/po.mdwn index 9426ec9c5..5088677c1 100644 --- a/doc/plugins/po.mdwn +++ b/doc/plugins/po.mdwn @@ -320,6 +320,9 @@ to an array to support this. (If twere done, twere best done quickly.) >>>>>>> By the way, could you please have a look to the rest of my po >>>>>>> branch? (bb22e8c4a..d98296d1db0) --[[intrigeri]] +>>>>>>>> Thought I'd already merged everything; I've got those in now. +>>>>>>>> --[[Joey]] + Pagespecs --------- -- cgit v1.2.3 From 1a3e6bf3e2eff84e6456b76a07568429473c4184 Mon Sep 17 00:00:00 2001 From: intrigeri Date: Wed, 28 Jul 2010 19:08:47 +0200 Subject: po todo update: this has been fixed already. --- doc/plugins/po.mdwn | 69 ----------------------------------------------------- 1 file changed, 69 deletions(-) (limited to 'doc/plugins/po.mdwn') diff --git a/doc/plugins/po.mdwn b/doc/plugins/po.mdwn index 5088677c1..88c41aa76 100644 --- a/doc/plugins/po.mdwn +++ b/doc/plugins/po.mdwn @@ -254,75 +254,6 @@ once [[intrigeri]]'s `meta` branch is merged. An integration branch, called `meta-po`, merges [[intrigeri]]'s `po` and `meta` branches, and thus has this additional features. -Language display order ----------------------- - -Jonas pointed out that one might want to control the order that links to -other languages are listed, for various reasons. Currently, there is no -order, as `po_slave_languages` is a hash. It would need to be converted -to an array to support this. (If twere done, twere best done quickly.) ---[[Joey]] - -> Done in my po branch, preserving backward compatibility. Please -> review :) --[[intrigeri]] - ->> Right, well my immediate concern is that using an array to hold ->> hash-like pairs is not very clear to the user. It will be displayed ->> in a confusing way by websetup; dumping a setup file will probably ->> also cause it to be formatted in a confusing way. And the code ->> seems to assume that the array length is even, and probably blows ->> up if it is not.. and the value is marked safe so websetup can be ->> used to modify it and break that way too. --[[Joey]] - ->>> I have added a sanity check for the even array problem. This was ->>> the easy part. ->>> ->>> About the hash-like vs. dump and websetup issue, ->>> I can think of a few solutions: ->>> ->>> - keep the current hash-like pairs and unmark this setting as safe ->>> for websetup: this does not solve the dump setup issue, though; ->>> - replace the array of pairs with an array of ->>> "LANGUAGECODE|LANGUAGENAME" elements, using a pipe or whatever ->>> separator seems adequate; ->>> - add support for ordered hashes to `$config`, websetup and ->>> dumpsetup, using Tie-IxHash or any similar module; ->>> - replace the array of hash-like pairs with an array of real ->>> pairs, such as `[ ['de', 'Deutsch'], ['fr', 'Français'] ]`; this ->>> brings once again the need for `$config` to support arrays of ->>> arrays, which I have already implemented in my mirrorlist branch ->>> (see [[todo/mirrorlist_with_per-mirror_usedirs_settings]] for ->>> details). ->>> ->>> Joey, which of these solutions do you prefer? Or another one? ->>> I tend to prefer the last one. --[[intrigeri]] - ->>>> I prefer the pipe separator, I think. I'm concerned that there is ->>>> no way to really sanely represent complex data structures in web ->>>> setup. --[[Joey]] - ->>>>> Implemented using the pipe separator, fixed the po.t test suite ->>>>> accordingly. Please have a look. --[[intrigeri]] - ->>>>>> Merged. I wonder if "ll: Lang" would be better than pipe? - ->>>>>>> I've no clear opinion on this one. --[[intrigeri]] - ->>>>>> Also, the compatability code for HASH is not really needed, ->>>>>> ikiwiki has not been released using a hash for it. --[[Joey]] - ->>>>>>> The compatibility code is there to support the ->>>>>>> `po_slave_languages => {fr => 'Français'}` format that has ->>>>>>> been supported for ages. It's not there to support the ->>>>>>> intermediate array of hash-like pairs I proposed in the ->>>>>>> meantime. ->>>>>>> ->>>>>>> By the way, could you please have a look to the rest of my po ->>>>>>> branch? (bb22e8c4a..d98296d1db0) --[[intrigeri]] - ->>>>>>>> Thought I'd already merged everything; I've got those in now. ->>>>>>>> --[[Joey]] - Pagespecs --------- -- cgit v1.2.3 From 6d9026bf28f2850c15566ba0c8b9ee1a88151641 Mon Sep 17 00:00:00 2001 From: intrigeri Date: Wed, 28 Jul 2010 19:13:57 +0200 Subject: reply --- doc/plugins/po.mdwn | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'doc/plugins/po.mdwn') diff --git a/doc/plugins/po.mdwn b/doc/plugins/po.mdwn index 88c41aa76..5f713044f 100644 --- a/doc/plugins/po.mdwn +++ b/doc/plugins/po.mdwn @@ -264,6 +264,11 @@ and seems generally not wanted. (OTOH, you do want to match translated pages by default when locking pages.) --[[Joey]] +> Seems hard to me to sort apart the pagespec whose matching pages +> 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]] + Edit links on untranslated pages -------------------------------- -- cgit v1.2.3 From d1733089d05f4de0eee13e204236af8ed74632da Mon Sep 17 00:00:00 2001 From: intrigeri Date: Wed, 28 Jul 2010 19:23:24 +0200 Subject: currently unreproducible --- doc/plugins/po.mdwn | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'doc/plugins/po.mdwn') diff --git a/doc/plugins/po.mdwn b/doc/plugins/po.mdwn index 5f713044f..484516364 100644 --- a/doc/plugins/po.mdwn +++ b/doc/plugins/po.mdwn @@ -323,6 +323,10 @@ still did not see the translation links. Only when I touched the page source and refreshed did it finally add the translation links. I can reproduce this bug in a test site. --[[Joey]] +> I could reproduce this bug at some point during the merge of a buggy +> version of my ordered slave languages patch, but I cannot anymore. +> Could you please try again? --[[intrigeri]] + Ugly messages with empty files ------------------------------ -- cgit v1.2.3 From 0ceac714d54fb3ce77595dc263a75dc89f1c2133 Mon Sep 17 00:00:00 2001 From: intrigeri Date: Wed, 28 Jul 2010 19:48:40 +0200 Subject: researched a bit the next po bug --- doc/plugins/po.mdwn | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) (limited to 'doc/plugins/po.mdwn') diff --git a/doc/plugins/po.mdwn b/doc/plugins/po.mdwn index 484516364..27d95ae29 100644 --- a/doc/plugins/po.mdwn +++ b/doc/plugins/po.mdwn @@ -269,8 +269,8 @@ default when locking pages.) --[[Joey]] > language, and the ones that should not. The only solution I can see > to this surprising behaviour is: documentation. --[[intrigeri]] -Edit links on untranslated pages --------------------------------- +Edit links on some slave pages +------------------------------ If a page is not translated yet, the "translated" version of it displays wikilinks to other, existing (but not yet translated?) @@ -295,6 +295,20 @@ underlay, and the underlays lack translation to a given language. >> Compare with eg, the 100% translated Dansk version, where >> the WikiLink link links to the English WikiLink page. --[[Joey]] +>>> Seems not related to the page/string translation status: the 0% +>>> translated Spanish version has the correct link, just like the +>>> Dansk version => I'm changing the bug title accordingly. +>>> +>>> I tested forcing the sv html page to be rebuilt by translating a +>>> string in it, it did not fix the bug. I did the same for the +>>> Spanish page, it did not introduce the bug. So this is really +>>> weird. +>>> +>>> The smiley underlay seems to be the only place where the wrong +>>> thing happens: the basewiki underlay has similar examples +>>> that do not exhibit this bug. An underlay linking to another might +>>> be necessary to reproduce it. Going to dig deeper. --[[intrigeri]] + Double commits of po files -------------------------- -- cgit v1.2.3 From ccf80cfa8a012325c375295630898267a5d28d64 Mon Sep 17 00:00:00 2001 From: intrigeri Date: Wed, 28 Jul 2010 20:07:44 +0200 Subject: todo++ (?) --- doc/plugins/po.mdwn | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'doc/plugins/po.mdwn') diff --git a/doc/plugins/po.mdwn b/doc/plugins/po.mdwn index 27d95ae29..6377a11be 100644 --- a/doc/plugins/po.mdwn +++ b/doc/plugins/po.mdwn @@ -349,6 +349,12 @@ If there are empty .mdwn files, the po plugin displays some ugly messages. > This is due to a bug in po4a (not checking definedness of a > variable). One-liner patch sent. --[[intrigeri]] +Remove po/pot files when disabling the po plugin? +------------------------------------------------- + +ikiwiki now has a `disable` hook. Should the po plugin remove the po +files from the source repository when it has been disabled? + Translation of directives ------------------------- -- cgit v1.2.3 From 927558ee444a12774c579bc6acf76f8e040c5229 Mon Sep 17 00:00:00 2001 From: intrigeri Date: Thu, 29 Jul 2010 16:18:59 +0200 Subject: found the root cause of the "bug" --- doc/plugins/po.mdwn | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) (limited to 'doc/plugins/po.mdwn') diff --git a/doc/plugins/po.mdwn b/doc/plugins/po.mdwn index 6377a11be..ab096b2ac 100644 --- a/doc/plugins/po.mdwn +++ b/doc/plugins/po.mdwn @@ -269,8 +269,8 @@ default when locking pages.) --[[Joey]] > language, and the ones that should not. The only solution I can see > to this surprising behaviour is: documentation. --[[intrigeri]] -Edit links on some slave pages ------------------------------- +l10n wiki misconfiguration +-------------------------- If a page is not translated yet, the "translated" version of it displays wikilinks to other, existing (but not yet translated?) @@ -309,6 +309,22 @@ underlay, and the underlays lack translation to a given language. >>> that do not exhibit this bug. An underlay linking to another might >>> be necessary to reproduce it. Going to dig deeper. --[[intrigeri]] +>>>> After a few hours lost in the Perl debugger, I think I have found +>>>> the root cause of the problem: in l10n wiki's configured +>>>> `underlaydir`, the basewiki is present in every slave language +>>>> that is enabled for this wiki *but* Swedish. With such a +>>>> configuration, the `ikiwiki/wikilink` page indeed does not exist +>>>> in Swedish language: no `ikiwiki/wikilink.sv.po` can be found +>>>> where ikiwiki is looking. Have a look to +>>>> , the basewiki is not +>>>> available in Swedish language on this wiki. So this is not a po +>>>> bug, but a configuration or directories layout issue. This is +>>>> solved by adding the Swedish basewiki to the underlay dir, which +>>>> is I guess not a possibility in the l10n wiki context. I guess +>>>> this could be solved by adding `SRCDIR/basewiki` as an underlay +>>>> to your l10n wiki configuration, possibly using the +>>>> `add_underlays` configuration directive. --[[intrigeri]] + Double commits of po files -------------------------- -- cgit v1.2.3 From 6c4caf8211d09c144a0e22321e5bf8c0d3cd4cc1 Mon Sep 17 00:00:00 2001 From: intrigeri Date: Thu, 29 Jul 2010 16:32:56 +0200 Subject: Move po todo/bugs to dedicated pages. --- doc/bugs/po:_double_commits_of_po_files.mdwn | 14 +++ doc/bugs/po:_new_pages_not_translatable.mdwn | 10 ++ doc/bugs/po:_ugly_messages_with_empty_files.mdwn | 4 + doc/plugins/po.mdwn | 101 ++------------------- doc/todo/po:_better_documentation.mdwn | 3 + doc/todo/po:_better_links.mdwn | 12 +++ .../po:_remove_po_files_when_disabling_plugin.mdwn | 2 + doc/todo/po:_rethink_pagespecs.mdwn | 11 +++ doc/todo/po:_translation_of_directives.mdwn | 8 ++ 9 files changed, 72 insertions(+), 93 deletions(-) create mode 100644 doc/bugs/po:_double_commits_of_po_files.mdwn create mode 100644 doc/bugs/po:_new_pages_not_translatable.mdwn create mode 100644 doc/bugs/po:_ugly_messages_with_empty_files.mdwn create mode 100644 doc/todo/po:_better_documentation.mdwn create mode 100644 doc/todo/po:_better_links.mdwn create mode 100644 doc/todo/po:_remove_po_files_when_disabling_plugin.mdwn create mode 100644 doc/todo/po:_rethink_pagespecs.mdwn create mode 100644 doc/todo/po:_translation_of_directives.mdwn (limited to 'doc/plugins/po.mdwn') diff --git a/doc/bugs/po:_double_commits_of_po_files.mdwn b/doc/bugs/po:_double_commits_of_po_files.mdwn new file mode 100644 index 000000000..008df68c3 --- /dev/null +++ b/doc/bugs/po:_double_commits_of_po_files.mdwn @@ -0,0 +1,14 @@ +When adding a new english page, the po files are created, committed, +and then committed again. The second commit makes this change: + + -"Content-Type: text/plain; charset=utf-8\n" + -"Content-Transfer-Encoding: ENCODING" + +"Content-Type: text/plain; charset=UTF-8\n" + +"Content-Transfer-Encoding: ENCODING\n" + +Same thing happens when a change to an existing page triggers a po file +update. --[[Joey]] + +> * The s/utf-8/UTF-8 part has been fixed. +> * The ENCODING\n part is due to an inconsistency in po4a, which +> I've just send a patch for. --[[intrigeri]] diff --git a/doc/bugs/po:_new_pages_not_translatable.mdwn b/doc/bugs/po:_new_pages_not_translatable.mdwn new file mode 100644 index 000000000..84156bacc --- /dev/null +++ b/doc/bugs/po:_new_pages_not_translatable.mdwn @@ -0,0 +1,10 @@ +Today I added a new English page to l10n.ikiwiki.info. When I saved, +the page did not have the translation links at the top. I waited until +the po plugin had, in the background, created the po files, and refreshed; +still did not see the translation links. Only when I touched the page +source and refreshed did it finally add the translation links. +I can reproduce this bug in a test site. --[[Joey]] + +> I could reproduce this bug at some point during the merge of a buggy +> version of my ordered slave languages patch, but I cannot anymore. +> Could you please try again? --[[intrigeri]] diff --git a/doc/bugs/po:_ugly_messages_with_empty_files.mdwn b/doc/bugs/po:_ugly_messages_with_empty_files.mdwn new file mode 100644 index 000000000..4e782605b --- /dev/null +++ b/doc/bugs/po:_ugly_messages_with_empty_files.mdwn @@ -0,0 +1,4 @@ +If there are empty .mdwn files, the po plugin displays some ugly messages. + +> This is due to a bug in po4a (not checking definedness of a +> variable). One-liner patch sent. --[[intrigeri]] diff --git a/doc/plugins/po.mdwn b/doc/plugins/po.mdwn index ab096b2ac..1a3917454 100644 --- a/doc/plugins/po.mdwn +++ b/doc/plugins/po.mdwn @@ -235,39 +235,19 @@ When using po4a older than 0.35, it is recommended to uninstall `Text::WrapI18N` (Debian package `libtext-wrapi18n-perl`), in order to avoid a potential denial of service. -TODO +BUGS ==== -Better links ------------- - -Once the fix to -[[bugs/pagetitle_function_does_not_respect_meta_titles]] from -[[intrigeri]]'s `meta` branch is merged into ikiwiki upstream, the -generated links' text will be optionally based on the page titles set -with the [[meta|plugins/meta]] plugin, and will thus be translatable. -It will also allow displaying the translation status in links to slave -pages. Both were implemented, and reverted in commit -ea753782b222bf4ba2fb4683b6363afdd9055b64, which should be reverted -once [[intrigeri]]'s `meta` branch is merged. +[[!map pages="bugs/po:*"]] -An integration branch, called `meta-po`, merges [[intrigeri]]'s `po` -and `meta` branches, and thus has this additional features. - -Pagespecs ---------- +[[!inline pages="bugs/po:* and !bugs/done and !link(bugs/done) and !bugs/*/*" +feeds=no actions=no archive=yes show=0]] -I was suprised that, when using the map directive, a pagespec of "*" -listed all the translated pages as well as regular pages. That can -make a big difference to an existing wiki when po is turned on, -and seems generally not wanted. -(OTOH, you do want to match translated pages by -default when locking pages.) --[[Joey]] +TODO +==== -> Seems hard to me to sort apart the pagespec whose matching pages -> 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]] +[[!inline pages="todo/po:* and !todo/done and !link(todo/done) and !todo/*/*" +feeds=no actions=no archive=yes show=0]] l10n wiki misconfiguration -------------------------- @@ -324,68 +304,3 @@ underlay, and the underlays lack translation to a given language. >>>> this could be solved by adding `SRCDIR/basewiki` as an underlay >>>> to your l10n wiki configuration, possibly using the >>>> `add_underlays` configuration directive. --[[intrigeri]] - -Double commits of po files --------------------------- - -When adding a new english page, the po files are created, committed, -and then committed again. The second commit makes this change: - - -"Content-Type: text/plain; charset=utf-8\n" - -"Content-Transfer-Encoding: ENCODING" - +"Content-Type: text/plain; charset=UTF-8\n" - +"Content-Transfer-Encoding: ENCODING\n" - -Same thing happens when a change to an existing page triggers a po file -update. --[[Joey]] - -> * The s/utf-8/UTF-8 part has been fixed. -> * The ENCODING\n part is due to an inconsistency in po4a, which -> I've just send a patch for. --[[intrigeri]] - -New pages not translatable --------------------------- - -Today I added a new English page to l10n.ikiwiki.info. When I saved, -the page did not have the translation links at the top. I waited until -the po plugin had, in the background, created the po files, and refreshed; -still did not see the translation links. Only when I touched the page -source and refreshed did it finally add the translation links. -I can reproduce this bug in a test site. --[[Joey]] - -> I could reproduce this bug at some point during the merge of a buggy -> version of my ordered slave languages patch, but I cannot anymore. -> Could you please try again? --[[intrigeri]] - -Ugly messages with empty files ------------------------------- - -If there are empty .mdwn files, the po plugin displays some ugly messages. - -> This is due to a bug in po4a (not checking definedness of a -> variable). One-liner patch sent. --[[intrigeri]] - -Remove po/pot files when disabling the po plugin? -------------------------------------------------- - -ikiwiki now has a `disable` hook. Should the po plugin remove the po -files from the source repository when it has been disabled? - -Translation of directives -------------------------- - -If a translated page contains a directive, it may expand to some english -text, or text in whatever single language ikiwiki is configured to "speak". - -Maybe there could be a way to switch ikiwiki to speaking another language -when building a non-english page? Then the directives would get translated. - -(We also will need this in order to use translated templates, when they are -available.) - -Documentation -------------- - -Maybe write separate documentation depending on the people it targets: -translators, wiki administrators, hackers. This plugin may be complex -enough to deserve this. diff --git a/doc/todo/po:_better_documentation.mdwn b/doc/todo/po:_better_documentation.mdwn new file mode 100644 index 000000000..6e9804df4 --- /dev/null +++ b/doc/todo/po:_better_documentation.mdwn @@ -0,0 +1,3 @@ +Maybe write separate documentation for the po plugin, depending on the +people it targets: translators, wiki administrators, hackers. This +plugin may be complex enough to deserve this. diff --git a/doc/todo/po:_better_links.mdwn b/doc/todo/po:_better_links.mdwn new file mode 100644 index 000000000..af879a56a --- /dev/null +++ b/doc/todo/po:_better_links.mdwn @@ -0,0 +1,12 @@ +Once the fix to +[[bugs/pagetitle_function_does_not_respect_meta_titles]] from +[[intrigeri]]'s `meta` branch is merged into ikiwiki upstream, the +generated links' text will be optionally based on the page titles set +with the [[meta|plugins/meta]] plugin, and will thus be translatable. +It will also allow displaying the translation status in links to slave +pages. Both were implemented, and reverted in commit +ea753782b222bf4ba2fb4683b6363afdd9055b64, which should be reverted +once [[intrigeri]]'s `meta` branch is merged. + +An integration branch, called `meta-po`, merges [[intrigeri]]'s `po` +and `meta` branches, and thus has this additional features. diff --git a/doc/todo/po:_remove_po_files_when_disabling_plugin.mdwn b/doc/todo/po:_remove_po_files_when_disabling_plugin.mdwn new file mode 100644 index 000000000..4ddd0fa1e --- /dev/null +++ b/doc/todo/po:_remove_po_files_when_disabling_plugin.mdwn @@ -0,0 +1,2 @@ +ikiwiki now has a `disable` hook. Should the po plugin remove the po +files from the source repository when it has been disabled? diff --git a/doc/todo/po:_rethink_pagespecs.mdwn b/doc/todo/po:_rethink_pagespecs.mdwn new file mode 100644 index 000000000..50c10c5db --- /dev/null +++ b/doc/todo/po:_rethink_pagespecs.mdwn @@ -0,0 +1,11 @@ +I was suprised that, when using the map directive, a pagespec of "*" +listed all the translated pages as well as regular pages. That can +make a big difference to an existing wiki when po is turned on, +and seems generally not wanted. +(OTOH, you do want to match translated pages by +default when locking pages.) --[[Joey]] + +> Seems hard to me to sort apart the pagespec whose matching pages +> 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]] diff --git a/doc/todo/po:_translation_of_directives.mdwn b/doc/todo/po:_translation_of_directives.mdwn new file mode 100644 index 000000000..89fc93620 --- /dev/null +++ b/doc/todo/po:_translation_of_directives.mdwn @@ -0,0 +1,8 @@ +If a translated page contains a directive, it may expand to some english +text, or text in whatever single language ikiwiki is configured to "speak". + +Maybe there could be a way to switch ikiwiki to speaking another language +when building a non-english page? Then the directives would get translated. + +(We also will need this in order to use translated templates, when they are +available.) -- cgit v1.2.3 From d3fc6d797bdb64caa6ddd49de154fc4442208901 Mon Sep 17 00:00:00 2001 From: intrigeri Date: Thu, 29 Jul 2010 16:33:57 +0200 Subject: remove spurious map directive --- doc/plugins/po.mdwn | 2 -- 1 file changed, 2 deletions(-) (limited to 'doc/plugins/po.mdwn') diff --git a/doc/plugins/po.mdwn b/doc/plugins/po.mdwn index 1a3917454..3c50908e8 100644 --- a/doc/plugins/po.mdwn +++ b/doc/plugins/po.mdwn @@ -238,8 +238,6 @@ avoid a potential denial of service. BUGS ==== -[[!map pages="bugs/po:*"]] - [[!inline pages="bugs/po:* and !bugs/done and !link(bugs/done) and !bugs/*/*" feeds=no actions=no archive=yes show=0]] -- cgit v1.2.3 From ad2722399e8a6f6d6a311e6b673e8f2e3aa18a41 Mon Sep 17 00:00:00 2001 From: intrigeri Date: Thu, 29 Jul 2010 16:34:57 +0200 Subject: fixed broken link --- doc/plugins/po.mdwn | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'doc/plugins/po.mdwn') diff --git a/doc/plugins/po.mdwn b/doc/plugins/po.mdwn index 3c50908e8..ac2df2d18 100644 --- a/doc/plugins/po.mdwn +++ b/doc/plugins/po.mdwn @@ -198,7 +198,7 @@ enabled, "slave" pages therefore link to the "master" page's discussion page. Likewise, "slave" pages are not supposed to have sub-pages; -[[WikiLinks|wikilink]] that appear on a "slave" page therefore link to +[[WikiLinks|ikiwiki/wikilink]] that appear on a "slave" page therefore link to the master page's sub-pages. Translating -- cgit v1.2.3 From 2ab89b4462557e59e5ccaccf419e5bb3809a643a Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Sun, 1 Aug 2010 12:25:35 -0400 Subject: response --- doc/plugins/po.mdwn | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'doc/plugins/po.mdwn') diff --git a/doc/plugins/po.mdwn b/doc/plugins/po.mdwn index ac2df2d18..154c4cbde 100644 --- a/doc/plugins/po.mdwn +++ b/doc/plugins/po.mdwn @@ -302,3 +302,7 @@ underlay, and the underlays lack translation to a given language. >>>> this could be solved by adding `SRCDIR/basewiki` as an underlay >>>> to your l10n wiki configuration, possibly using the >>>> `add_underlays` configuration directive. --[[intrigeri]] + +>>>>> There is no complete Swedish underlay translation yet, so it is not +>>>>> shipped in ikiwiki. I don't think it's a misconfiguration to use +>>>>> a language that doesn't have translated underlays. --[[Joey]] -- cgit v1.2.3 From e083e4caa8175c4ccc45dd06e9b9cd784dcbbc94 Mon Sep 17 00:00:00 2001 From: intrigeri Date: Mon, 2 Aug 2010 03:23:30 +0200 Subject: ack² MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- doc/plugins/po.mdwn | 13 +++++++++++-- doc/todo/po:_avoid_rebuilding_to_fix_meta_titles.mdwn | 3 +++ 2 files changed, 14 insertions(+), 2 deletions(-) (limited to 'doc/plugins/po.mdwn') diff --git a/doc/plugins/po.mdwn b/doc/plugins/po.mdwn index 154c4cbde..0f1d66d32 100644 --- a/doc/plugins/po.mdwn +++ b/doc/plugins/po.mdwn @@ -247,8 +247,8 @@ TODO [[!inline pages="todo/po:* and !todo/done and !link(todo/done) and !todo/*/*" feeds=no actions=no archive=yes show=0]] -l10n wiki misconfiguration --------------------------- +broken links to translatable basewiki pages that lack po files +-------------------------------------------------------------- If a page is not translated yet, the "translated" version of it displays wikilinks to other, existing (but not yet translated?) @@ -306,3 +306,12 @@ underlay, and the underlays lack translation to a given language. >>>>> There is no complete Swedish underlay translation yet, so it is not >>>>> shipped in ikiwiki. I don't think it's a misconfiguration to use >>>>> a language that doesn't have translated underlays. --[[Joey]] + +>>>>>> Ok. The problem is triggered when using a language that doesn't +>>>>>> have translated underlays, *and* defining +>>>>>> `po_translatable_pages` in a way that renders the base wiki +>>>>>> pages translatable in po's view of things, which in turns makes +>>>>>> the po plugin act as if the translation pages did exist, +>>>>>> although they do not in this case. I still need to have a deep +>>>>>> look at the underlays-related code you added to `po.pm` a while +>>>>>> ago. Stay tuned. --[[intrigeri]] diff --git a/doc/todo/po:_avoid_rebuilding_to_fix_meta_titles.mdwn b/doc/todo/po:_avoid_rebuilding_to_fix_meta_titles.mdwn index 86b0ccd72..d4e1f743c 100644 --- a/doc/todo/po:_avoid_rebuilding_to_fix_meta_titles.mdwn +++ b/doc/todo/po:_avoid_rebuilding_to_fix_meta_titles.mdwn @@ -38,3 +38,6 @@ Re the meta title escaping issue worked around by `change`. >>>>> in scan mode. Hmm, I wonder if there's any reason to have >>>>> the scan hook called before those as it does now. Reordering >>>>> those 2 lines could avoid adding a new hook. --[[Joey]] + +>>>>>> Sure. I was fearing to break other plugins if I did so, so I +>>>>>> did not dare to. I'll try this. --[[intrigeri]] -- cgit v1.2.3 From 97a706f73ce2cedc8fd8a9bbeea6d25783260b2e Mon Sep 17 00:00:00 2001 From: intrigeri Date: Mon, 2 Aug 2010 15:14:33 +0200 Subject: both are now fixed in my po branch. --- doc/plugins/po.mdwn | 3 +++ doc/todo/po:_avoid_rebuilding_to_fix_meta_titles.mdwn | 2 ++ 2 files changed, 5 insertions(+) (limited to 'doc/plugins/po.mdwn') diff --git a/doc/plugins/po.mdwn b/doc/plugins/po.mdwn index 0f1d66d32..91273ba98 100644 --- a/doc/plugins/po.mdwn +++ b/doc/plugins/po.mdwn @@ -315,3 +315,6 @@ underlay, and the underlays lack translation to a given language. >>>>>> although they do not in this case. I still need to have a deep >>>>>> look at the underlays-related code you added to `po.pm` a while >>>>>> ago. Stay tuned. --[[intrigeri]] + +>>>>>>> Fixed in my po branch, along with other related small bugs that +>>>>>>> happen in the very same situation only. --[[intrigeri]] diff --git a/doc/todo/po:_avoid_rebuilding_to_fix_meta_titles.mdwn b/doc/todo/po:_avoid_rebuilding_to_fix_meta_titles.mdwn index d4e1f743c..402f70b79 100644 --- a/doc/todo/po:_avoid_rebuilding_to_fix_meta_titles.mdwn +++ b/doc/todo/po:_avoid_rebuilding_to_fix_meta_titles.mdwn @@ -41,3 +41,5 @@ Re the meta title escaping issue worked around by `change`. >>>>>> Sure. I was fearing to break other plugins if I did so, so I >>>>>> did not dare to. I'll try this. --[[intrigeri]] + +>>>>>>> Done in my po branch, please have a look. --[[intrigeri]] -- cgit v1.2.3