Download the PHP package michele-angioni/multi-language without Composer

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

MULTI LANGUAGE

Build Status License Build Status SensioLabsInsight

Introduction

Multi Language is a Laravel 5.1+ package which handles localization. It acts as a wrapper for Laravel localization and lets ease translations of your default lang files into new languages.

In case of incompatibilities or errors with Laravel 5.1 - 5.3, or for PHP 5.6, please use version 0.3.

Installation

Multi Language can be installed through Composer, just include "michele-angioni/multi-language": "~0.4" to your composer.json and than run composer update.

Configuration

Add the following service providers under the providers array in your app.php configuration file

Multi Language can be highly customized by publishing the configuration file through the artisan command artisan command php artisan vendor:publish.
It will create the ma_multilanguage.php file in your config directory. You can than edit the config.php file in your config directory to customize the Multi Language behaviour:

Usage

The MicheleAngioni\MultiLanguage\LanguageManager class is the class that accesses all Multi Language features. By default it will uses the Laravel file system manager and the Laravel localization feature.

You can inject it in the constructor of the one of your classes or directly instance it by using the Laravel Application facade App::make('MicheleAngioni\MultiLanguage\LanguageManager') and use its methods:

(optional) Custom File System and Translator

By default the Language Manager uses the Laravel file system manager and the Laravel localization feature. You can override that by defining your own file system (which has to implement the MicheleAngioni\MultiLanguage\FileSystemInterface) and translator (which has to implement the MicheleAngioni\MultiLanguage\TranslatorInterface) The two new files can be injected in the Language Manager constructor by commenint the 'MicheleAngioni\MultiLanguage\LanguageManagerBindServiceProvider' line in the app.php conf file and defining your custom binding in a new service provider.

Example

Suppose we have a users.php file under the app/lang/en directory

which contains

Let's suppose we want to create a Spanish version of the file. We can build a controller handling the language management

and write down some methods to handle the requests.

The above $languages variable would just be a single value array ['en'] since we only have the /en folder under /lang.

We now need a list of the English files:

The showFiles() method would just return ['users'] as we have just one file in our /lang/en folder.

Let's examine the content of the file

The above method returns an array with the file content.

Let's now create a Spanish version. First of all we must create the /es folder under the /lang folder

We then obviously need a view to submit the Spanish sentences and we leave it up to you. An associative array with key => sentence structure must be sent from the view to the following method

Contribution guidelines

Support follows PSR-1, PSR-2 and PSR-4 PHP coding standards and semantic versioning.

Please report any issue you find in the issues page. Pull requests are welcome.

License

Support is free software distributed under the terms of the MIT license.

Contacts

Feel free to contact me.


All versions of multi-language with dependencies

PHP Build Version
Package Version
Requires php Version >=7.0.0
laravel/framework Version ~5.1
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/multi-language contains the following files

Loading the files please wait ....