-
-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[NFR]: Get the internal translate array in Translate NativeArray #15902
Comments
@palcoder That would work for translations that do not have placeholders. So for instance if you have this:
then dumping that array out will work just fine, and you will be able to use those array elements wherever you need. If you use placeholders though:
the placeholder will not be replaced by the data you pass or should pass. We don't know what the user will need to send as placeholders for any given translation string, (see above the We can introduce the method of course but that should be only with the understanding that it will have to be just strings, not placeholders. I am thinking to check whether there are any placeholders and not return those results back. Thoughts? |
almost the same problem i faced trying to extend the |
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
and in the view we may use this:
{{ _t['title'] }}
instead of
this.translator._('title')
Thanks
The text was updated successfully, but these errors were encountered: