localization in laravel

Download Localization in laravel

Post on 19-Mar-2017

132 views

Category:

Technology

0 download

Embed Size (px)

TRANSCRIPT

Localization in Laravel

Localization in Laravel Laravel app?

FILES LOCATION ?

en/passwords.php

gr/passwords.php

, .

Configure the locale

FALLBACK LOCALE (config/app.php)'fallback_locale' => 'en',

Determine the locale

Code in laravel blade view()

@lang(langfile.variable) directiveThe filename in /resources/lang/enA key name that holds the translated string

Alternative syntax

{{ trans(langfile.variable) }}

Alternative syntax

{{ Lang::get(langfile.variable) }}

Replace paramsLangfile /el/app.phpwelcome => :Blade view{{ trans(app.welcome, [name=>George) }}

PluralizationLangfile /el/app.phpinvoiceFound => | :invoices Blade view{{ trans_choice(app.invoiceFound, 2, [invoices=>2) }}

Overriding package lang filesresources/lang/vendor/{package}/{locale}

Composer packages helpers for Localization in Laravel . 2 .

mcamara/laravel-localizationhttps://github.com/mcamara/laravel-localization

barryvdh/laravel-translation-managerhttps://github.com/barryvdh/laravel-translation-manager

George Drakakis

Thank you!@lollypopgr / github.com/drakakisgeo