Download the PHP package alright/laravel-icu without Composer

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

Laravel Intl Translator

Build Status Latest Stable Version Latest Unstable Version

Introduction

Laravel ICU uses php-intl extension to provide translation for your application.

Please mind that this package breaks framework default behaviour for validators.

Due to MessageFormatter::formatMessage method, Validator::replacer method should return array of parameters as key-value pair, instead replacing placeholders in message.

Besides that app('translator')->get($key) always returns message in raw format (unparsed). Translated messages are returned by:

Requirements

Please feel free to contribute to this package for other Laravel versions support!

Installation

If you do not have php-intl extension you can install it by following command (Ubuntu, Debian)

If you have other OS, you can use it's respective package manager

All versions

In your config/app.php providers
Remove line

And add line:

Publishing config and language files

Be careful! This will override your existing resources/lang/{lang} files! Check Currently adapted locales table to see which files could be overriden.

If you would like to publish only config

If you would like to publish only one language files set


Currently adapted locales

Locale Published files
en auth.php, validation.php
pl auth.php, pagination.php, passwords.php, validation.php

Usage examples

Both trans() and trans_choice() helper functions use this translator, so the only thing you have to change is your language files.

For detailed documentation please visit php's MessageFormatter docs and links related there

Placeholders

app/resources/lang/en/custom.php

view.blade.php

Returns

Select

app/resources/lang/en/custom.php

view.blade.php

Returns

Plurals

app/resources/lang/en/custom.php

view.blade.php

Returns

Instead of trans_choice() you can you use trans() helper as well.

resources/lang/en/custom.php

view.blade.php

Returns


As you can see, the only thing trans_choice() do is passing first argument as n parameter to trans() helper.

Plural offset

You can set offset for your plural rules. Consider this example:

Result:


Plural rule are often very complex for languages. Intl does handle it for you.
For example in Polish few rule is applied when n % 10 = 2..4 and n % 100 != 12..14, while many rule is applied when n != 1 and n % 10 = 0..1 or n % 10 = 5..9 or n % 100 = 12..14.
In Serbian =1 will match when n = 1, but one will apply when n = 1, 21, 31, 41 etc.

Remember! You always have to provide other rule for plural translations.

For more details about pluralization please visit CLDR Plural Rules specificaton and CLDR Language plural rules.

Formatting in details

PHP's MessageFormatter also supports ordinal, spellout, number, date, time and duration formatting.
For detailed information please visit this great Yii2 Framework i18n Guide which covers every intl topic wonderfully.


All versions of laravel-icu with dependencies

PHP Build Version
Package Version
Requires ext-intl Version *
illuminate/support Version ^5.3
illuminate/translation Version ^5.3
illuminate/validation Version ^5.3
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 alright/laravel-icu contains the following files

Loading the files please wait ....