Download the PHP package simexis/multi-language without Composer

On this page you can find all versions of the php package simexis/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

Laravel 5.x Multilanguage and localization module

Note: This package use by default use language ISO 639-1 two-letter codes for locale: https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes

The idea for this package is based on: Laravel-Translatable Upgrading Laravel's localization module Laravel 5 Translation Manager

Installation

Require this package in your composer.json and run composer update (or run composer require simexis/multi-language directly):

simexis/multi-language

After updating composer, add the ServiceProvider to the providers array in config/app.php

You need to run the publish and migration.

$ php artisan vendor:publish
$ php artisan migrate

Routes are added in the ServiceProvider. You can set the group parameters for the routes in the configuration. You can change the prefix or filter/middleware for the routes. If you want full customisation, you can extend the ServiceProvider and override the map() function.

This example will make the translation manager available at http://yourdomain.com/multilanguage

Usage

Set current locale.

Thene package work with ru locale.

Usage translation part

Web interface

When you have imported your translation (via buttons or command), you can view them in the webinterface (on the url you defined the with the controller). You can click on a translation and an edit field will popup. Just click save and it is saved :) When a translation is not yet created in a different locale, you can also just edit it to create it.

Using the buttons on the webinterface, you can append, replace, truncate and clear the translations.

You can also use the commands below.

Import command

The import command will search through resources/lang and load all strings in the database, so you can easily manage them.

$ php artisan translator:append

Note: By default, only new strings are added. Translations already in the DB are kept the same. If you want to replace all values with the ones from the files, use replace command: php artisan translator:replace

Truncate (delete) all transaltions from Database.

$ php artisan translator:truncate

Clear non existings translations.

$ php artisan translator:clear

Usage Url modifier for local prefix

For transform link from http://yourdomain.com/page to http://yourdomain.com/en/page, just use route or url functions. Example url('page') display http://yourdomain.com/en/page where en is App::getLocale()

Usage translatable models

Demo

Getting translated attributes

Saving translated attributes

Filling multiple translations

Step 1: Migrations

In this example, we want to translate the model Country. We will need an extra table country_translations:

Step 2: Models

  1. The translatable model Country should use the trait Simexis\MultiLanguage\Traits\Translatable.
  2. The convention for the translation model is CountryTranslation.

The array $translatedAttributes contains the names of the fields being translated in the "Translation" model.

Configuration

The translation model

The convention used to define the class of the translation model is to append the keyword Translation.

So if your model is \MyApp\Models\Country, the default translation would be \MyApp\Models\CountryTranslation.

To use a custom class as translation model, define the translation class (including the namespace) as parameter. For example:


All versions of multi-language with dependencies

PHP Build Version
Package Version
Requires php Version >=5.5.9
illuminate/support Version >=5.0.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 simexis/multi-language contains the following files

Loading the files please wait ....