2017 © Pedro Peláez
 

platform-extension localization

Localization

image

sanatorium/localization

Localization

  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 50 Versions
  • 0 % Grown

The README.md

sanatorium/localization

Localization, (*1)

Contents

  1. Installation
  2. Documentation
  3. Changelog
  4. Support
  5. Hooks

Installation

Composer

Add repository to your composer.json, (*2)

"repositories": [
  {
    "type": "composer",
    "url": "http://repo.sanatorium.ninja"
  }
]

Download the package, (*3)

composer require sanatorium/localization

Add following line to app/Http/Kernel.php, (*4)

protected $middleware = [
    ...
    \Sanatorium\Localization\Middleware\Locale::class
];

Documentation

There are two terms used throughout this package - Localization and Translation, let's describe the difference:, (*5)

Localization

We use localization for localized value of entity key. For example used like this:, (*6)

{{-- Original value --}}
{{ $page->meta_title }}

{{-- Localized value --}}
@localize($page, 'meta_title')

Translation

Translation refers to original translation feature of Laravel and does not need any special markup. Special admin screen to manage translations is provided., (*7)

trans('platform/pages::common.title')

Localize entity field

Register new localized entity

// Register new localized entity
$this->app['sanatorium.localization.localized']->localize(
    'Platform\Menus\Models\Menu'
);

Localize entity field

@localize($entity, 'field')

Translate strings

General app and package language strings can be changed from, (*8)

/resources/langs/override/{LOCALE}
/resources/langs/override/{VENDOR}/{PACKAGE}/{LOCALE}

These language strings are managed from, (*9)

/admin/localization/translations

Languages

Manage languages available for the users on the site., (*10)

Single request locale setting

Set GET param 'locale' to any supported locale, like this, (*11)

http://example.com/?locale=en

Persistent locale setting

From browser

Set GET param 'active_locale' to any supported locale, like this, (*12)

http://example.com/?active_locale=en

In code

Set active_language_locale session to desired locale., (*13)

Translations

Manage string translation in localization files., (*14)

Functions

transattr($slug, $fallback = null, $locale = null)

transvalue($slug, $fallback = null, $locale = null)

Changelog

  • 3.1.1 - 2016-09-23 - Helper functions
  • 3.0.9 - 2016-09-15 - Platform 5, caching
  • 0.4.0 - 2016-07-23 - Translation strings override, entity field localization
  • 0.3.0 - 2016-05-23 - Translation strings manager
  • 0.2.3 - 2016-05-22 - Basic readme file

Support

Support not available., (*15)

Hooks

'shop.header' => 'sanatorium/localization::hooks.languages',  // @deprecated
'language.switch' => 'sanatorium/localization::hooks.languages',

The Versions

23/10 2016

dev-master

9999999-dev

Localization

  Sources   Download

The Requires

 

by Avatar mattluk

laravel extension platform cartalyst madeinsane

23/10 2016

3.2.6

3.2.6.0

Localization

  Sources   Download

The Requires

 

by Avatar mattluk

laravel extension platform cartalyst madeinsane

18/10 2016

3.2.5

3.2.5.0

Localization

  Sources   Download

The Requires

 

by Avatar mattluk

laravel extension platform cartalyst madeinsane

17/10 2016

3.2.4

3.2.4.0

Localization

  Sources   Download

The Requires

 

by Avatar mattluk

laravel extension platform cartalyst madeinsane

17/10 2016

3.2.3

3.2.3.0

Localization

  Sources   Download

The Requires

 

by Avatar mattluk

laravel extension platform cartalyst madeinsane

17/10 2016

3.2.2

3.2.2.0

Localization

  Sources   Download

The Requires

 

by Avatar mattluk

laravel extension platform cartalyst madeinsane

17/10 2016

3.2.1

3.2.1.0

Localization

  Sources   Download

The Requires

 

by Avatar mattluk

laravel extension platform cartalyst madeinsane

12/10 2016

3.2.0

3.2.0.0

Localization

  Sources   Download

The Requires

 

by Avatar mattluk

laravel extension platform cartalyst madeinsane

02/10 2016

3.1.9

3.1.9.0

Localization

  Sources   Download

The Requires

 

by Avatar mattluk

laravel extension platform cartalyst madeinsane

02/10 2016

3.1.8

3.1.8.0

Localization

  Sources   Download

The Requires

 

by Avatar mattluk

laravel extension platform cartalyst madeinsane

29/09 2016

3.1.7

3.1.7.0

Localization

  Sources   Download

The Requires

 

by Avatar mattluk

29/09 2016

3.1.6

3.1.6.0

Localization

  Sources   Download

The Requires

 

by Avatar mattluk

28/09 2016

3.1.5

3.1.5.0

Localization

  Sources   Download

The Requires

 

by Avatar mattluk

26/09 2016

3.1.4

3.1.4.0

Localization

  Sources   Download

The Requires

 

by Avatar mattluk

23/09 2016

3.1.3

3.1.3.0

Localization

  Sources   Download

The Requires

 

by Avatar mattluk

23/09 2016

3.1.2

3.1.2.0

Localization

  Sources   Download

The Requires

 

by Avatar mattluk

23/09 2016

3.1.1

3.1.1.0

Localization

  Sources   Download

The Requires

 

by Avatar mattluk

15/09 2016

3.1.0

3.1.0.0

Localization

  Sources   Download

The Requires

 

by Avatar mattluk

15/09 2016

3.0.9

3.0.9.0

Localization

  Sources   Download

The Requires

 

by Avatar mattluk

12/09 2016

3.0.8

3.0.8.0

Localization

  Sources   Download

The Requires

 

by Avatar mattluk

10/09 2016

3.0.7

3.0.7.0

Localization

  Sources   Download

The Requires

 

by Avatar mattluk

07/09 2016

3.0.6

3.0.6.0

Localization

  Sources   Download

The Requires

 

by Avatar mattluk

07/09 2016

3.0.5

3.0.5.0

Localization

  Sources   Download

The Requires

 

by Avatar mattluk

07/09 2016

3.0.4

3.0.4.0

Localization

  Sources   Download

The Requires

 

by Avatar mattluk

07/09 2016

3.0.3

3.0.3.0

Localization

  Sources   Download

The Requires

 

by Avatar mattluk

27/08 2016

3.0.2

3.0.2.0

Localization

  Sources   Download

The Requires

  • cartalyst/composer-installers 1.2.*
  • php >=5.4.0
  • platform/foundation >=2.0 <5.0

 

by Avatar mattluk

27/08 2016

3.0

3.0.0.0

Localization

  Sources   Download

The Requires

  • cartalyst/composer-installers 1.2.*
  • php >=5.4.0
  • platform/foundation >=2.0 <5.0

 

by Avatar mattluk

07/08 2016

0.5.1

0.5.1.0

Localization

  Sources   Download

The Requires

  • cartalyst/composer-installers 1.2.*
  • php >=5.4.0
  • platform/foundation 2.0.*|3.0.*

 

by Avatar mattluk

06/08 2016

0.5.0

0.5.0.0

Localization

  Sources   Download

The Requires

  • cartalyst/composer-installers 1.2.*
  • php >=5.4.0
  • platform/foundation 2.0.*|3.0.*

 

by Avatar mattluk

25/07 2016

0.4.1

0.4.1.0

Localization

  Sources   Download

The Requires

  • cartalyst/composer-installers 1.2.*
  • php >=5.4.0
  • platform/foundation 2.0.*|3.0.*

 

by Avatar mattluk

25/07 2016

0.4.2

0.4.2.0

Localization

  Sources   Download

The Requires

  • cartalyst/composer-installers 1.2.*
  • php >=5.4.0
  • platform/foundation 2.0.*|3.0.*

 

by Avatar mattluk

23/07 2016

0.4.0

0.4.0.0

Localization

  Sources   Download

The Requires

  • cartalyst/composer-installers 1.2.*
  • php >=5.4.0
  • platform/foundation 2.0.*|3.0.*

 

by Avatar mattluk

21/07 2016

0.3.8

0.3.8.0

Localization

  Sources   Download

The Requires

  • cartalyst/composer-installers 1.2.*
  • php >=5.4.0
  • platform/foundation 2.0.*|3.0.*

 

by Avatar mattluk

21/07 2016

0.3.7

0.3.7.0

Localization

  Sources   Download

The Requires

  • cartalyst/composer-installers 1.2.*
  • php >=5.4.0
  • platform/foundation 2.0.*|3.0.*

 

by Avatar mattluk

21/07 2016

0.3.6

0.3.6.0

Localization

  Sources   Download

The Requires

  • cartalyst/composer-installers 1.2.*
  • php >=5.4.0
  • platform/foundation 2.0.*|3.0.*

 

by Avatar mattluk

19/07 2016

0.3.5

0.3.5.0

Localization

  Sources   Download

The Requires

  • cartalyst/composer-installers 1.2.*
  • php >=5.4.0
  • platform/foundation 2.0.*|3.0.*

 

by Avatar mattluk

31/05 2016

0.3.4

0.3.4.0

Localization

  Sources   Download

The Requires

  • cartalyst/composer-installers 1.2.*
  • php >=5.4.0
  • platform/foundation 2.0.*|3.0.*

 

by Avatar mattluk

23/05 2016

0.3.3

0.3.3.0

Localization

  Sources   Download

The Requires

  • cartalyst/composer-installers 1.2.*
  • php >=5.4.0
  • platform/foundation 2.0.*|3.0.*

 

by Avatar mattluk

23/05 2016

0.3.2

0.3.2.0

Localization

  Sources   Download

The Requires

  • cartalyst/composer-installers 1.2.*
  • php >=5.4.0
  • platform/foundation 2.0.*|3.0.*

 

by Avatar mattluk

23/05 2016

0.3.1

0.3.1.0

Localization

  Sources   Download

The Requires

  • cartalyst/composer-installers 1.2.*
  • php >=5.4.0
  • platform/foundation 2.0.*|3.0.*

 

by Avatar mattluk

23/05 2016

0.3.0

0.3.0.0

Localization

  Sources   Download

The Requires

  • cartalyst/composer-installers 1.2.*
  • php >=5.4.0
  • platform/foundation 2.0.*|3.0.*

 

by Avatar mattluk

13/05 2016

0.2.2

0.2.2.0

Localization

  Sources   Download

The Requires

 

by Avatar mattluk

12/05 2016

0.2.1

0.2.1.0

Localization

  Sources   Download

The Requires

 

by Avatar mattluk

12/05 2016

0.2.0

0.2.0.0

Localization

  Sources   Download

The Requires

 

by Avatar mattluk

10/05 2016

0.1.5

0.1.5.0

Localization

  Sources   Download

The Requires

 

by Avatar mattluk

10/05 2016

0.1.6

0.1.6.0

Localization

  Sources   Download

The Requires

 

by Avatar mattluk

10/05 2016

0.1.4

0.1.4.0

Localization

  Sources   Download

The Requires

 

by Avatar mattluk

14/04 2016

0.1.3

0.1.3.0

Localization

  Sources   Download

The Requires

  • cartalyst/composer-installers 1.2.*
  • php >=5.4.0
  • platform/foundation 2.0.*|3.0.*

 

by Avatar mattluk

14/04 2016

0.1.2

0.1.2.0

Localization

  Sources   Download

The Requires

  • cartalyst/composer-installers 1.2.*
  • php >=5.4.0
  • platform/foundation 2.0.*|3.0.*

 

by Avatar mattluk

14/04 2016

0.1.1

0.1.1.0

Localization

  Sources   Download

The Requires

  • cartalyst/composer-installers 1.2.*
  • php >=5.4.0
  • platform/foundation 2.0.*|3.0.*

 

by Avatar mattluk