Download the PHP package kg-bot/laravel-localization-to-vue without Composer

On this page you can find all versions of the php package kg-bot/laravel-localization-to-vue. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package laravel-localization-to-vue

Latest Stable Version Total Downloads Latest Unstable Version License Monthly Downloads Daily Downloads

Laravel Localization To Vue/JSON

This package collects all localizations from resources/lang directory and it's sub-directories and converts them to plain array
which can later be converted to JSON object and used with libraries like Vue, Angular, etc.

Installing

Laravel before version 9

Laravel 9

Laravel 8+

Laravel 8 requires minimum of PHP 7.3. make sure you have at least PHP 7.3 before running composer.

Laravel 9+

Laravel 9 requires minimum of PHP 8.0.2 make sure you have at least PHP 8.0.2 before running composer.

Laravel 5.5+

Laravel 5.5 uses Package Auto-Discovery, so doesn't require you to manually add the ServiceProvider.

If you don't use auto-discovery, add the ServiceProvider to the providers array in config/app.php

and if you want alias add this inside aliases array in config/app.php

Settings and configuration

You can export config by running

if you want to parse multiple language directories or some other directory except lang_path() you can add multiple paths in config paths.lang_dirs inside array.

It can be just one path or multiple paths, for example

You can run your own callback function after export, to do that you must register globally accessible function, for example register function.php inside composer files autoload, and add your function inside config/laravel-localization.php, key export_callback. Example:

Usage

This package can be used in multiple ways, I'll give examples for some of them, but there's really no limitation.

First example would be to add view composed variable and use it in blade views.

Second way would be to request it over HTTP just like any other file

For this to work, you need to enable the route via LARAVEL_LOCALIZATION_ROUTE_ENABLE in your .env file or in config/laravel-localization.php

You can also export messages to ECMAScript 6 standard JavaScript module with artisan command `

Export for npm localization packages like Lang.js

If you need special format of array that's recognised by some npm localization packages as Lang.js.

Some examples why would you use this package and messages over Laravel standard localization

A note about json files

Laravel 5.4+ allows localization to be strutured using a single .json file for each language, in order to use the strings inside the provided json file you must prepend the __JSON__ key

Routing

This package exposes one route http://localhost/js/localization.js by default but you can change the prefix to anything you whish in config file.

You can also have a nice route name for blade templates or any other route calls, it's route('assets.lang') by default but it's customizable by config/environment file.

Proposals, comments, feedback

Everything of this is highly welcome and appreciated

To-Do

Anything else you can think of please leave me comments, mail me, create issue, whatever you prefer.

License

This project is licensed under the MIT License - see the LICENSE.md file for details


All versions of laravel-localization-to-vue with dependencies

PHP Build Version
Package Version
Requires php Version ^8.0
laravel/framework Version 5.*|^6|^7|^8|^9|^10.0|^11.0
ext-json Version *
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package kg-bot/laravel-localization-to-vue contains the following files

Loading the files please wait ....