-
Notifications
You must be signed in to change notification settings - Fork 53
Support splitting up messages.js to locale-based .js files #48
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
Changes from 1 commit
8bfc0aa
2a76a21
ec0f414
aa6e44e
f538f52
f2c67c8
066485e
f2333da
d2751fb
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
… exporting translations - @yield('js-localization.head.exported')
- Loading branch information
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -17,3 +17,24 @@ | |
| Lang.setLocale("{{ App::getLocale() }}"); | ||
| </script> | ||
| @stop | ||
|
|
||
| @section('js-localization.head.exported') | ||
| @if (file_exists(config('js-localization.storage_path') . '/js-localization.min.js')) | ||
|
||
| <script src="{{ url('/vendor/js-localization/js-localization.min.js') }}"></script> | ||
| @else | ||
| <script src="{{ url('/js-localization/localization.js') }}"></script> | ||
| @endif | ||
|
|
||
| @if (Config::get('js-localization.config')) | ||
| <script src="{{ url('/vendor/js-localization/config.js') }}"></script> | ||
| @endif | ||
|
|
||
| @if (Config::get('js-localization.split_export_files') && file_exists(config('js-localization.storage_path') . '/lang-' . App::getLocale() . '.js')) | ||
| <script src="{{ url('/vendor/js-localization/lang-' . App::getLocale() . '.js') }}"></script> | ||
| @else | ||
| <script src="{{ url('/vendor/js-localization/messages.js') }}"></script> | ||
| @endif | ||
| <script> | ||
| Lang.setLocale("{{ App::getLocale() }}"); | ||
| </script> | ||
| @stop | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is that new
@sectionactually a part of the file splitting changes?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, well, kind of. It allows you to use
@yield('js-localization.head.exported'), which in turn will include the<script>tags for the exported files if they exist, and fallback tomessages.jsor just serving from the API endpoint instead if used incorrectly.