Simple, ease-to-use and flexible package for the Laravel web framework. Allows you to use localized messages of the Laravel webapp (see `resources/lang` directory) in your Javascript code.
MIT License
143
stars
51
forks
source link
Support splitting up messages.js to locale-based .js files #48
Seeing as loading the whole messages.js file might be a bit too much, I have added support for splitting up the whole messages.js into .js files for each locale (lang-en.js, lang-es.js etc.).
This way, one could chose to only load the translations for the user's language, by checking App::getLocale().
Also added a @yield (@yield('js-localization.head.exported')) in the view for this that will check for the exported files and include accordingly.
Also updated docs and did some small indent fixes as well.
The @section('js-localization.head.exported') is quite hard to understand (see my comment), but if we can make that a bit easier to read it's ready for merge.
Seeing as loading the whole messages.js file might be a bit too much, I have added support for splitting up the whole messages.js into .js files for each locale (lang-en.js, lang-es.js etc.).
This way, one could chose to only load the translations for the user's language, by checking
App::getLocale()
.Also added a
@yield
(@yield('js-localization.head.exported')
) in the view for this that will check for the exported files and include accordingly.Also updated docs and did some small indent fixes as well.