Skip to content

[NFR]: Get the internal translate array in Translate NativeArray #15902

@palcoder

Description

@palcoder

Hello,

In Phalcon\Translate\Adapter\NativeArray we cannot access the whole internal translate array.

Sometimes it may help increase the performance when print the translation in view using the arrays instead of calling ( _ ) method on every word or sentence in the page especially in large pages.

For example: in beforeExecuteRoute event we can this

public function beforeExecuteRoute(Dispatcher $dispatcher)
{
        // Set translate data
        $this->view->setVar('_t', $this->translator->getAll());
}

and in the view we may use this:

{{ _t['title'] }}

instead of

this.translator._('title')

Thanks

Metadata

Metadata

Assignees

No one assigned

    Labels

    new feature requestPlanned Feature or New Feature Request

    Projects

    Status

    Released

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions