Download the PHP package michele-angioni/laravel-js-lang-converter without Composer

On this page you can find all versions of the php package michele-angioni/laravel-js-lang-converter. 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-js-lang-converter

Laravel JS Lang Converter

Laravel Localization in JavaScript.

Latest Stable Version License Build Status SensioLabsInsight

Laravel JS Lang Converter converts all your localization messages of your Laravel app to JavaScript, providing a small JavaScript library to interact with those messages in the fron end.

Most of the work has been developed in Mariuzzo's package

Laravel 5.5+ is supported. PHP 7.0 is required. For Laravel 5.1 - 5-4 versions, use the v2.x branch.

Installation

Add the following line to you composer.json file under require.

and run composer update or composer install.

Then you need to add the Laravel JS Lang Converter service provider in your app/config/app.php file

In order to use some package features, you need to publish the config file through the artisan command php artisan vendor:publish. It will create the laravel_js_lang.php file in your config directory.

Now you are done!

Usage

This project comes with a command that generate the JavaScript version of all your messages found in resources/lang directory. The resulting JavaScript file will have the whole bunch of messages and a thin library similar to Laravel's Lang class.

Generating JS messages

Specifying a custom target

Converting only some files

If you don't want to convert ALL your lang files, you can specify the files you want to be converted into your laravel_js_lang.php conf file. Under the files array, just add the list of your source files, like so:

Compressing the JS file

Use gulp to publish (optional):

  1. Install gulp-shell from https://github.com/sun-zheng-an/gulp-shell with npm install --save-dev gulp-shell .

  2. Create an extension for elixir in your gulpfile.js:

  3. Use the new elixir task:

Documentation

This is the documentation regarding the thin JavaScript library. The library is highly inspired on Laravel's Lang class.

Getting a message

Getting a message with replacements

Changing the locale

Checking if a message key exists

Support for singular and plural message based on a count

Calling the choice method with replacements

For more detailed information, take a look at the source: Lang.js.

How to contribute

Pull requests are welcome.

  1. Fork this repository and clone it.
  2. Create a branch from develop: git checkout -b feature-foo.
  3. Push your commits and create a pull request.

Setting up development environment

Prerequisites:

You need to have installed the following softwares.

After getting all the required software you may run the following commands to get everything ready:

  1. Install PHP dependencies:

  2. Install NPM dependences:

Now you are good to go! Happy coding!

Unit testing

This project use Jasmine-Node and PHPUnit. All tests are stored at tests directory.

To run all JS tests type in you terminal:

To run all PHP tests type in your terminal:


All versions of laravel-js-lang-converter with dependencies

PHP Build Version
Package Version
Requires php Version >=7.0
laravel/framework Version ~5.5
tedivm/jshrink Version 1.0.*
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 michele-angioni/laravel-js-lang-converter contains the following files

Loading the files please wait ....