Commit Graph

230 Commits (0ccf21daafa76fd182df5e6bc156f22873fe062d)

Author SHA1 Message Date
Joey Hess 031da9c134 po: guard against reimportation
If po is imported twice, bad things happen. Guard against that.

I'm not sure what causes the double import; I saw it when websetup did a
wiki rebuild. Carp failed to show a backtrace for the second call to
import.
2010-05-13 16:28:09 -04:00
Joey Hess cce3042457 po: fix some uninitalized value warnings when used by websetup 2010-04-24 16:44:45 -04:00
Joey Hess d5eb540149 po: Configuring the same language as master and slave confuses processing; so filter out such a misconfiguration. 2010-04-10 18:28:15 -04:00
Joey Hess d1a616df2e po: Check that translated underlay directories exist before using them for master language. 2010-04-09 18:43:25 -04:00
Joey Hess baa07e0b52 remove a few leftover manual folding indicators 2010-03-25 14:23:16 -04:00
Joey Hess 9cee2962e0 format plugin categorization 2010-02-12 01:10:36 -05:00
Joey Hess ee9ae0a314 po: avoid crash when page is empty
Note that there is an associated po4a warning when a page is empty:
  Use of uninitialized value $file in substitution (s///) at /usr/share/perl5/Locale/Po4a/Text.pm line 205.
I've filed a bug with po4a about that, but the important thing is fixing
the crash here.
2010-01-21 15:33:20 -05:00
Joey Hess f756d7e6de po: Fix breakage caused by changes to render code. 2009-10-26 11:53:55 -04:00
Joey Hess 6a955e86bb fix logic error
This sometimes caused infinite recursion when rebuilding a wiki
with po files.
2009-10-17 20:45:03 -04:00
Joey Hess d678147410 Revert "po: do not inject custom bestlink function when po_link_to eq default"
This reverts commit cdc3576c8d.

Conflicts:

	IkiWiki/Plugin/po.pm

This change broke the test suite and is not strictly necessary.
2009-08-30 14:50:43 -04:00
Joey Hess 3811c5f559 Merge commit 'intrigeri/po' 2009-08-28 19:48:32 -04:00
Joey Hess ec26a96193 avoid clobbering origsub if checkconfig runs more than once
checkconfig can run more than once in a single ikiwiki run if setup is
building wrappers. That clobbered the origsub value for bestlink, leading
to infinite recursion
2009-08-28 19:15:25 -04:00
intrigeri 646c9a4c95 po: fix link() pagespec when used on translation pages
Signed-off-by: intrigeri <intrigeri@boum.org>
2009-08-28 16:34:58 +02:00
intrigeri e671e72053 po: better rootpage logic for inline's post form
Set rootpage to the non-l10n'd rootpage parameter if it is set,
else to the masterpage of the linking page.

Signed-off-by: intrigeri <intrigeri@boum.org>
2009-08-28 15:00:16 +02:00
intrigeri 53dc18ec2b Revert "po: keep masterpage as the rootpage for inline's post form"
This reverts commit cf43ae5a1f, which actually
only works when a rootpage parameter is set. A more complete fix will be
written soon.
2009-08-28 14:47:11 +02:00
intrigeri cf43ae5a1f po: keep masterpage as the rootpage for inline's post form
Signed-off-by: intrigeri <intrigeri@boum.org>
2009-08-28 14:22:36 +02:00
intrigeri 5136c22eed po: favor the type of linking page's masterpage on page creation
Signed-off-by: intrigeri <intrigeri@boum.org>
2009-08-28 07:33:53 -04:00
intrigeri 18ddf727d1 po: fix interdiction to create pages of type po
... which was broken by the new page_types code.

Signed-off-by: intrigeri <intrigeri@boum.org>
(cherry picked from commit 1914ae2fd2)
2009-08-28 07:32:41 -04:00
intrigeri c9301d2c29 po: favor the type of linking page's masterpage on page creation
Signed-off-by: intrigeri <intrigeri@boum.org>
2009-08-28 13:12:58 +02:00
intrigeri 1914ae2fd2 po: fix interdiction to create pages of type po
... which was broken by the new page_types code.

Signed-off-by: intrigeri <intrigeri@boum.org>
2009-08-28 12:38:07 +02:00
intrigeri cdc3576c8d po: do not inject custom bestlink function when po_link_to eq default
Signed-off-by: intrigeri <intrigeri@boum.org>
2009-08-27 20:31:44 +02:00
intrigeri 6c0f9c691c po: override the title template variable for coherent homepage titling
Signed-off-by: intrigeri <intrigeri@boum.org>
2009-08-27 20:19:17 +02:00
intrigeri 3c2bffe21b po(scan): removed scary comment about only wanting to change the first link
Signed-off-by: intrigeri <intrigeri@boum.org>
2009-08-27 19:59:15 +02:00
intrigeri 496e8523c6 po: do not beautify urls on the recentchanges page
... else, 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 is better in this one case if the link goes direct to the translated version
of the page.
2009-08-26 07:56:33 +02:00
intrigeri 0113c69d4f po: (hopefully) fixed WikiLink to self with po_link_to=default 2009-08-26 07:02:29 +02:00
Joey Hess 9b799ccc85 po: Fixed to run rcs_add ralative to srcdir. 2009-08-19 14:05:59 -04:00
Joey Hess 4ff3e2a540 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.
2009-08-15 22:18:05 -04:00
Joey Hess 1be07eae46 replace N/A with 0
I think the N/A was not intended to be visible, but it can show up as the
percent translated to a language. This happens if the page is located in an
underlay, and not translated to the language in any other underlay.
2009-08-15 21:08:17 -04:00
Joey Hess e031551727 update for consistency 2009-08-15 16:42:29 -04:00
Joey Hess 949eb252e9 po: use discussionpage config setting
This was tricky. $links{$page/discussion} must be checked; with it in
lowercase.
2009-08-13 21:44:40 -04:00
Joey Hess b4d7dfcbe1 po: Detect if nowrapi18n can't be passed to po4a, and warn about the old version, but continue. Closes: #541205 2009-08-12 12:26:07 -04:00
Joey Hess 83480665c2 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.
2009-08-10 15:59:32 -04:00
Jonas Smedegaard 3bdc366e73 Merge branch 'master' of git://git.ikiwiki.info 2009-07-23 01:17:40 +02:00
Jonas Smedegaard 27071f0ba9 Change rendering→building in translatable strings, to ease translations. 2009-07-23 00:53:23 +02:00
Jonas Smedegaard 28b572a61e Rephrase suggestion to not get confused as info on action already done. 2009-07-23 00:50:42 +02:00
Joey Hess 88d4fb15ba add --previous at bubulle's suggestion 2009-07-22 17:48:49 +02:00
Joey Hess c56ff6cd47 relocate po directory up a level 2009-07-21 13:16:26 +02:00
Joey Hess 637f32480c turn off pot file underlay again 2009-07-21 12:40:44 +02:00
Joey Hess cebffa917f improve invalid gettext message
(and gettext it as translators will see this!)
2009-07-21 12:39:21 +02:00
Joey Hess 1610b1e9e6 update 2009-07-21 12:38:40 +02:00
Joey Hess 7532eff2b7 update 2009-07-21 11:40:25 +02:00
Joey Hess eca2dbe67f po: Add support for mo files in underlays
In order to support translated basewiki and other underlays, we need
support for mo files in underlays.

The code did not allow this before, because if a mo file was in an
underlay, then it might try to update it, and its pot, and write to the
underlay, which is guaranteed to either fail due to permissions, or be
undesirable.

To fix, my approach is to just detect if a mo or pot file that is about to
be updated is in an underlay, and skip updating it. This seems to work
well:

- If the mo is out of date in the underlay, it won't get updated, but this
  would probably be due to a problem in the underlay, or more likely,
  the wiki is being rebuilt and so it *thinks* the mo is out of date,
  but it's really not (and it would be a waste of time to rebuild it
  anyway).
- If a page from the basewiki is edited, it is saved to the srcdir,
  which causes generation of an updated mo and pot also in the srcdir;
  the underlay stops being used for that page, and everything seems
  to work.

Note that I am not including an underlay search directory for pot files.
They *seem* to be unnecessary for the underlay, since the mo files
in there never need to be updated.
2009-07-21 11:31:51 +02:00
Joey Hess 4b1534d5bc fix example 2009-07-21 09:56:34 +02:00
Joey Hess e04692e059 po: Support running with a non-english master lang; add translated underlays
It seem to make sense to remove the check for there being slave languages
as part of this, since one might want a wiki that is only in non-English.
2009-07-20 07:19:05 +02:00
Joey Hess 741c33576e create translated underlays in mdwn format
These are for use by wikis where the primary language is not English.
On such a wiki, it makes sense to use an underlay has the source for pages
in the native language.
2009-07-20 06:23:33 +02:00
Joey Hess 126952bd33 avoid Po4a::Common exporting anything
It exports gettext and stuff by default, which conflicts with IkiWiki
exports.
2009-07-19 17:50:56 +02:00
Joey Hess 43e5c905cb shut up msgmerge 2009-07-19 16:54:03 +02:00
Joey Hess ea8c166a05 bugfix: Avoid generating po files for files that are not httmlizable 2009-07-19 13:46:10 +02:00
intrigeri 091f11be76 po: better discussion link logic
Signed-off-by: intrigeri <intrigeri@boum.org>
2009-06-03 18:30:00 +02:00
Joey Hess 53b1c6f559 Merge commit 'intrigeri/po' into po 2009-05-19 13:06:35 -04:00