All Projects → awes-io → Localization Helper

awes-io / Localization Helper

Licence: other
🎌 Laravel Localization Helper :: Easily add translation variables from Blade templates.

Programming Languages

language
365 projects

Projects that are alternatives of or similar to Localization Helper

Linguist
Easy multilingual urls and redirection support for the Laravel framework
Stars: ✭ 188 (+506.45%)
Mutual labels:  translation, laravel, localization
Laravel Pt Br Localization
Tradução do Laravel para português brasileiro (pt_BR locale)
Stars: ✭ 373 (+1103.23%)
Mutual labels:  translation, laravel, localization
Lingver
Manage your application locale and language.
Stars: ✭ 300 (+867.74%)
Mutual labels:  translation, localization
React Localize Redux
Dead simple localization for your React components
Stars: ✭ 384 (+1138.71%)
Mutual labels:  translation, localization
Laravel Translation Loader
Store your translations in the database or other sources
Stars: ✭ 446 (+1338.71%)
Mutual labels:  translation, laravel
Eo Locale
🌏Internationalize js apps 👔Elegant lightweight library based on Internationalization API
Stars: ✭ 290 (+835.48%)
Mutual labels:  translation, localization
Js Lingui
🌍📖 A readable, automated, and optimized (5 kb) internationalization for JavaScript
Stars: ✭ 3,249 (+10380.65%)
Mutual labels:  translation, localization
Stringz
A lightweight and powerful editor for localizing iOS, macOS, tvOS, and watchOS applications.
Stars: ✭ 440 (+1319.35%)
Mutual labels:  translation, localization
labels
Bolt Labels extension - Translatable labels for Bolt
Stars: ✭ 18 (-41.94%)
Mutual labels:  translation, localization
Laravel Translatable
A Laravel package for multilingual models
Stars: ✭ 624 (+1912.9%)
Mutual labels:  translation, laravel
Fluent.js
JavaScript implementation of Project Fluent
Stars: ✭ 622 (+1906.45%)
Mutual labels:  translation, localization
Mobility
Pluggable Ruby translation framework
Stars: ✭ 644 (+1977.42%)
Mutual labels:  translation, localization
Tower
i18n & L10n library for Clojure/Script
Stars: ✭ 264 (+751.61%)
Mutual labels:  translation, localization
Docs L10n
Translations of TensorFlow documentation
Stars: ✭ 262 (+745.16%)
Mutual labels:  translation, localization
Mojito
An automation platform that enables continuous localization.
Stars: ✭ 256 (+725.81%)
Mutual labels:  translation, localization
Easy localization
Easy and Fast internationalizing your Flutter Apps
Stars: ✭ 407 (+1212.9%)
Mutual labels:  translation, localization
Fluent
Fluent — planning, spec and documentation
Stars: ✭ 818 (+2538.71%)
Mutual labels:  translation, localization
loco-php-sdk
Loco SDK for PHP including REST API client
Stars: ✭ 12 (-61.29%)
Mutual labels:  translation, localization
blazor-ui-messages
Localization messages for Telerik UI for Blazor components: https://www.telerik.com/blazor-ui
Stars: ✭ 24 (-22.58%)
Mutual labels:  translation, localization
Laravel Js Localization
🌐 Convert your Laravel messages and consume them in the front-end!
Stars: ✭ 451 (+1354.84%)
Mutual labels:  laravel, localization

LocalizationHelper

Coverage report Build status Composer Ready Downloads Last version

Package for convenient work with Laravel's localization features and fast language files generation. Take a look at contributing.md to see a to do list.

Installation

Via Composer

$ composer require awes-io/localization-helper

In Laravel 5.5+, service provider and facade will be automatically registered. For older versions, follow the steps below:

Register service provider in config/app.php:

'providers' => [
// [...]
        AwesIO\LocalizationHelper\LocalizationHelperServiceProvider::class,
],

You may also register LaravelLocalization facade:

'aliases' => [
// [...]
        'LocalizationHelper' => AwesIO\LocalizationHelper\Facades\LocalizationHelper::class,
],

Config

Config Files

In order to edit default configuration you may execute:

php artisan vendor:publish --provider="AwesIO\LocalizationHelper\LocalizationHelperServiceProvider"

After that, config/localizationhelper.php will be created.

Usage

Package registers global helper function _p($file_key, $default, $placeholders):

_p('auth.login', 'Login'); // "Login"

It will create new localization file auth.php (if it doesn't exist) and write second parameter as language string under login key:

return [
    "login" => "Login"
];

On second call with same file/key _p('auth.login'), localization string will be returned, file will remain untouched.

Placeholders are also supported:

_p(
    'mail.invitation', 
    'You’re invited to join :company company workspace', 
    ['company' => 'Awesio']
);

If key is returned, it means that string already exists in localization file and you are trying to add new one using its value as an array.

// in localization file.php
return [
    "test" => "Test string"
];

_p('file.test.new', 'Test string'); // will return "file.test.new"

_p('file.test_2.new', 'Test string'); // will return "Test string"

// and modify localization file:
return [
    "test" => "Test string",
    "test_2" => [
        "new" => "Test string"
    ]
];

Change log

Please see the changelog for more information on what has changed recently.

Testing

$ composer test

Contributing

Please see contributing.md for details and a todolist.

Security

If you discover any security related issues, please email [email protected] instead of using the issue tracker.

Credits

License

MIT

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].