Download the PHP package aitor24/laralang without Composer

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

Laralang

StyleCI Scrutinizer Latest Stable Version License

What is Laralang?

Laralang is a laravel packages that allows you to translate your app or parts of your app from views using translations services like google or mymemory, and then store it on your DB to filter and manage easily from our admin panel.

Moreover, allows you to translate PHP files easily and then save lot of time to you.

Why use Laralang?

Personally I think the best way to translate your website is using the Laravel methods such as @lang() but sometimes it's impossible. Imagine you have a blog, and you need to translate it to different languages. With Laralang it's soo easy to do it, only place a little code like following example and laralang will translate it from your favourite translation service or well loading a stored translation on your database.

Getting Started

Step 1. Install it with composer

Running the command below:

Step 2. Register service provider & aliases

Include the line below to config/app.php inside providers array :

Include the line below to config/app.php inside aliases array :

Step 3. Publish vendor

It will publish assets and config file.

Running the command below:

Step 4. Migrate

Running the command below:

Step 5. Configure defalt values

STRONGLY IMPORTANT: Change the password on config (Default password: laralangAdmin )

Apart from the password, the rest of default values can be modified also on config/laralang.php. Furthermore you can modify these in a specific translation with the functions below.

Available Translators: Google Translator, MyMemory, Apertium (Strongly not recomended)

config values for translators: 'google', 'mymemory', 'apertium'

Using laralang

Simple examples of use

Then few examples of use laralang:

NOTE: Use {{ }} statements if translations comes from users to prevent XSS atacks

Then the result:

Result of example

Admin panel

Firsts steps

First you should be logged into loaralang

Route prefix can be changed on your config file, but by default it's laralang

You should visit next url:

http://domain/laralang/login

or in localhost you should visit

http://localhost/project-path/public/laralang/login

Then you should see the laralang login page (photo below)

Laralang login page

Now you must enter the password you set on Step 5 and then click login to manage your translations as can be seen on photos below!

View of translations

Editing translation #3

Filtering translations

Laralang also lets you filter translations by from_lang and / or to_lang. Below you have an example:

First we must access to filter view in route http://domain/laralang/translations/filter or well accessing across menu.

Menu

Then you can select from which language provides the originals strings and then from which language are translated this string with two selectors:

Filtering

Then the result:

Filtering result

Translations via api

There exists an api to get translated text. First of all you should enable it on config, then you should configure ajax as explained in laravel official site and then call api (method=POST)

Translating PHP files

Laralang can generate PHP translations files quickly by translating from english to language you want and save a lot of time!

After login to admin panel, you will find something like this:

Home

Here you simply click on translate PHP files and then you should see this view:

Translations

Here you can click translate and all files of resources/lang/en will be translated into languages you choose in the form input!

Then on resources/lang/ you will find a folder for each language with it's respective files translated.

API

trans() method

This functions is used to get a translation from a string to another language specified on default values, on app_locale or in every function.

To simplify work we've implemented another package (Localizer) to set app_locale via middleware and it allows to get user browser language to set it as app_locale easily.

Functions of trans()

from()

It sets the language of the string to translate in a specific translation.

Default: en

to()

It sets the language that you'll output in a specific translation.

Default: app_locale

debug()

Debug option let you to know the reason of an unexpected result with colorful messages in a specific translation.

Default: false

Save()

Save option let you to save a specific translation.

Default: false


fromLanguages() method

Returns an array with all languages from provides strings to translate.

toLanguages() method

Returns an array with all languages that at least one string has been translated.

getLanguages() method

Returns an array with ['key' => 'value'] where key is a language and value is an acronym from all languages tested in laralang.


All versions of laralang with dependencies

PHP Build Version
Package Version
Requires php Version >=5.6.4
illuminate/support Version ^5.4
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 aitor24/laralang contains the following files

Loading the files please wait ....