2017 © Pedro Peláez
 

library localization

Simple subdomain localization for Laravel.

image

torann/localization

Simple subdomain localization for Laravel.

  • Tuesday, May 29, 2018
  • by torann
  • Repository
  • 2 Watchers
  • 1 Stars
  • 2,386 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 8 Versions
  • 11 % Grown

The README.md

Laravel Localization - Simplified

Latest Stable Version Total Downloads Patreon donate button Donate weekly to this project using Gratipay Donate to this project using Flattr Donate to this project using Paypal, (*1)

Simplified localization for Laravel based on the application's subdomain., (*2)

Table of Contents

Installation

Composer

From the command line run:, (*3)

$ composer require torann/localization

Laravel

Once installed you need to register the service provider with the application. Open up config/app.php and find the providers key., (*4)

``` php 'providers' => [, (*5)

\Torann\Localization\LocalizationServiceProvider::class,

], (*6)


### Publish the configurations Run this on the command line from the root of your project: ```bash php artisan vendor:publish --provider="Torann\Localization\LocalizationServiceProvider"

A configuration file will be publish to config/localization.php., (*7)

Methods

The following methods are available:, (*8)

Torann\Localization\LocaleManager

  • getNonLocalizedURL($url = null)
  • getDefaultLocale()
  • setLocale($locale = null)
  • localizeURL($locale = null, $url = null)
  • getLocalizedURL($locale = null, $url = null, $attributes = [])
  • getSupportedLocales()
  • getCurrentLocale()
  • getCurrentLocaleDirection()
  • getCurrentLocaleName()
  • getCurrentLocaleNative()
  • getCurrentLocaleScript()
  • getCurrentLocaleNativeReading()
  • getSupportedLanguagesKeys()
  • checkLocaleInSupportedLocales($locale)
  • getConfig($key, $default = null)

Helpers

Laravel Localization comes with a few helper methods, (*9)

localization()

Returns the Torann\Localization\LocaleManager instance., (*10)

localize_url($locale = null, $url = null, $attributes = [])

Returns the given URL adapted to provided locale., (*11)

Determining Locale

By Subdomain

For this to work the subdomain needs to match an enabled supported locale key., (*12)

By Host

When the given subdomain is determined to not be valid the system can then set the locale depending on the current host. You'll need to set a map of your application's locales to hosts using the hosts configuration option., (*13)

License

Localization is open-sourced software licensed under the BSD 2-Clause License., (*14)

The Versions

29/05 2018

dev-master

9999999-dev

Simple subdomain localization for Laravel.

  Sources   Download

BSD-2-Clause BSD 2-Clause

The Requires

 

The Development Requires

laravel locale localization subdomain

03/06 2017

0.1.6

0.1.6.0

Simple subdomain localization for Laravel.

  Sources   Download

BSD 2-Clause

The Requires

 

The Development Requires

laravel locale localization subdomain

05/02 2017

0.1.5

0.1.5.0

Simple subdomain localization for Laravel.

  Sources   Download

BSD 2-Clause

The Requires

 

The Development Requires

laravel locale localization subdomain

05/02 2017

0.1.4

0.1.4.0

Simple subdomain localization for Laravel.

  Sources   Download

BSD 2-Clause

The Requires

 

The Development Requires

laravel locale localization subdomain

26/01 2017

0.1.3

0.1.3.0

Simple subdomain localization for Laravel.

  Sources   Download

BSD 2-Clause

The Requires

 

The Development Requires

laravel locale localization subdomain

01/09 2016

0.1.2

0.1.2.0

Simple subdomain localization for Laravel.

  Sources   Download

BSD 2-Clause

The Requires

 

The Development Requires

laravel locale localization subdomain

13/06 2016

0.1.1

0.1.1.0

Simple subdomain localization for Laravel.

  Sources   Download

BSD 2-Clause

The Requires

 

The Development Requires

laravel locale localization subdomain

03/05 2016

0.1.0

0.1.0.0

Simple subdomain localization for Laravel.

  Sources   Download

BSD 2-Clause

The Requires

 

The Development Requires

laravel locale localization subdomain