PHP Classes

Laravel Translator API: Get application text translations from JSON files

Recommend this page to a friend!
  Info   View files Documentation   View files View files (21)   DownloadInstall with Composer Download .zip   Reputation   Support forum   Blog (1)    
Last Updated Ratings Unique User Downloads Download Rankings
2021-09-30 (2 months ago) RSS 2.0 feedNot yet rated by the usersTotal: 16 All time: 10,462 This week: 282Up
Version License PHP version Categories
laravel-translator 1.0.0MIT/X Consortium ...5Localization, PHP 5, Web services
Description Author

This package can get application text translations from JSON files.

It can work as an API to return strings that translate the application texts for a given language.

The package retrieves the translation strings from JSON files stored inside a configurable directory.

Innovation Award
PHP Programming Innovation award nominee
September 2021
Number 8
This package can get application text translations from JSON files.

It can work as an API to return strings that translate the application texts for a given language.

The package retrieves the translation strings from JSON files stored inside a configurable directory.

Manuel Lemos
Picture of Isa Eken
  Performance   Level  
Name: Isa Eken <contact>
Classes: 14 packages by
Country: Turkey Turkey
Age: 19
All time rank: 329151 in Turkey Turkey
Week rank: 151 Up2 in Turkey Turkey Up
Innovation award
Innovation award
Nominee: 9x

Details

Laravel translation helpers

Latest Version on Packagist GitHub Tests Action Status GitHub Code Style Action Status Total Downloads

Installation

You can install the package via composer:

composer require isaeken/laravel-translator

You can publish the config file with:

php artisan vendor:publish --provider="IsaEken\LaravelTranslator\LaravelTranslatorServiceProvider" --tag="laravel-translator-config"

This is the contents of the published config file:

return [
    'supported_languages' => [
        'en' => 'English',
    ],

    'abort_if_unsupported' => false,
];

Usage

__('Hello World'); // Save to your fallback language file in not production environment.

See `/api/translator/?locale=tr`

Changelog

Please see CHANGELOG for more information on what has changed recently.

Contributing

Please see CONTRIBUTING for details.

Security Vulnerabilities

Please review our security policy on how to report security vulnerabilities.

Credits

License

The MIT License (MIT). Please see License File for more information.

  Files folder image Files  
File Role Description
Files folder image.github (3 files, 2 directories)
Files folder imageconfig (1 file)
Files folder imageroutes (1 file)
Files folder imagesrc (3 files, 2 directories)
Plain text file .editorconfig Data Auxiliary data
Plain text file .php_cs.dist.php Example Example script
Plain text file CHANGELOG.md Data Auxiliary data
Plain text file composer.json Data Auxiliary data
Plain text file LICENSE.md Lic. License text
Plain text file phpunit.xml.dist Data Auxiliary data
Plain text file README.md Doc. Documentation

  Files folder image Files  /  .github  
File Role Description
Files folder imageISSUE_TEMPLATE (1 file)
Files folder imageworkflows (2 files)
  Plain text file CONTRIBUTING.md Data Auxiliary data
  Plain text file FUNDING.yml Data Auxiliary data
  Plain text file SECURITY.md Data Auxiliary data

  Files folder image Files  /  .github  /  ISSUE_TEMPLATE  
File Role Description
  Plain text file config.yml Data Auxiliary data

  Files folder image Files  /  .github  /  workflows  
File Role Description
  Plain text file php-cs-fixer.yml Data Auxiliary data
  Plain text file run-tests.yml Data Auxiliary data

  Files folder image Files  /  config  
File Role Description
  Plain text file translator.php Conf. Configuration script

  Files folder image Files  /  routes  
File Role Description
  Plain text file translations.php Appl. Application script

  Files folder image Files  /  src  
File Role Description
Files folder imageHttp (2 directories)
Files folder imageTranslation (1 file)
  Plain text file LaravelTranslator.php Class Class source
  Plain text file LaravelTranslatorFacade.php Class Class source
  Plain text file LaravelTranslatorServiceProvider.php Class Class source

  Files folder image Files  /  src  /  Http  
File Role Description
Files folder imageControllers (1 file)
Files folder imageMiddleware (1 file)

  Files folder image Files  /  src  /  Http  /  Controllers  
File Role Description
  Plain text file LocaleController.php Class Class source

  Files folder image Files  /  src  /  Http  /  Middleware  
File Role Description
  Plain text file Localization.php Class Class source

  Files folder image Files  /  src  /  Translation  
File Role Description
  Plain text file Translator.php Class Class source

 Version Control Unique User Downloads Download Rankings  
 100%
Total:16
This week:0
All time:10,462
This week:282Up
For more information send a message to info at phpclasses dot org.