Skip to content
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

[5.4] Where is the trans directive? #17942

Closed
yusufyilmaz opened this issue Feb 15, 2017 · 3 comments
Closed

[5.4] Where is the trans directive? #17942

yusufyilmaz opened this issue Feb 15, 2017 · 3 comments

Comments

@yusufyilmaz
Copy link
Contributor

  • Laravel Version: 5.4.11
  • PHP Version: 7.0.15

Description:

I have been trying to work with new "awesome" json based translations. However, I have come up with an issue which I mentioned here As @taylorotwell suggested using trans directive, but I cannot see trans directive in L5.4 documentation. And When I try to test trans directive in L5.4.11, blade is not picking up the directive, rather it just prints @ trans..... Any suggestion with that?

@ntzm
Copy link
Contributor

ntzm commented Feb 15, 2017

I can't find a @trans directive here but maybe Taylor meant {{ trans('foo.bar') }}? See here: https://github.com/laravel/framework/blob/5.4/src/Illuminate/Foundation/helpers.php#L804

@yusufyilmaz
Copy link
Contributor Author

yusufyilmaz commented Feb 15, 2017

@ntzm Thanks for the reply.

As I linked in my PR here, I have attached laravel-news article from here You can see the @trans "directive" at article. I also suggested another PR about "trans helper" which was rejected since "__ helper" is first using json based translations while "trans helper" is not using json based language files.

So now in L5.4 we have different directives and helpers:

@lang directive: This directive is not using json based language files.
@trans directive: There is no such directive in L5.4
trans() helper: This helper is not using json based langauge files.
__() helper: This helper first using json based language. If not exists, it fallbacks to the default keyed language arrays.

It is obvious that there is a need to clarify these localization methods :)

@themsaid
Copy link
Member

#17919 was merged. Thanks for your efforts :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants