[dokuwiki] Re: [patch] newpage question

  • From: Robin Getz <rgetz@xxxxxxxxxxxxxxxxxxxx>
  • To: dokuwiki@xxxxxxxxxxxxx
  • Date: Thu, 14 Oct 2010 09:38:57 -0400

On Mon 11 Oct 2010 16:42, Christopher Smith pondered:
> 
> On 11 Oct 2010, at 20:07, Robin Getz wrote:
> 
> > On Mon 11 Oct 2010 13:16, Robin Getz pondered:
> >> Is there a way to override the text in: 
> >> inc/lang/xx/newpage.txt
> >> 
> >> Or am I stuck editing that, and managing it separately when upgrading? 
> >> 
> >> From what I saw, it seemed to be hard coded in 
> >> inc/parserutils.php:p_wiki_xhtml() & 
> >> inc/parserutils.php:p_wiki_xhtml_summary()
> >> 
> > 
> > Seems to do what I needed to do...
> > 
> > if ./conf/lang/filename.local.txt exists, use that, otherwise fall back
> > to the standard dokuwiki text.
> > 
> > Any better suggestions?
> 
> TPL_CONTENT_DISPLAY
> TPL_ACT_RENDER
>
> or propose an event to wrap around either (or both) localeFN(), 
> p_locale_xhtml()
> 
> I18N_FILENAME_GET ... $id, $lang
> I18N_XHTML_RENDER ... $id, $lang

OK, so something like:

diff --git a/inc/pageutils.php b/inc/pageutils.php
index c333170..0b6fda7 100644
--- a/inc/pageutils.php
+++ b/inc/pageutils.php
@@ -355,6 +355,7 @@ function localeFN($id, $suffix='txt'){
         //fall back to english
         $file = DOKU_INC.'inc/lang/en/'.$id.'.'.$suffix;
     }
+    trigger_event('I18N_FILENAME_GET', $file);
     return $file;
 }

is still needed before I can start on the plugin...
-- 
DokuWiki mailing list - more info at
http://www.dokuwiki.org/mailinglist

Other related posts: