Skip to content

elaborate-code/php-json-tongue

Repository files navigation

PHP JSON tongue

Packagist Version Packagist Downloads GitHub Workflow Status Test Coverage GitHub Workflow Status

A Facade for loading localization data from JSONs within a lang folder

Get started

composer require elaborate-code/php-json-tongue

Usage

Set the file structure.

illustration

Then use the facade.

use ElaborateCode\JsonTongue\TongueFacade;

$tongue = new TongueFacade('/lang');

$localization = $tongue->transcribe();

$localization will look like:

$localization = [
    "es" => [
        "programmer" => "programador",
        "interviewer" => "entrevistador",
        "Hello" => "Hola",
        "Good morning" => "buenos dias",
        //...
    ],
    "fr" => [
        "Hello" => "Salut",
        "Good morning" => "Bonjour",
        //...
    ]
    //...
];

Testing

vendor/bin/pest

Changelog

Contributing

Please see CONTRIBUTING for details.

License

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

Contributors 2

  •  
  •  

Languages