[dokuwiki] Re: language files in action plugins
- From: "Martin Tschofen" <martin.tschofen@xxxxxxxxx>
- To: dokuwiki@xxxxxxxxxxxxx
- Date: Thu, 25 Jan 2007 21:55:07 -0600
I'm running develonly. But just to check it out, I threw it into the latest
release with the same result.
Any idea how I can track this down?...martin
On 1/25/07, Chris Smith <chris@xxxxxxxxxxxxx> wrote:
Martin Tschofen wrote:
> I'm stuck with using language files in an action plugin.
> The action plugin replaces the current index. I cannot figure out how
> I can
> access the language settings when using
> $this->getLang('name=of=the=property'); It always returns empty, no
> error.
>
> I'm even setting the locale in the constructor, even though getLang
> should
> do that anyway:
> $this->setupLocale();
>
> Here's how I retrieve the page_header within a function:
> print $this->getLang('page_header');
>
> page_header is in the lang/en/lang.php file as
> $lang['page_header'] = 'Select and organize pages';
>
> The same issue happens with
> print p_locale_xhtml('index');
> It always returns the index from the DW global language directory.
>
> $this->lang only returns a blank array.
>
> The same approach works just fine in an admin plugin.
>
> Any idea what's different with action plugins and language settings?
>
> Thanks...martin
>
There shouldn't be any difference, both inherit from the same base class
which provides the introspection, config and localisation methods. Are
you running develonly? Andi moved the base class from /lib/plugins into
/inc in a recent patch. Maybe something became broken.
Cheers,
Chris
--
DokuWiki mailing list - more info at
http://wiki.splitbrain.org/wiki:mailinglist
- References:
- [dokuwiki] language files in action plugins
- From: Martin Tschofen
- [dokuwiki] Re: language files in action plugins
- From: Chris Smith
Other related posts:
- » [dokuwiki] language files in action plugins
- » [dokuwiki] Re: language files in action plugins
- » [dokuwiki] Re: language files in action plugins
- » [dokuwiki] Re: language files in action plugins
- » [dokuwiki] Re: language files in action plugins
- » [dokuwiki] Re: language files in action plugins
- » [dokuwiki] Re: language files in action plugins
- » [dokuwiki] Re: language files in action plugins
- » [dokuwiki] Re: language files in action plugins
- » [dokuwiki] Re: language files in action plugins
Martin Tschofen wrote:
> I'm stuck with using language files in an action plugin.
> The action plugin replaces the current index. I cannot figure out how
> I can
> access the language settings when using
> $this->getLang('name=of=the=property'); It always returns empty, no
> error.
>
> I'm even setting the locale in the constructor, even though getLang
> should
> do that anyway:
> $this->setupLocale();
>
> Here's how I retrieve the page_header within a function:
> print $this->getLang('page_header');
>
> page_header is in the lang/en/lang.php file as
> $lang['page_header'] = 'Select and organize pages';
>
> The same issue happens with
> print p_locale_xhtml('index');
> It always returns the index from the DW global language directory.
>
> $this->lang only returns a blank array.
>
> The same approach works just fine in an admin plugin.
>
> Any idea what's different with action plugins and language settings?
>
> Thanks...martin
>
There shouldn't be any difference, both inherit from the same base class
which provides the introspection, config and localisation methods. Are
you running develonly? Andi moved the base class from /lib/plugins into
/inc in a recent patch. Maybe something became broken.
Cheers,
Chris
--
DokuWiki mailing list - more info at
http://wiki.splitbrain.org/wiki:mailinglist
- [dokuwiki] language files in action plugins
- From: Martin Tschofen
- [dokuwiki] Re: language files in action plugins
- From: Chris Smith