A
A
Arman2015-10-17 08:21:41
Internationalization and localization
Arman, 2015-10-17 08:21:41

Is there a normal alternative to localization (i18n) in laravel 5?

Good morning.
I am studying laravel 5 to the fullest, before that I had a good walk through the YII2 documentation. I like everything in laravel, except for localization, somehow it is "poorer" than in the same Yii2. I went through github and did not find anything normal so that it was at least close in functionality to Yii2.
In Laravel, instead of the text, it is suggested to leave the labels "messages.welcome", and store the text separately in different languages. Very strangely implemented with the plural (goods | goods | goods)
Maybe someone has already solved this problem? Very much it would be desirable in a sheaf with intl.
Approximately close to
https://github.com/yiisoft/yii2/blob/master/docs/g...
Or will it continue to dawn on me through "I don't want to" that Laravel's implementation is much better? =)
thanks

Answer the question

In order to leave comments, you need to log in

2 answer(s)
D
D', 2015-10-17
@Arik

In principle, the approaches are not very different. I prefer the Laravel approach, with "labels".
I think it's worth trying "by force" to use the Laravel approach, and maybe after a while you will realize that storing texts in the code (Yii approach) is a bad idea.

A
Andrey Kimvr, 2016-03-20
@ACymru

Practically the same thing.
in yii (from the example on your link):
in Laravel the same thing will happen:
But in Laravel, the "trans" helper is mainly used not to call the function, as a result, the
first and second parameters from the example for yii are specified through a dot, where the file comes before the point, and the phrase comes after.
Well, "echo" is usually replaced with a blade construction.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question