summaryrefslogtreecommitdiff
path: root/IkiWiki/Plugin/po.pm
AgeCommit message (Collapse)Author
2008-11-11po: fixed link to home page when po_link_to=negotiated, added testcaseintrigeri
Signed-off-by: intrigeri <intrigeri@boum.org>
2008-11-11po(change): fix uninitialized variables when running IkiWiki::refresh()intrigeri
Signed-off-by: intrigeri <intrigeri@boum.org>
2008-11-11po: added HOMEPAGEURL template variable, documented when to use itintrigeri
Hopefully all links should now be consistent with the chosen linking behavior, but who knows... Signed-off-by: intrigeri <intrigeri@boum.org>
2008-11-11po: fixed link to homepage from non-translation pageintrigeri
Added testcases for this bug. It remains broken when generated from <TMPL_VAR BASEURL>, though. Signed-off-by: intrigeri <intrigeri@boum.org>
2008-11-11po: some code simplification/clarificationintrigeri
Signed-off-by: intrigeri <intrigeri@boum.org>
2008-11-11po(scan): make more clear what's being doneintrigeri
Mostly comments, and also a small code change: simplification and implementation details hiding. Signed-off-by: intrigeri <intrigeri@boum.org>
2008-11-11po: reorder nearly all of the module codeintrigeri
It has grown up incrementally and new helper functions were added right in the middle of the hooks, most often near the place they were used, which is practical when doing initial development, but quite ugly afterwards, when helper functions are useful to separate logic and implementation details. Today's refactoring commits have brought the code to a much more maintainable state, IMHO. Signed-off-by: intrigeri <intrigeri@boum.org>
2008-11-10po(match_lang, match_currentlang): use the lang() functionintrigeri
... now that it exists, instead of duplicating it. Signed-off-by: intrigeri <intrigeri@boum.org>
2008-11-10po: rewrote otherlanguagesloop()intrigeri
It is now more elegant IMHO, and the output is now sorted according to the language name (instead of code). Signed-off-by: intrigeri <intrigeri@boum.org>
2008-11-10po: factorize extraction of a slave page's masterpage and langintrigeri
The very same code was repeated at dozens of places. NB: the real work is now done is _istranslation(), which is memoized, so the additional function calls overhead should be compensated. Signed-off-by: intrigeri <intrigeri@boum.org>
2008-11-10po(otherlanguagesloop): start factorizingintrigeri
Signed-off-by: intrigeri <intrigeri@boum.org>
2008-11-10po: finish abstracting %filtered by putting it into a blackboxintrigeri
i.e. it is invisible for everyone but its accessors/mutators Signed-off-by: intrigeri <intrigeri@boum.org>
2008-11-10po: actually use pofiles() function, to enhance code clarityintrigeri
Signed-off-by: intrigeri <intrigeri@boum.org>
2008-11-10po: abstract "doing something for the same page in every other language"intrigeri
Signed-off-by: intrigeri <intrigeri@boum.org>
2008-11-10po: abstract implementation details for %translations building and resettingintrigeri
Signed-off-by: intrigeri <intrigeri@boum.org>
2008-11-10po: abstract %filtered implementation detailsintrigeri
Signed-off-by: intrigeri <intrigeri@boum.org>
2008-11-10po: clarify error messagesintrigeri
Signed-off-by: intrigeri <intrigeri@boum.org>
2008-11-10po: clarify code with some commentsintrigeri
Signed-off-by: intrigeri <intrigeri@boum.org>
2008-11-10po: prevent a slave page to depend on itselfintrigeri
It has never caused harm yet, but it might in the future. Signed-off-by: intrigeri <intrigeri@boum.org>
2008-11-08po(refreshpot): define the input charset before read()'ingintrigeri
... to prevent the use of Encode::Guess::guess_encoding() in Locale::Po4a::Transtractor (just a minor security measure, dependent on po4a internals, but we have no reason to think Encode::Guess is not safe). Signed-off-by: intrigeri <intrigeri@boum.org>
2008-11-07po: finished backlinks implementationintrigeri
Signed-off-by: intrigeri <intrigeri@boum.org>
2008-11-07po: implemented linking/backlinks specification for po_link_to=negotiatedintrigeri
Signed-off-by: intrigeri <intrigeri@boum.org>
2008-11-07po: added pofiles() function, will use this soonintrigeri
Signed-off-by: intrigeri <intrigeri@boum.org>
2008-11-07po: add commentsintrigeri
Signed-off-by: intrigeri <intrigeri@boum.org>
2008-11-06po: fix link to homepage in special caseintrigeri
... by wrapping IkiWiki::urlto in order to workaround hard-coded /index.$config{htmlext}, which is wrong when usedirs=0 and po_link_to=current and translatable homepage Signed-off-by: intrigeri <intrigeri@boum.org>
2008-11-06po: redesign (once more) automatic POT/PO files updateintrigeri
Now use the change hook to update these files, check them into VCS, and trigger IkiWiki::refresh as needed. The needsbuild hook's help was required to prevent infinite looping. This more rigorous way of doing this fixes recentchanges (that was previously not updated in some cases), and probably is a better long-term solution than the two previously tested ones. Signed-off-by: intrigeri <intrigeri@boum.org>
2008-11-06po: use prep_writefile before creating any files in refreshpot and refreshpointrigeri
Signed-off-by: intrigeri <intrigeri@boum.org>
2008-11-06po: syntax warning fixintrigeri
Signed-off-by: intrigeri <intrigeri@boum.org>
2008-11-06po: fixed whitespaceintrigeri
Signed-off-by: intrigeri <intrigeri@boum.org>
2008-11-06po: po_link_to is safe, and fallbacks to a working value if neededintrigeri
warnings are displayed if it is set to an invalid or incompatible value (e.g. po_link_to=negotiated and disabled usedirs) Signed-off-by: intrigeri <intrigeri@boum.org>
2008-11-06po: mark po_translatable_pages as a safe configuration settingintrigeri
Signed-off-by: intrigeri <intrigeri@boum.org>
2008-11-06po: po_master_language and po_slave_languages are safe config settingsintrigeri
... and check their validity in checkconfig Signed-off-by: intrigeri <intrigeri@boum.org>
2008-11-06po: added license and copyrightintrigeri
Signed-off-by: intrigeri <intrigeri@boum.org>
2008-11-06Merge commit 'upstream/po' into prv/pointrigeri
Conflicts: IkiWiki/Plugin/po.pm doc/plugins/po.mdwn Signed-off-by: intrigeri <intrigeri@boum.org>
2008-11-05first pass over codeJoey Hess
Only change of note is quoting some strings in a regexp, just in case (also avoids the . matching any character!) Mostly whitespace changes of no consequence.
2008-11-05backup refs to injected subs laterJoey Hess
In case two plugins both inject replacements for these subs, backup the ref just before injecting to make sure the most recent version is seen.
2008-11-05minor layout changesJoey Hess
2008-11-05avoid hitting the shell with system()Joey Hess
2008-11-05another reason to require rebuilds (and not be marked safe)Joey Hess
the plugin changes html filenames, so requiring a manual transition to enable
2008-11-05po plugin(filter): redesign temp file managementintrigeri
... in a way compatible with various File::Temp versions. The result is far from being perfect (see comments in the code for details), but it does work. Signed-off-by: intrigeri <intrigeri@boum.org>
2008-11-04po plugin: redesign refresh mechanism after master page updateintrigeri
manually triggering IkiWiki::refresh() was at least dubious, and more or less buggy (it randomly broke the whole backlinks feature); thinking a bit more to add the necessary bits to @needsbuild seems like a better way. don't play with ikiwiki's internals if not absolutely needed. Signed-off-by: intrigeri <intrigeri@boum.org>
2008-11-04po plugin: remove broken parentlinks for home page's translationsintrigeri
Signed-off-by: intrigeri <intrigeri@boum.org>
2008-11-04po plugin: aestheticsintrigeri
Signed-off-by: intrigeri <intrigeri@boum.org>
2008-11-04po plugin: fix preview for PO filesintrigeri
As a trick, use editcontent hook to mark the page as unfiltered, to force our filter() sub's to proceed again. Signed-off-by: intrigeri <intrigeri@boum.org>
2008-11-03po plugin: slave pages link to the master's discussion pageintrigeri
Signed-off-by: intrigeri <intrigeri@boum.org>
2008-11-02po plugin: replace %hash=undef with undef %hashintrigeri
Signed-off-by: intrigeri <intrigeri@boum.org>
2008-11-02po plugin: force utf-8 encoding in POT filesintrigeri
Signed-off-by: intrigeri <intrigeri@boum.org>
2008-11-02po plugin: fix linking from a translation to its master pageintrigeri
Signed-off-by: intrigeri <intrigeri@boum.org>
2008-11-02po plugin: fix targetpage for home page's translationsintrigeri
Signed-off-by: intrigeri <intrigeri@boum.org>
2008-11-02po plugin: removed last (?) bit of deprecated custom hookintrigeri
Signed-off-by: intrigeri <intrigeri@boum.org>